gitloc-megannnnnnn 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: 78f72d4dc8bf01f00257caaab31e2a6dce601bf5
4
- data.tar.gz: 0fb279a75f5f7d67bcb54119bebae870c64c0fca
3
+ metadata.gz: 937dab1a78fb33487b62f71865eea4052114a2b4
4
+ data.tar.gz: 51d9bf1b534814c7c9965c23fcf29ba1019137ac
5
5
  SHA512:
6
- metadata.gz: 3fbc6c7fe8165d6ef4ca784f7839b980d328ccc9f0f79ae54f53fd19dec8c6fdf433cced6532c097dace8932bc97afdcf18d662e19e8c3a8ad4a25d71a4ca168
7
- data.tar.gz: 41702e5e5f70680fabb4e0878c45cf78f689f3391b53db7203abaec5412733485d3df3fda680379c307d5060855bf3856d7f3cfd5066fae4d9a187bd282faafc
6
+ metadata.gz: 7fbd09c298de4f984cbac359fadc8ae9dd6ec6bbfea8000c12363886eecd6ac9d5a05aa302f0b152737689046a765305dca11b7d15b3f5254a942f95e213d18c
7
+ data.tar.gz: d7b4a11bb2b741f75642d7fa7e414f9004a8c91d39d06c590d04f3d419533ad904172f89f80cb639bc630a77589aeaf610ddb6fee20ba51aaf619bee6fce512e
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-megannnnnnn'
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 Code Platoon, see https://github.com/darkstarre/gitloc-- gives lines-of-code information for a git repo."
@@ -0,0 +1,3 @@
1
+ class Gitloc
2
+ VERSION = '0.1.1'
3
+ end
data/lib/gitloc.rb ADDED
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitloc-megannnnnnn
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
  - Megan Nilles
@@ -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
  - test/acceptance_test.rb
25
27
  - test/fixtures/2loc
26
28
  homepage: https://github.com/darkstarre/gitloc