git_fame 2.3.1 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f60cc8e1ebb619b563a10256cd86549fdd59a901
4
- data.tar.gz: 93a5887855e265c463bd3c8ab1a48c24a107cfa1
3
+ metadata.gz: 9d14b517588cbb66c5ee322ffc1a1ffc1a0da758
4
+ data.tar.gz: 319dedff1fd52b79a5d7efbcd875dfb81baf9fd4
5
5
  SHA512:
6
- metadata.gz: 20cbb0c37d9d3637c0b9c3e73241c4a10e73ffa877e76e97014e7ddcfab064d03c1f2932b3d1b6e441ce298bdb8b7d96dffb9530f570a1ac19c75f844cb63673
7
- data.tar.gz: 86e2e53e6f36480ec4bb3b9f99925a77429c4c9d5af99809558ff65b49fab52f82b523a7aea5219f7ae5e8f72ae4169d7f431f8e87c7887d52fb7ab56cea9569
6
+ metadata.gz: 872d9eaa67f0e3f7fc8fd6f61d387247a9e2dbc29a62d63e541d3a478b4f3d32a5fa9e4edf1047051b53a96def45c16f28516a8ca8b00c3d1d49d2c89947b9ad
7
+ data.tar.gz: ac02d50b811a68ff8d2f51c7ab7f413814371c92906fbe127e36537468946b2b0d8b5e7846d616c38a2dcf401d24d1a14eccc4d7176aa5bbdb4c58b1de5db453
data/README.md CHANGED
@@ -45,7 +45,7 @@ From a git repository run `git fame`.
45
45
  - `git fame --repository=/path/to/repo` Git repository to be used. Default is the current folder.
46
46
  - `git fame --branch=master` Branch to run on. Default is what `HEAD` points to.
47
47
  - `git fame --format=output` Output format. Default is `pretty`. Additional: `csv`.
48
- - `git fame --after=2010-01-01` Only use commmits after this date. Format: yyyy-mm-dd. Note that the given date is included.
48
+ - `git fame --after=2010-01-01` Only use commits after this date. Format: yyyy-mm-dd. Note that the given date is included.
49
49
  - `git fame --before=2016-02-01` Only use commits before this date. Format: yyyy-mm-dd. Note that the given date is included.
50
50
  - `git fame --verbose` Print shell commands used by `git-fame`.
51
51
  - `git fame --everything` Images and binaries are ignored by default. Include them as well.
@@ -133,4 +133,4 @@ Visit `spec/spec_helper.rb` to enable it again.
133
133
 
134
134
  ## License
135
135
 
136
- *GitFame* is released under the *MIT license*.
136
+ *GitFame* is released under the *MIT license*.
@@ -35,6 +35,9 @@ Generates data like:
35
35
  gem.add_development_dependency("rspec-collection_matchers", "~> 1.1.2")
36
36
  gem.add_development_dependency("rake", "~> 10.4.2")
37
37
  gem.add_development_dependency("coveralls", "~> 0.8.1")
38
+ gem.add_development_dependency("json", "~> 1.8.3")
39
+ gem.add_development_dependency("tins", "~> 1.6.0")
40
+ gem.add_development_dependency("term-ansicolor", "~> 1.3.2")
38
41
 
39
42
  gem.required_ruby_version = ">= 1.9.2"
40
43
  end
@@ -365,19 +365,24 @@ module GitFame
365
365
  end
366
366
 
367
367
  def author_by_email(email, name = nil)
368
- @authors[email.strip] ||= Author.new({ parent: self, name: name })
368
+ @authors[(email || "").strip] ||= Author.new({ parent: self, name: name })
369
369
  end
370
370
 
371
371
  # List all files in current git directory, excluding
372
372
  # extensions in @extensions defined by the user
373
373
  def current_files
374
374
  if commit_range.is_range?
375
- execute("git #{git_directory_params} -c diff.renames=0 -c diff.renameLimit=1000 diff -M -C -c --name-only --diff-filter=AM #{encoding_opt} #{default_params} #{commit_range.to_s}") do |result|
376
- filter_files(result)
375
+ execute("git #{git_directory_params} -c diff.renames=0 -c diff.renameLimit=1000 diff -M -C -c --name-only --ignore-submodules=all --diff-filter=AM #{encoding_opt} #{default_params} #{commit_range.to_s}") do |result|
376
+ filter_files(result.to_s.split(/\n/))
377
377
  end
378
378
  else
379
- execute("git #{git_directory_params} ls-tree --name-only -r #{commit_range.to_s}") do |result|
380
- filter_files(result)
379
+ execute("git #{git_directory_params} ls-tree -r #{commit_range.to_s}") do |result|
380
+ lines = result.to_s.split(/\n/).inject([]) do |lines, line|
381
+ # Ignore submodules
382
+ next lines if line.strip.match(/^160000/)
383
+ next [line.split(/\s+/).last] + lines
384
+ end
385
+ filter_files(lines)
381
386
  end
382
387
  end
383
388
  end
@@ -394,8 +399,7 @@ module GitFame
394
399
  "--encoding=UTF-8"
395
400
  end
396
401
 
397
- def filter_files(result)
398
- raw_files = result.to_s.split("\n")
402
+ def filter_files(raw_files)
399
403
  files = remove_excluded_files(raw_files)
400
404
  files = keep_included_files(files)
401
405
  files = files.map { |file| GitFame::FileUnit.new(file) }
@@ -1,3 +1,3 @@
1
1
  module GitFame
2
- VERSION = "2.3.1"
2
+ VERSION = "2.4.0"
3
3
  end
@@ -22,7 +22,7 @@ describe GitFame::Base do
22
22
  end
23
23
 
24
24
  it "should have a number of locs" do
25
- author.raw(:loc).should eq(579)
25
+ author.raw(:loc).should eq(575)
26
26
  end
27
27
 
28
28
  it "should have a number of files" do
@@ -30,7 +30,7 @@ describe GitFame::Base do
30
30
  end
31
31
 
32
32
  it "should have a distribution" do
33
- author.distribution.should eq("53.9 / 58.6 / 25.0")
33
+ author.distribution.should eq("53.7 / 58.6 / 25.0")
34
34
  end
35
35
  end
36
36
 
@@ -61,7 +61,7 @@ describe GitFame::Base do
61
61
  it "should respond to #loc, #commits and #files" do
62
62
  subject.files.should eq(16)
63
63
  subject.commits.should eq(70)
64
- subject.loc.should eq(1075)
64
+ subject.loc.should eq(1071)
65
65
  end
66
66
  end
67
67
 
@@ -204,8 +204,8 @@ describe GitFame::Base do
204
204
  it "should be equal to" do
205
205
  subject.to_csv.should eq([
206
206
  "name,loc,commits,files,distribution\n",
207
- "Magnus Holm,579,41,4,53.9 / 58.6 / 25.0\n",
208
- "7rans,360,6,10,33.5 / 8.6 / 62.5\n",
207
+ "Magnus Holm,575,41,4,53.7 / 58.6 / 25.0\n",
208
+ "7rans,360,6,10,33.6 / 8.6 / 62.5\n",
209
209
  "Linus Oleander,136,23,7,12.7 / 32.9 / 43.8\n",
210
210
  ].join)
211
211
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_fame
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Linus Oleander
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-10 00:00:00.000000000 Z
11
+ date: 2016-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-progressbar
@@ -150,6 +150,48 @@ dependencies:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: 0.8.1
153
+ - !ruby/object:Gem::Dependency
154
+ name: json
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: 1.8.3
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: 1.8.3
167
+ - !ruby/object:Gem::Dependency
168
+ name: tins
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: 1.6.0
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: 1.6.0
181
+ - !ruby/object:Gem::Dependency
182
+ name: term-ansicolor
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: 1.3.2
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: 1.3.2
153
195
  description: Generates awesome stats from git-blame
154
196
  email:
155
197
  - linus@oleander.nu
@@ -202,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
244
  version: '0'
203
245
  requirements: []
204
246
  rubyforge_project:
205
- rubygems_version: 2.4.8
247
+ rubygems_version: 2.5.1
206
248
  signing_key:
207
249
  specification_version: 4
208
250
  summary: 'Generates awesome stats from git-blame A Ruby wrapper for git-blame. Generates