gitstatsakido 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/gitstats +55 -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: 97a86948f12fdfe3a9f27b3443cca2056b3aa27a
|
4
|
+
data.tar.gz: 01d651971a219f482c62ea865cd46f98dd3e718f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1412a20701cb472fdf454847df319cfe6d511c7188ef06ab40106682d47acb9b040968452ea9ca288fccfcb0c80c9f2c1aa72c93c092b66ac7981660933810f5
|
7
|
+
data.tar.gz: c0d46207ceffb5c3cb657c8c3b5c8a0c0ae106aa86cbc833d1c4358c30fb1b8e1a29a119687bccadb02a125c23f4f07bbc9906bb834c808dbdcca00075cbbe79
|
data/bin/gitstats
CHANGED
@@ -1,8 +1,61 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'gitstats'
|
4
|
+
require 'optparse'
|
5
|
+
require 'yaml'
|
6
|
+
|
7
|
+
options = {}
|
8
|
+
OptionParser.new do |opts|
|
9
|
+
opts.banner = 'Usage: gitstats [-c #] [-d #] [-e (#|Date)] [-s (#|Date)]'
|
10
|
+
|
11
|
+
opts.on("-c", "--commits COMMITS", "list # of commits for each author in descending order") do |c|
|
12
|
+
options[:commits] = c.to_i
|
13
|
+
end
|
14
|
+
|
15
|
+
opts.on("-d", "--days DAYS", "days of commits to evaluate") do |d|
|
16
|
+
options[:days] = d.to_f
|
17
|
+
end
|
18
|
+
|
19
|
+
opts.on("-s", '--startDate DATE_OR_DAYS", "include commits starting on (2016-1-31|-#) date or days previous') do |s|
|
20
|
+
if s[0] == '-'
|
21
|
+
options[:start] = DateTime.now + s.to_i
|
22
|
+
else
|
23
|
+
options[:start] = DateTime.parse(s)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
opts.on("-e", '--endDate DATE_OR_DAYS", "include commits ending on (2016-2-28|-#) date or days previous') do |e|
|
28
|
+
if e[0] == '-'
|
29
|
+
options[:end] = DateTime.now + e.to_i
|
30
|
+
else
|
31
|
+
options[:end] = DateTime.parse(e)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end.parse!
|
36
|
+
|
37
|
+
|
38
|
+
if options.key?(:days) && options.key?(:start) && options.key?(:end)
|
39
|
+
puts "Please specify only up to 2 of start, end, and days"
|
40
|
+
raise Exception
|
41
|
+
end
|
42
|
+
|
43
|
+
if !options.key(:start)
|
44
|
+
if options.key?(:end) && options.key?(:days)
|
45
|
+
options[:start] = options[:end] - options[:days]
|
46
|
+
elsif options.key?(:days)
|
47
|
+
options[:start] = DateTime.now - options[:days]
|
48
|
+
end
|
49
|
+
end
|
50
|
+
if !options.key?(:end)
|
51
|
+
if options.key?(:start) && options.key?(:days)
|
52
|
+
options[:end] = options[:start] + options[:days]
|
53
|
+
end
|
54
|
+
end
|
4
55
|
|
5
56
|
runme = Gitstats::Stats.new
|
6
57
|
|
7
|
-
runme.print_info
|
8
|
-
|
58
|
+
runme.print_info(options[:start], options[:end])
|
59
|
+
if options.key?(:commits)
|
60
|
+
runme.print_commits(options[:commits])
|
61
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitstatsakido
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lei Wang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|