Class: Perkins::Build::Shell::Group
- Includes:
- Dsl
- Defined in:
- lib/perkins/build/shell/node.rb
Instance Attribute Summary collapse
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(*args) {|_self| ... } ⇒ Group
constructor
A new instance of Group.
- #to_s ⇒ Object
Methods included from Dsl
#cd, #cmd, #echo, #elif, #else, #export, #file, #fold, #if, #newline, #raw, #script, #set
Methods inherited from Node
Constructor Details
#initialize(*args) {|_self| ... } ⇒ Group
Returns a new instance of Group.
55 56 57 58 59 60 61 |
# File 'lib/perkins/build/shell/node.rb', line 55 def initialize(*args, &block) @options = args.last.is_a?(Hash) ? args.pop : {} @level = .delete(:level) || 0 @nodes = [] args.map { |node| cmd(node, ) } yield(self) if block_given? end |
Instance Attribute Details
#nodes ⇒ Object (readonly)
Returns the value of attribute nodes.
53 54 55 |
# File 'lib/perkins/build/shell/node.rb', line 53 def nodes @nodes end |
Instance Method Details
#to_s ⇒ Object
63 64 65 |
# File 'lib/perkins/build/shell/node.rb', line 63 def to_s nodes.map(&:to_s).join("\n").indent(level) end |