gitloc-nowsiany 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: b7909eb35073934fe766d9d1f7b383e5f8642139
4
- data.tar.gz: ba1225b35685d33b0bac38a1f5bc1688af4c7f8a
3
+ metadata.gz: 4fc13cd139bb63f737b7d1b37df59563fda9ca50
4
+ data.tar.gz: 84d76216f565982d02aa66d3d2c5ceb846a77fb6
5
5
  SHA512:
6
- metadata.gz: b4ffd413cd2f7adef5892227e091782ef73c8f0b25c0ca933993bb4f718f11b9cb243b1cb0b75d64e2a2d11f3d05a2ecc6556eabde193d3cf80619fada8acdd8
7
- data.tar.gz: 6a7f92cd5354b68bb19794f5fae25dfa634f16bcea1a492e9b263129e4b09204c68a95a0aa23ec50046ebf2b024976357ffb4e81dc8463fd9f500cb3977314d8
6
+ metadata.gz: cb8584bc7d97ec5da83197e2b0cfa202c5e111502ce858aa77fa98e60974de9fd9bdc84bf39d37f9a1553dc62836beb89dfd61a7ab61dbafe04a1913733bf6a4
7
+ data.tar.gz: e0ec96f685b5c5f75d5839b895fdf6f292c8a60f8ec1c375b0539725388eecb9065e7ab0de53aa6e8b62c4641f0074d7e23462388748f6137f7a529dce9b3bcd
data/bin/gitloc CHANGED
@@ -1,21 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
-
3
- require 'tmpdir'
4
- require 'open3'
5
-
6
- repo = ARGV.first
7
-
8
- Dir.mktmpdir { |dir|
9
- Dir.chdir dir
10
- out, err, status = Open3.capture3 'git', 'clone', repo, 'cloned'
11
- unless status.success?
12
- $stderr.puts out, err
13
- exit "Failed somehow >.<"
14
- end
15
- Dir.chdir 'cloned'
16
- files = Dir['**/*'].reject { |name| File.directory? name }
17
- files.each do |filename|
18
- loc = File.readlines(filename).count { |line| line !~ /^\s*$/ }
19
- puts "#{loc}\t#{filename}"
20
- end
21
- }
2
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
3
+ require 'gitloc'
4
+ Gitloc.call(ARGV, $stdout, $stderr)
data/gitloc.gemspec CHANGED
@@ -1,6 +1,9 @@
1
+ $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
2
+ require 'gitloc/version'
3
+
1
4
  Gem::Specification.new do |s|
2
5
  s.name = 'gitloc-nowsiany'
3
- s.version = '0.1.0'
6
+ s.version = Gitloc::VERSION
4
7
  s.licenses = ['MIT']
5
8
  s.summary = "Example project -- gives lines-of-code information for a git repo"
6
9
  s.description = "Example project for the Turing School of Software and Design, https://github.com/ndwhtlssthr/gitloc -- gives lines-of-code information for a git repo."
data/lib/gitloc.rb ADDED
@@ -0,0 +1,25 @@
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
+
10
+ Dir.mktmpdir { |dir|
11
+ Dir.chdir dir
12
+ out, err, status = Open3.capture3 'git', 'clone', repo, 'cloned'
13
+ unless status.success?
14
+ errstream.puts out, err
15
+ exit "Failed somehow >.<"
16
+ end
17
+ Dir.chdir 'cloned'
18
+ files = Dir['**/*'].reject { |name| File.directory? name }
19
+ files.each do |filename|
20
+ loc = File.readlines(filename).count { |line| line !~ /^\s*$/ }
21
+ outstream.puts "#{loc}\t#{filename}"
22
+ end
23
+ }
24
+ end
25
+ 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-nowsiany
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
  - Nathan Owsiany
@@ -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
  - spec/acceptance_spec.rb
25
27
  - spec/fixtures/2loc
26
28
  homepage: https://github.com/ndwhtlssthr/gitloc.git