git-commits-analyzer 1.2.0 → 1.3.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: fba38fa80ebdeaa32450ec16361129f8bf62aca2
4
- data.tar.gz: d8f3f72235347742216c3f92536e38d2774962ca
3
+ metadata.gz: 88a7e29eb44ad2604d0b5897f72ba276ed999ad2
4
+ data.tar.gz: b8cfbf18fa9ce32a9804c6dbf9b9b91f57522341
5
5
  SHA512:
6
- metadata.gz: 478d2f2b5c6950f6d40fd14f98644bee2b58fae0226c9aa680d4b1fc01e0aeee887cfb58c5baf4565d0393bafaf9cf426d7878616896ad8038cb1b231ab38152
7
- data.tar.gz: 66860613cc68cd3dbdb7a557419f6fd0792a10aa0510aef717c08009fdc064d4198e9c31c6b9e3d9919b57dd6370aec2a78e59ae1d1cd51bdf88bfbdb4746ff7
6
+ metadata.gz: ff98e4c1fb1cfd7c612d139489ff714fd6973b03eea84648951b30ccd218f8e890a0ff0964096009c449b060c9eac547a650d26ff23a74072dd29274b1b241d4
7
+ data.tar.gz: d7a051b7fe7fa9fd1a381a932c429b8462d941b5fd666e61f4826b6858a2bfd845a83370b47e47a7526558c97d9b1b5d2b892de496aef40a7e2dea4ba7a754f9
@@ -104,6 +104,8 @@ class GitCommitsAnalyzer
104
104
 
105
105
  # First try to match on known extensions.
106
106
  case filename
107
+ when /\.go$/i
108
+ return 'Go'
107
109
  when /\.(pl|pm|t|cgi|pod|run)$/i
108
110
  return 'Perl'
109
111
  when /\.(?:rb|gemspec)$/
@@ -179,7 +181,11 @@ class GitCommitsAnalyzer
179
181
  # variables collecting commit metadata.
180
182
  #
181
183
  def parse_repo(repo:)
182
- git_repo = Git.open(repo, log: @logger)
184
+ # Support both standard and bare/mirror git repositories.
185
+ git_repo = if File.directory?(File.join(repo, '.git'))
186
+ then Git.open(repo, log: @logger)
187
+ else Git.bare(repo, log: @logger)
188
+ end
183
189
 
184
190
  # Note: override the default of 30 for count(), nil gives the whole git log
185
191
  # history.
@@ -51,8 +51,10 @@ class Utils
51
51
  # Skip files.
52
52
  next if !File.directory?(dir)
53
53
 
54
- # Skip directories without .git subdirectory (shortcut to identify repos).
55
- next if !File.directory?(File.join(dir, '.git'))
54
+ # Skip directories without .git subdirectory (shortcut to identify repos
55
+ # with a working dir) or without a HEAD file (shortcut to identify bare
56
+ # git repositories).
57
+ next if !File.directory?(File.join(dir, '.git')) && !File.file?(File.join(dir, 'HEAD'))
56
58
 
57
59
  repos << dir
58
60
  end
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.2.0
4
+ version: 1.3.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-17 00:00:00.000000000 Z
11
+ date: 2016-05-07 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