gitloc-Vince 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 560b9966ecf7977c49a3fee1d096527d1f832a71
4
- data.tar.gz: 53dfdb311a134db9087d3a0e8cc5a213a508eeb6
3
+ metadata.gz: c835d21d8d2cc712fa6705a5ef4c6fd8573840fe
4
+ data.tar.gz: aef59e724bc28e2a25a58f678bc6227218bcad43
5
5
  SHA512:
6
- metadata.gz: f78bac9926231c657d4e20b9ca53a020e1988d0ae1564adbea41b624eef3b45c1d0d128c1800aa7d3799c8a88ab826074fc3dc895f71738ac0c45861ad22c6d2
7
- data.tar.gz: 33bbbf849a5b119669998ea0e3fc23a03ca41c0ee4e2118050a45d61648eb6a018f208b632cf2257e82ceab69e82290ecd66d7e98e70b508d0874ebd28aadcb0
6
+ metadata.gz: 1874657b0f8ebbd8aa495d90504a08bc60b0fad4f724d55ee90a9ae2eeb5be0a82c5754d9ada337e2bad60a8f9b119c16dfc7f8b2f71537c2aa6f2224468f010
7
+ data.tar.gz: 7246dd5ecc2c6c44f50360d6d91af2923dcd7dad514e48b0b76c801946f3e08043ccf2a95230da0137287ba3b1f74001e4d84ff74487987c0d9b10a2c6d51ba3
data/bin/gitloc CHANGED
@@ -1,23 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
-
3
-
4
- require 'tmpdir'
5
- require 'open3'
6
-
7
- repo = ARGV.first
8
-
9
- Dir.mktmpdir { |dir|
10
- Dir.chdir dir
11
- out, err, status = Open3.capture3 'git', 'clone', repo, 'cloned'
12
- unless status.success?
13
- $stderr.puts out, err
14
- exit "Failed somehow >.<"
15
- end
16
- Dir.chdir 'cloned'
17
- files = Dir['**/*'].reject { |name| File.directory? name }
18
- files.each do |filename|
19
- loc = File.readlines(filename).count { |line| line !~ /^\s*$/ }
20
- puts "#{loc}\t#{filename}"
21
- end
22
- }
2
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
3
+ require 'gitloc'
4
+ Gitloc.call(ARGV, $stdout, $stderr)
23
5
 
@@ -1,7 +1,10 @@
1
+ $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
2
+ require 'gitloc/version'
3
+
1
4
  #nformation, not mine :)
2
5
  Gem::Specification.new do |s|
3
6
  s.name = 'gitloc-Vince'
4
- s.version = '0.1.0'
7
+ s.version = Gitloc::VERSION
5
8
  s.licenses = ['MIT']
6
9
  s.summary = "Example project -- gives lines-of-code information for a git repo"
7
10
  s.description = "Example project for the Turing School of Software and Design, see https://github.com/JoshCheek/elective-building-a-gem -- gives lines-of-code information for a git repo."
@@ -0,0 +1,24 @@
1
+ require 'tmpdir'
2
+ require 'open3'
3
+
4
+ require 'gitloc/version'
5
+
6
+ class Gitloc
7
+ def self.call(argv, outstream, errstream)
8
+ repo = argv.first
9
+ Dir.mktmpdir { |dir|
10
+ Dir.chdir dir
11
+ out, err, status = Open3.capture3 'git', 'clone', repo, 'cloned'
12
+ unless status.success?
13
+ errstream.puts out, err
14
+ exit "Failed somehow >.<"
15
+ end
16
+ Dir.chdir 'cloned'
17
+ files = Dir['**/*'].reject { |name| File.directory? name }
18
+ files.each do |filename|
19
+ loc = File.readlines(filename).count { |line| line !~ /^\s*$/ }
20
+ outstream.puts "#{loc}\t#{filename}"
21
+ end
22
+ }
23
+ end
24
+ end
@@ -0,0 +1,3 @@
1
+ class Gitloc
2
+ VERSION = '0.1.1'
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitloc-Vince
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince
@@ -21,6 +21,8 @@ files:
21
21
  - Readme.md
22
22
  - bin/gitloc
23
23
  - gitloc.gemspec
24
+ - lib/gitloc.rb
25
+ - lib/gitloc/version.rb
24
26
  - seeing_is_believing-2.2.0.gem
25
27
  - spec/acceptance_spec.rb
26
28
  - spec/fixtures/2loc