Class: Script::Prog
- Inherits:
-
Object
- Object
- Script::Prog
- Defined in:
- lib/script.rb,
lib/plugins/bash.rb
Overview
where procedure required
Instance Attribute Summary collapse
-
#injection ⇒ Object
readonly
Returns the value of attribute injection.
Instance Method Summary collapse
- #bash(injection = nil, &block) ⇒ Object
- #doit ⇒ Object
-
#echo(s) ⇒ Object
————————————————————— DSL.
-
#initialize(toplevel, injection = nil, &block) ⇒ Prog
constructor
A new instance of Prog.
- #run(tag) ⇒ Object
Constructor Details
#initialize(toplevel, injection = nil, &block) ⇒ Prog
Returns a new instance of Prog.
82 83 84 85 86 87 |
# File 'lib/script.rb', line 82 def initialize(toplevel, injection = nil, &block) @toplevel = toplevel @injection = injection @prog = [] instance_eval(&block) end |
Instance Attribute Details
#injection ⇒ Object (readonly)
Returns the value of attribute injection.
89 90 91 |
# File 'lib/script.rb', line 89 def injection @injection end |
Instance Method Details
#bash(injection = nil, &block) ⇒ Object
3 4 5 |
# File 'lib/plugins/bash.rb', line 3 def bash(injection = nil, &block) @prog.push Bash.new(@toplevel, injection, &block) end |
#doit ⇒ Object
91 92 93 94 95 |
# File 'lib/script.rb', line 91 def doit @prog.each do |p| p.doit end end |