deploy_log 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a41d5f5eec9fe419b26fb29d1b274bd8b4fb18e896258a2b61b193d8e7f9cb0
4
- data.tar.gz: 063f3f25f4b06e99dc1c2158ee34b6e839a7d79884f9ef7ea7e7713b9638c277
3
+ metadata.gz: 0e585112a775c9f18607094ac7ed78917c81a3758dd27cbf0d96b5abd8926542
4
+ data.tar.gz: ea21d8d6e2a46b54706d3794bdaabcef31cba551a37e64f3892586f96b325b25
5
5
  SHA512:
6
- metadata.gz: 70506d200f36f6c8d1edfdc5cde156a74d957103f38db0c17fb24fe909658cdbba42a6246f51fcc2efd412afc7df386bdf59224c0065f5be6332faaf13183827
7
- data.tar.gz: 54959d81e9786443f1d8ce20089f2fc8d66f8fac709e362244c1365ca5e67ce0c170c2fa50e72278e26be48bdd474029ed4470b0d37b08d719ddfed61fd61da4
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
- start, finish, title, branch, on, week = nil
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 |br|
30
- branch = br
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=WEEK', 'Get PRs merged during week number X') do |w|
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeployLog
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
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.0
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-14 00:00:00.000000000 Z
11
+ date: 2019-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler