git-commits-analyzer 1.2.0 → 1.3.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 +4 -4
- data/lib/git-commits-analyzer.rb +7 -1
- data/lib/git-commits-analyzer/utils.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88a7e29eb44ad2604d0b5897f72ba276ed999ad2
|
4
|
+
data.tar.gz: b8cfbf18fa9ce32a9804c6dbf9b9b91f57522341
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff98e4c1fb1cfd7c612d139489ff714fd6973b03eea84648951b30ccd218f8e890a0ff0964096009c449b060c9eac547a650d26ff23a74072dd29274b1b241d4
|
7
|
+
data.tar.gz: d7a051b7fe7fa9fd1a381a932c429b8462d941b5fd666e61f4826b6858a2bfd845a83370b47e47a7526558c97d9b1b5d2b892de496aef40a7e2dea4ba7a754f9
|
data/lib/git-commits-analyzer.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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.
|
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-
|
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
|