Class: Perkins::Build::Shell::Conditional
- Defined in:
- lib/perkins/build/shell/node.rb
Instance Attribute Summary
Attributes inherited from Block
Attributes inherited from Group
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(condition, *args, &block) ⇒ Conditional
constructor
A new instance of Conditional.
Methods inherited from Block
Methods inherited from Group
Methods included from Dsl
#cd, #cmd, #echo, #elif, #else, #export, #file, #fold, #if, #newline, #raw, #script, #set
Methods inherited from Node
Constructor Details
#initialize(condition, *args, &block) ⇒ Conditional
Returns a new instance of Conditional.
95 96 97 98 99 100 101 102 |
# File 'lib/perkins/build/shell/node.rb', line 95 def initialize(condition, *args, &block) args.unshift(args.last.delete(:then)) if args.last.is_a?(Hash) && args.last[:then] unless args.last.delete(:raw_condition) condition = "[[ #{condition} ]]" end super(*args, &block) @open = Node.new("#{name} #{condition}; then", ) end |