deploy_log 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/deploy_log +23 -16
- data/lib/deploy_log/github/deploys.rb +1 -3
- data/lib/deploy_log/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e585112a775c9f18607094ac7ed78917c81a3758dd27cbf0d96b5abd8926542
|
4
|
+
data.tar.gz: ea21d8d6e2a46b54706d3794bdaabcef31cba551a37e64f3892586f96b325b25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fce3c2cd292f21f6efecb71551f1309aedb3565e3e8a58ac512d81f13f91a3418ad3a9098269f3044206dfe0a2d45515cdeb886d9bf3cdc7d38ea12913eaf36
|
7
|
+
data.tar.gz: 6d8dd938bea7333089bbee1d9c7b6e8937f14e0dee64b1b79d518fa6e686ead252f5d9271b15dc97c2e2bf5ec9134a7664f69be9c983c096f600acb20a969b51
|
data/bin/deploy_log
CHANGED
@@ -3,35 +3,42 @@
|
|
3
3
|
|
4
4
|
require 'deploy_log'
|
5
5
|
|
6
|
-
|
6
|
+
options = {}
|
7
|
+
options[:start] = nil
|
8
|
+
options[:finish] = nil
|
9
|
+
options[:title] = nil
|
10
|
+
options[:branch] = nil
|
11
|
+
options[:on] = nil
|
12
|
+
options[:week] = Date.today.cweek
|
13
|
+
puts options.inspect
|
7
14
|
|
8
15
|
OptionParser.new do |opt|
|
9
16
|
opt.on('-s', '--start=START', 'Start of date range') do |time|
|
10
|
-
start = Time.parse(time)
|
17
|
+
options[:start] = Time.parse(time)
|
11
18
|
end
|
12
19
|
|
13
20
|
opt.on('-e', '--end=END', 'End of date range') do |time|
|
14
|
-
finish = Time.parse(time)
|
21
|
+
options[:finish] = Time.parse(time)
|
15
22
|
end
|
16
23
|
|
17
24
|
opt.on('-o', '--on=ON', 'Merged on a specific date') do |time|
|
18
|
-
on = Time.parse(time)
|
25
|
+
options[:on] = Time.parse(time)
|
19
26
|
end
|
20
27
|
|
21
28
|
opt.on('-t', '--title=TITLE', 'Title of the PR you want') do |ti|
|
22
|
-
title = ti
|
29
|
+
options[:title] = ti
|
23
30
|
end
|
24
31
|
|
25
32
|
opt.on('-b', '--branch=BRANCH', 'Name of the branch you want') do |br|
|
26
|
-
branch = br
|
33
|
+
options[:branch] = br
|
27
34
|
end
|
28
35
|
|
29
|
-
opt.on('-u', '--user=USER', 'Name of the Github user you want to search by') do |
|
30
|
-
|
36
|
+
opt.on('-u', '--user=USER', 'Name of the Github user you want to search by') do |u|
|
37
|
+
options[:user] = u
|
31
38
|
end
|
32
39
|
|
33
|
-
opt.on('-w', '--week
|
34
|
-
week = w
|
40
|
+
opt.on('-w', '--week', 'Get PRs merged during week number X') do |w|
|
41
|
+
options[:week] = w
|
35
42
|
end
|
36
43
|
|
37
44
|
opt.on('-c', '--clean', 'Pull data from api, ignore cache') do
|
@@ -48,9 +55,9 @@ end.parse!
|
|
48
55
|
|
49
56
|
model = DeployLog::Github::Deploys.new
|
50
57
|
|
51
|
-
return model.merged_during_week(week) if week
|
52
|
-
return model.merged_between(start, finish) if start
|
53
|
-
return model.merged_on(on) if on
|
54
|
-
return model.pr_title(title) if title
|
55
|
-
return model.pr_for_branch(branch) if branch
|
56
|
-
return model.merged_today if title.nil? && branch.nil? && start.nil? && finish.nil? && on.nil?
|
58
|
+
return model.merged_during_week(options[:week]) if options[:week]
|
59
|
+
return model.merged_between(options[:start], options[:finish]) if options[:start]
|
60
|
+
return model.merged_on(options[:on]) if options[:on]
|
61
|
+
return model.pr_title(options[:title]) if options[:title]
|
62
|
+
return model.pr_for_branch(options[:branch]) if options[:branch]
|
63
|
+
return model.merged_today if options[:title].nil? && options[:branch].nil? && options[:start].nil? && options[:finish].nil? && options[:on].nil?
|
@@ -30,9 +30,7 @@ module DeployLog
|
|
30
30
|
render @github.pulls_in_timeframe(start, finish)
|
31
31
|
end
|
32
32
|
|
33
|
-
def merged_during_week(week_num)
|
34
|
-
return Notify.error 'Week number (--week|-w) is a required argument' if week_num.nil?
|
35
|
-
|
33
|
+
def merged_during_week(week_num = nil)
|
36
34
|
calendar = DeployLog::Calendar.new
|
37
35
|
week = calendar.week(week_num.to_i)
|
38
36
|
|
data/lib/deploy_log/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deploy_log
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Priebe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|