Class: Volley::Dsl::VolleyAction
- Defined in:
- lib/volley/dsl/volley_action.rb
Instance Attribute Summary
Attributes inherited from Action
Instance Method Summary collapse
-
#initialize(name, options = {}, &block) ⇒ VolleyAction
constructor
A new instance of VolleyAction.
Methods inherited from Action
Constructor Details
#initialize(name, options = {}, &block) ⇒ VolleyAction
Returns a new instance of VolleyAction.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/volley/dsl/volley_action.rb', line 6 def initialize(name, ={}, &block) @name = name.to_sym @stage = .delete(:stage) @plan = .delete(:plan) @run = .delete(:run) @desc = .delete(:descriptor) @desc ||= @plan.args.descriptor @args = .delete(:args) @options = { }.merge() raise "stage instance must be set" unless @stage raise "plan instance must be set" unless @plan @block = Proc.new do desc = @desc || @plan.args.descriptor plan = @run (runpr, plan) = plan.split(/\:/) if @run =~ /\:/ (project, branch, version) = desc.get Volley.process("#{runpr}:#{plan}", "#{project}@#{branch}:#{version}", args.marshal_dump) end end |