git_analysis 0.0.1.1 → 0.0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/git_analysis.rb +7 -8
- data/lib/git_analysis/version.rb +1 -1
- 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: 9fdcf67caccc3a9ecca6d9fba1d69b705d9664d5
|
4
|
+
data.tar.gz: 4f821a86de9f581f4d67e3e0916a5c49803d4dc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e493b881f85a2a73bca8f88cad6488e6e085f698e7895cb9e0ef8091c77e806aefbc56f5e3b9bda6bf705ee265882855079305022d92737185bd696981643573
|
7
|
+
data.tar.gz: 252c3851b0566d3ddddb44d669419b1c9dacda1aaeab085534abd00b861583af330e529fda933045e8b47b136ee40ef4de3d3f383286f0e0fce63d90cbaad40e
|
data/lib/git_analysis.rb
CHANGED
@@ -9,16 +9,15 @@ module GitAnalysis
|
|
9
9
|
# count domain
|
10
10
|
def self.count_domain()
|
11
11
|
repo = load_repo()
|
12
|
-
|
13
|
-
domain = Array.new
|
14
|
-
commits.each do |c|
|
15
|
-
domain << c.author[:email].match(/([a-zA-Z0-9\_\-\.]+$)/).to_s.rstrip
|
16
|
-
end
|
12
|
+
#domain = Array.new
|
17
13
|
count = Hash.new(0)
|
18
|
-
|
19
|
-
|
14
|
+
repo.walk(repo.last_commit).each do |commit|
|
15
|
+
# TODO more Faster
|
16
|
+
domain = commit.author[:email].gsub(/\A[a-zA-Z0-9\_\-\. ]+@/,"").rstrip
|
17
|
+
count[:"#{domain}"] += 1
|
20
18
|
end
|
21
|
-
|
19
|
+
sorted = count.sort_by{|a,b| -b }
|
20
|
+
puts Oj.dump(Hash[sorted], :mode => :compat)
|
22
21
|
end
|
23
22
|
|
24
23
|
# export
|
data/lib/git_analysis/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_analysis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- volanja
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|