gitalytics 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/gitalytics +1 -2
  2. data/lib/gitalytics.rb +10 -8
  3. metadata +39 -20
data/bin/gitalytics CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
-
3
- require 'gitalytics'
2
+ require File.expand_path("../../lib/gitalytics.rb", __FILE__)
4
3
 
5
4
  Dir.chdir($1 || '.')
6
5
  g = Gitalytics.new
data/lib/gitalytics.rb CHANGED
@@ -1,18 +1,20 @@
1
+ require 'date'
2
+
1
3
  class Gitalytics
2
4
  def log_to_hash
3
- docs = []
4
- cmd = "git log --pretty='%cn|%cd|%s'"
5
- res = `#{cmd}`
5
+ lines = []
6
+ command = "git log --pretty='%cn|%cd|%s'"
7
+ result = `#{command}`
6
8
 
7
- res.each_line do |line|
9
+ result.each_line do |line|
8
10
  parts = line.split('|')
9
- docs << {:username => parts[0], :date => Date.parse(parts[1]), :subject => parts[2]}
11
+ lines << {:username => parts[0], :date => Date.parse(parts[1]), :subject => parts[2]}
10
12
  end
11
13
 
12
14
  return {
13
- :users => docs.map{|r| r[:username]}.uniq,
14
- :dates => docs.map{|r| r[:date]}.uniq,
15
- :records => docs
15
+ :users => lines.map{|r| r[:username]}.uniq,
16
+ :dates => lines.map{|r| r[:date]}.uniq,
17
+ :records => lines
16
18
  }
17
19
  end
18
20
 
metadata CHANGED
@@ -1,47 +1,66 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: gitalytics
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.1
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 2
10
+ version: 0.0.2
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Gonzalo Robaina
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-12-04 00:00:00.000000000 Z
17
+
18
+ date: 2013-12-27 00:00:00 Z
13
19
  dependencies: []
20
+
14
21
  description: Get usefull analytics from your git log
15
22
  email: gonzalor@gmail.com
16
- executables:
23
+ executables:
17
24
  - gitalytics
18
25
  extensions: []
26
+
19
27
  extra_rdoc_files: []
20
- files:
28
+
29
+ files:
21
30
  - lib/gitalytics.rb
22
31
  - bin/gitalytics
23
32
  homepage: http://rubygems.org/gems/gitalytics
24
- licenses: []
33
+ licenses:
34
+ - MIT
25
35
  post_install_message:
26
36
  rdoc_options: []
27
- require_paths:
37
+
38
+ require_paths:
28
39
  - lib
29
- required_ruby_version: !ruby/object:Gem::Requirement
40
+ required_ruby_version: !ruby/object:Gem::Requirement
30
41
  none: false
31
- requirements:
32
- - - ! '>='
33
- - !ruby/object:Gem::Version
34
- version: '0'
35
- required_rubygems_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 3
46
+ segments:
47
+ - 0
48
+ version: "0"
49
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
50
  none: false
37
- requirements:
38
- - - ! '>='
39
- - !ruby/object:Gem::Version
40
- version: '0'
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ hash: 3
55
+ segments:
56
+ - 0
57
+ version: "0"
41
58
  requirements: []
59
+
42
60
  rubyforge_project:
43
- rubygems_version: 1.8.25
61
+ rubygems_version: 1.8.24
44
62
  signing_key:
45
63
  specification_version: 3
46
64
  summary: Git Analytics
47
65
  test_files: []
66
+