Class: Prick::Build::ExeNode

Inherits:
Node
  • Object
show all
Defined in:
lib/builder/node.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#args, #kind, #parent, #path, #phase, #source

Instance Method Summary collapse

Methods inherited from Node

#dump, #lines, #name, #prefix_lines, #schema, #schema=, #source_lines, #to_s

Constructor Details

#initialize(parent, phase, path, args = nil) ⇒ ExeNode

Returns a new instance of ExeNode.



129
130
131
132
# File 'lib/builder/node.rb', line 129

def initialize(parent, phase, path, args = nil)
  super(parent, phase, :exe, path, args)
  @pipe = Command::Pipe.new(to_s, stderr: nil)
end

Instance Attribute Details

#pipeObject (readonly)

Using a pipe instead of just executing the command shaves off some deciseconds spent starting up bash. It expects the process to read database/username from standard input



127
128
129
# File 'lib/builder/node.rb', line 127

def pipe
  @pipe
end

Instance Method Details

#inspectObject



134
# File 'lib/builder/node.rb', line 134

def inspect() "#{path}(#{args.join(", ")})" end