git-commits-analyzer 1.1.0 → 1.2.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: b3d25118787113278e054fb55fde763528447016
4
- data.tar.gz: c318ffc90587c4409fbbc0adcf04877dda5beabf
3
+ metadata.gz: fba38fa80ebdeaa32450ec16361129f8bf62aca2
4
+ data.tar.gz: d8f3f72235347742216c3f92536e38d2774962ca
5
5
  SHA512:
6
- metadata.gz: 547d7c8c36f0a7edc6ce5cd9acd85616e5024b51626506302294ee4d3c53e68aa9cad248fd2cdbe37854484d1e52c5409ed731bf7aaa2e690c9c2b3cc4a9b472
7
- data.tar.gz: 1ed0646e196acf3bf0a52e21ab2cc947b79f4fd0e9e90fa3e9b52ea029e1e474563a37cf1de1167c94b7092ea8daf1d581d0ba5e2f1f6008df61a446b0340e9b
6
+ metadata.gz: 478d2f2b5c6950f6d40fd14f98644bee2b58fae0226c9aa680d4b1fc01e0aeee887cfb58c5baf4565d0393bafaf9cf426d7878616896ad8038cb1b231ab38152
7
+ data.tar.gz: 66860613cc68cd3dbdb7a557419f6fd0792a10aa0510aef717c08009fdc064d4198e9c31c6b9e3d9919b57dd6370aec2a78e59ae1d1cd51bdf88bfbdb4746ff7
@@ -0,0 +1,26 @@
1
+ # The git gem doesn't currently support commits adding submodules when running
2
+ # "git ls-tree". I have opened https://github.com/schacon/ruby-git/pull/284 to
3
+ # fix it, but in the meantime, this monkey patch allows analyzing repositories
4
+ # with submodules.
5
+
6
+ module Git
7
+
8
+ class Lib
9
+
10
+ def ls_tree(sha)
11
+ # Add 'commit' to the list of valid types.
12
+ #data = {'blob' => {}, 'tree' => {}}
13
+ data = {'blob' => {}, 'tree' => {}, 'commit' => {}}
14
+
15
+ command_lines('ls-tree', sha).each do |line|
16
+ (info, filenm) = line.split("\t")
17
+ (mode, type, sha) = info.split
18
+ data[type][filenm] = {:mode => mode, :sha => sha}
19
+ end
20
+
21
+ data
22
+ end
23
+
24
+ end
25
+
26
+ end
@@ -3,6 +3,10 @@ require 'git'
3
3
  require 'git_diff_parser'
4
4
  require 'json'
5
5
 
6
+ # Monkey patch for the git gem.
7
+ # See https://github.com/schacon/ruby-git/pull/284 for more details.
8
+ require 'git-commits-analyzer/monkey-patch-git'
9
+
6
10
  # Public: parse git logs for language and commit metadata.
7
11
  #
8
12
  # Examples:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-commits-analyzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Aubert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-16 00:00:00.000000000 Z
11
+ date: 2016-04-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Parse git repos and collect commit statistics/data for a given author.
14
14
  email: aubertg@cpan.org
@@ -19,6 +19,7 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - bin/analyze_commits
21
21
  - lib/git-commits-analyzer.rb
22
+ - lib/git-commits-analyzer/monkey-patch-git.rb
22
23
  - lib/git-commits-analyzer/utils.rb
23
24
  homepage: http://rubygems.org/gems/
24
25
  licenses: