Class: Volley::Dsl::Action
- Inherits:
-
Object
- Object
- Volley::Dsl::Action
- Defined in:
- lib/volley/dsl/action.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#plan ⇒ Object
readonly
Returns the value of attribute plan.
Instance Method Summary collapse
- #call ⇒ Object
- #command(cmd) ⇒ Object
-
#initialize(name, options = {}, &block) ⇒ Action
constructor
A new instance of Action.
Constructor Details
#initialize(name, options = {}, &block) ⇒ Action
Returns a new instance of Action.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/volley/dsl/action.rb', line 10 def initialize(name, ={}, &block) @name = name.to_sym @stage = .delete(:stage) @plan = .delete(:plan) @block = block @options = { }.merge() raise "stage instance must be set" unless @stage raise "plan instance must be set" unless @plan end |
Instance Attribute Details
#plan ⇒ Object (readonly)
Returns the value of attribute plan.
5 6 7 |
# File 'lib/volley/dsl/action.rb', line 5 def plan @plan end |
Instance Method Details
#call ⇒ Object
21 22 23 24 25 |
# File 'lib/volley/dsl/action.rb', line 21 def call return if @plan.stopped? Volley::Log.debug "## #{project.name}:#{@plan.name}[#{@stage}]##@name" self.instance_eval &@block if @block end |
#command(cmd) ⇒ Object
27 28 29 |
# File 'lib/volley/dsl/action.rb', line 27 def command(cmd) plan.shellout(cmd) end |