Class: Octopolo::Scripts::StageUp
- Inherits:
-
Object
- Object
- Octopolo::Scripts::StageUp
- Includes:
- CLIWrapper
- Defined in:
- lib/octopolo/scripts/stage_up.rb
Instance Attribute Summary collapse
-
#pull_request_id ⇒ Object
Returns the value of attribute pull_request_id.
Attributes included from CLIWrapper
Class Method Summary collapse
Instance Method Summary collapse
-
#execute ⇒ Object
Public: Perform the script.
-
#initialize(pull_request_id = nil) ⇒ StageUp
constructor
A new instance of StageUp.
Constructor Details
#initialize(pull_request_id = nil) ⇒ StageUp
Returns a new instance of StageUp.
15 16 17 |
# File 'lib/octopolo/scripts/stage_up.rb', line 15 def initialize(pull_request_id=nil) @pull_request_id = pull_request_id end |
Instance Attribute Details
#pull_request_id ⇒ Object
Returns the value of attribute pull_request_id.
9 10 11 |
# File 'lib/octopolo/scripts/stage_up.rb', line 9 def pull_request_id @pull_request_id end |
Class Method Details
.execute(pull_request_id = nil) ⇒ Object
11 12 13 |
# File 'lib/octopolo/scripts/stage_up.rb', line 11 def self.execute(pull_request_id=nil) new(pull_request_id).execute end |
Instance Method Details
#execute ⇒ Object
Public: Perform the script
20 21 22 23 24 25 26 27 |
# File 'lib/octopolo/scripts/stage_up.rb', line 20 def execute if (!self.pull_request_id) current = GitHub::PullRequest.current self.pull_request_id = current.number if current end self.pull_request_id ||= cli.prompt("Pull Request ID: ") PullRequestMerger.perform Git::STAGING_PREFIX, Integer(pull_request_id) end |