gitloc-chrisluhring 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d00563db3bb22e2c6b077cb839d34f61f3bd2e0b
4
+ data.tar.gz: 15a961ac15d82dfea00b68dfe22e2dfda8a82574
5
+ SHA512:
6
+ metadata.gz: 0696f276958d8c6cd3f4f16ce6d97b1cb4e51949fe4b2851daec8e49d52cb9f953c0cba8952e8d112d8bc5acf5d7bd2c6b95e30afa24607902118932bc21ed1b
7
+ data.tar.gz: 2c4efd1bce47c02fef2c758baf5855ac3baff4458944a98bcbf52adb6da956f29af728d1d600e524f35646b773773b4b7e8b5c70de21214d7e834ec7829e3d5b
data/Readme.md ADDED
@@ -0,0 +1,29 @@
1
+ Gitloc
2
+ ======
3
+
4
+ Takes a git url, prints out information about how many lines of code it has.
5
+
6
+ [MIT License](http://opensource.org/licenses/MIT)
7
+ -------------------------------------------------
8
+
9
+ The MIT License (MIT)
10
+
11
+ Copyright (c) 2015 Josh Cheek
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in
21
+ all copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29
+ THE SOFTWARE.
data/bin/gitloc ADDED
@@ -0,0 +1,21 @@
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
+ }
data/gitloc.gemspec ADDED
@@ -0,0 +1,12 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'gitloc-chrisluhring'
3
+ s.version = '0.1.0'
4
+ s.licenses = ['MIT']
5
+ s.summary = "Example project -- gives lines-of-code information for a git repo"
6
+ 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
+ s.authors = ["Chris Luhring"]
8
+ s.email = 'cluhring@gmail.com'
9
+ s.files = Dir["**/*"].select { |f| File.file? f }
10
+ s.homepage = 'https://github.com/cluhring/turing-elective-building-a-gem'
11
+ s.executables << 'gitloc'
12
+ end
data/logfile ADDED
@@ -0,0 +1,3 @@
1
+ LOG: database system was shut down at 2015-02-09 10:51:19 MST
2
+ LOG: database system is ready to accept connections
3
+ LOG: autovacuum launcher started
@@ -0,0 +1,14 @@
1
+ require 'open3' # we'll use this to invoke the binary
2
+
3
+ RSpec.describe 'gitloc binary' do
4
+ let(:binpath) { File.expand_path '../../bin/gitloc', __FILE__ }
5
+ let(:repopath) { File.expand_path '../..', __FILE__ }
6
+
7
+ it 'takes a git repository and tells me how many lines of code are in each file' do
8
+ stdout, stderr, exitstatus = Open3.capture3(binpath, repopath)
9
+ expect(stdout).to match /2.*?spec\/fixtures\/2loc/
10
+ expect(exitstatus).to be_success
11
+ end
12
+ end
13
+
14
+ #
@@ -0,0 +1,2 @@
1
+ 1
2
+ 2
metadata ADDED
@@ -0,0 +1,51 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gitloc-chrisluhring
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Chris Luhring
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-17 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Example project for the Turing School of Software and Design, see https://github.com/JoshCheek/elective-building-a-gem
14
+ -- gives lines-of-code information for a git repo.
15
+ email: cluhring@gmail.com
16
+ executables:
17
+ - gitloc
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - Readme.md
22
+ - bin/gitloc
23
+ - gitloc.gemspec
24
+ - logfile
25
+ - spec/acceptance_spec.rb
26
+ - spec/fixtures/2loc
27
+ homepage: https://github.com/cluhring/turing-elective-building-a-gem
28
+ licenses:
29
+ - MIT
30
+ metadata: {}
31
+ post_install_message:
32
+ rdoc_options: []
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ requirements: []
46
+ rubyforge_project:
47
+ rubygems_version: 2.2.2
48
+ signing_key:
49
+ specification_version: 4
50
+ summary: Example project -- gives lines-of-code information for a git repo
51
+ test_files: []