Class: Ora::Cli::Task
- Inherits:
-
Object
- Object
- Ora::Cli::Task
- Defined in:
- lib/ora/cli/task.rb
Direct Known Subclasses
NewFeatureBranch, PushFeatureBranch, PushToMaster, PushToStaging, PushToUat, SwitchBranch
Constant Summary collapse
- MAIN_BRANCHES =
%w{master develop staging uat}
Instance Attribute Summary collapse
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#print ⇒ Object
readonly
Returns the value of attribute print.
-
#stdin ⇒ Object
readonly
Returns the value of attribute stdin.
Instance Method Summary collapse
- #commands ⇒ Object
-
#initialize(from, inputs: [], print: Print.new) ⇒ Task
constructor
A new instance of Task.
- #run ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(from, inputs: [], print: Print.new) ⇒ Task
Returns a new instance of Task.
11 12 13 14 15 16 17 |
# File 'lib/ora/cli/task.rb', line 11 def initialize(from, inputs: [], print: Print.new) @from = from @bash = Bash.new(self, from: @from, print: print) @branch = current_branch @stdin = Stdin.new(bash: @bash, print: print, inputs: inputs) @print = print end |
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
7 8 9 |
# File 'lib/ora/cli/task.rb', line 7 def branch @branch end |
#print ⇒ Object (readonly)
Returns the value of attribute print.
7 8 9 |
# File 'lib/ora/cli/task.rb', line 7 def print @print end |
#stdin ⇒ Object (readonly)
Returns the value of attribute stdin.
7 8 9 |
# File 'lib/ora/cli/task.rb', line 7 def stdin @stdin end |
Instance Method Details
#commands ⇒ Object
23 24 25 |
# File 'lib/ora/cli/task.rb', line 23 def commands raise "Override this method in subclass" end |
#run ⇒ Object
19 20 21 |
# File 'lib/ora/cli/task.rb', line 19 def run @bash.run commands end |
#success? ⇒ Boolean
27 28 29 |
# File 'lib/ora/cli/task.rb', line 27 def success? @bash.success? end |