Class: Jisota::ScriptBlock
- Inherits:
-
Object
- Object
- Jisota::ScriptBlock
- Defined in:
- lib/jisota/script_block.rb
Overview
DSL for creating a CompositeScript
Methods in the DSL:
- cmd
-
Add a CommandScript
- upload
-
Add a FileScript
- <arg name>
-
The value of the argument
- <package name>
-
Add a PackageScript
Defined Under Namespace
Classes: DSL
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
Instance Method Summary collapse
- #evaluate(context = ScriptContext.new) ⇒ Object
-
#initialize(options = {}, &block) ⇒ ScriptBlock
constructor
A new instance of ScriptBlock.
Constructor Details
#initialize(options = {}, &block) ⇒ ScriptBlock
Returns a new instance of ScriptBlock.
14 15 16 |
# File 'lib/jisota/script_block.rb', line 14 def initialize( = {}, &block) @block = block end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
12 13 14 |
# File 'lib/jisota/script_block.rb', line 12 def block @block end |
Instance Method Details
#evaluate(context = ScriptContext.new) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/jisota/script_block.rb', line 18 def evaluate(context = ScriptContext.new) CompositeScript.new.tap do |script| dsl = DSL.new(script, context) dsl.evaluate(&block) end end |