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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f182acf2b123e68f0dd15eb13feab21812876e0
4
- data.tar.gz: 3f2616d2369e1826b746cb5c2af596ca66705264
3
+ metadata.gz: 9fdcf67caccc3a9ecca6d9fba1d69b705d9664d5
4
+ data.tar.gz: 4f821a86de9f581f4d67e3e0916a5c49803d4dc5
5
5
  SHA512:
6
- metadata.gz: 11510e81b64622e3fc2fb780c04a7c45558b7992bddf169a5ce9df54d0d7b6198a055cc128b132cc6dc182f0788cbf20ec60715ae42408220c97f0dc66633297
7
- data.tar.gz: 84e15fb623e400a96b1addeaede93798dd43694fc6b779621503b7dfbc281ecea0f45322b4cd4c1d7296654bdcd6c6c3891653519413bcffdb21a247340bdbae
6
+ metadata.gz: e493b881f85a2a73bca8f88cad6488e6e085f698e7895cb9e0ef8091c77e806aefbc56f5e3b9bda6bf705ee265882855079305022d92737185bd696981643573
7
+ data.tar.gz: 252c3851b0566d3ddddb44d669419b1c9dacda1aaeab085534abd00b861583af330e529fda933045e8b47b136ee40ef4de3d3f383286f0e0fce63d90cbaad40e
@@ -9,16 +9,15 @@ module GitAnalysis
9
9
  # count domain
10
10
  def self.count_domain()
11
11
  repo = load_repo()
12
- commits = repo.walk(repo.last_commit).to_a
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
- domain.each do |elem|
19
- count[elem] += 1
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
- puts Oj.dump(count, :mode => :compat)
19
+ sorted = count.sort_by{|a,b| -b }
20
+ puts Oj.dump(Hash[sorted], :mode => :compat)
22
21
  end
23
22
 
24
23
  # export
@@ -1,3 +1,3 @@
1
1
  module GitAnalysis
2
- VERSION = "0.0.1.1"
2
+ VERSION = "0.0.1.2"
3
3
  end
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.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-22 00:00:00.000000000 Z
11
+ date: 2014-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler