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.



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

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



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

def pipe
  @pipe
end

Instance Method Details

#inspectObject



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

def inspect() "#{path} #{(args || []).join(" ")}" end