gitloc-marissa 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
  SHA256:
3
- metadata.gz: 75f1794a27a1c87dec6872551779c6b57751b566f93fc9e8c288335ca85d7491
4
- data.tar.gz: 133076a6cb7f4a9ed1fe370d5a765c5c43a22ea7038c9eb27a2866ccfc8afe19
3
+ metadata.gz: 9581a63ce3be83e4e4655e43c15aef45b9bbe9cc58b2efd4b31d48c383e91a8b
4
+ data.tar.gz: 1377b5a374c082b687dcbe7ee491fec0ab46ee10ad6c6598085f2bda2641ab96
5
5
  SHA512:
6
- metadata.gz: e3485ee83b315f3b5cc1c8e4eb7f32f1591f65f89f7ac3e6593fc5761a027f610b3ad144c880a0a13ed6efa46e29f898968c70655866c28ffcc05e25aa745da3
7
- data.tar.gz: 3885362dd2ace22a885980667bcd8b67c276756fee2ea5a89afe845c99af6ef005de9834b1cb230e58eacb3b24229369e4c3768028600e6580093af60d7a0892
6
+ metadata.gz: fdc9c010737cf5f365dd13a97b8223cd924006eb2db76e75e9e37edef3479b7b1fe259cd749a61b77093a8e8a9afd632a3160d91bd2aea8bffd4269a9c25f832
7
+ data.tar.gz: '04788c9756b9662debe56856347fb2ea1c707f703c90925357c189bfcd47d44b76af68ca1a688450bd4aac91a9d02d45771753d837689bfc9f4cbee12e52b96c'
data/bin/gitloc CHANGED
@@ -1,20 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- require 'tmpdir'
3
- require 'open3'
4
-
5
- repo = ARGV.first
6
-
7
- Dir.mktmpdir { |dir|
8
- Dir.chdir dir
9
- out, err, status = Open3.capture3 'git', 'clone', repo, 'cloned'
10
- unless status.success?
11
- $stderr.puts out, err
12
- exit "Failed somehow >.<"
13
- end
14
- Dir.chdir 'cloned'
15
- files = Dir['**/*'].reject { |name| File.directory? name }
16
- files.each do |filename|
17
- loc = File.readlines(filename).count { |line| line !~ /^\s*$/ }
18
- puts "#{loc}\t#{filename}"
19
- end
20
- }
2
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
3
+ require 'gitloc_marissa'
4
+ GitlocMarissa.call(ARGV, $stdout, $stderr)
@@ -1,12 +1,15 @@
1
+ $LOAD_PATH.unshift File.expand_path('lib', __dir__)
2
+ require 'gitloc_marissa/version'
3
+
1
4
  Gem::Specification.new do |s|
2
5
  s.name = 'gitloc-marissa'
3
- s.version = '0.1.0'
6
+ s.version = GitlocMarissa::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, see https://github.com/JoshCheek/elective-building-a-gem -- gives lines-of-code information for a git repo."
7
10
  s.authors = ["Marissa Biesecker"]
8
11
  s.email = 'marissa.biesecker@gmail.com'
9
- s.files = Dir["**/*"].select { |f| File.file? f }
12
+ s.files = Dir["**/*"].select { |f| File.file? f } - Dir["*.gem"]
10
13
  s.homepage = 'https://github.com/JoshCheek/elective-building-a-gem'
11
14
  s.executables << 'gitloc'
12
15
  end
@@ -0,0 +1,24 @@
1
+ require 'tmpdir'
2
+ require 'open3'
3
+ require 'gitloc_marissa/version'
4
+
5
+ class GitlocMarissa
6
+ def self.call(argv, outstream, errstream)
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
+ 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 GitlocMarissa
2
+ VERSION = '0.1.1'
3
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitloc-marissa
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
  - Marissa Biesecker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-16 00:00:00.000000000 Z
11
+ date: 2020-11-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Example project for the Turing School of Software and Design, see https://github.com/JoshCheek/elective-building-a-gem
14
14
  -- gives lines-of-code information for a git repo.
@@ -21,6 +21,8 @@ files:
21
21
  - README.md
22
22
  - bin/gitloc
23
23
  - gitloc-marissa.gemspec
24
+ - lib/gitloc_marissa.rb
25
+ - lib/gitloc_marissa/version.rb
24
26
  - spec/acceptance_spec.rb
25
27
  - spec/fixtures/2loc
26
28
  homepage: https://github.com/JoshCheek/elective-building-a-gem