Class: DeployLog::Github::Deploys
- Inherits:
-
Object
- Object
- DeployLog::Github::Deploys
- Defined in:
- lib/deploy_log/github/deploys.rb
Instance Attribute Summary collapse
-
#force ⇒ Object
Returns the value of attribute force.
Instance Method Summary collapse
-
#initialize ⇒ Deploys
constructor
A new instance of Deploys.
- #merged_between(start, finish = nil) ⇒ Object
- #merged_during_week(week_num) ⇒ Object
- #merged_on(start) ⇒ Object
- #merged_today ⇒ Object
- #pr_for_branch(branch) ⇒ Object
- #pr_title(title) ⇒ Object
Constructor Details
Instance Attribute Details
#force ⇒ Object
Returns the value of attribute force.
6 7 8 |
# File 'lib/deploy_log/github/deploys.rb', line 6 def force @force end |
Instance Method Details
#merged_between(start, finish = nil) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/deploy_log/github/deploys.rb', line 13 def merged_between(start, finish = nil) return Notify.error 'Start (--start=) is a required argument' if start.nil? finish = Date.today.to_time + (24 * 60 * 60) - 1 if finish.nil? @github.pulls_in_timeframe(start, finish) end |
#merged_during_week(week_num) ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/deploy_log/github/deploys.rb', line 36 def merged_during_week(week_num) return Notify.error 'Week number (--week|-w) is a required argument' if week_num.nil? week = @calendar.week(week_num.to_i) @github.pulls_in_timeframe(week[:first], week[:last]) end |
#merged_on(start) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/deploy_log/github/deploys.rb', line 28 def merged_on(start) return Notify.error 'Start (--start=) is a required argument' if start.nil? finish = start + 24 * 60 * 60 - 1 @github.pulls_in_timeframe(start, finish) end |
#merged_today ⇒ Object
21 22 23 24 25 26 |
# File 'lib/deploy_log/github/deploys.rb', line 21 def merged_today start = Date.today.to_time # 12:00AM this morning finish = Date.today.to_time + (24 * 60 * 60) - 1 # 11:59PM tonight @github.pulls_in_timeframe(start, finish) end |
#pr_for_branch(branch) ⇒ Object
48 49 50 |
# File 'lib/deploy_log/github/deploys.rb', line 48 def pr_for_branch(branch) @github.search_pulls_by(branch, :ref) end |
#pr_title(title) ⇒ Object
44 45 46 |
# File 'lib/deploy_log/github/deploys.rb', line 44 def pr_title(title) @github.search_pulls_by(title, :title) end |