Class: Prick::Build::CommandNode

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

Direct Known Subclasses

EvalNode, ExecNode

Instance Attribute Summary

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) ⇒ CommandNode

Returns a new instance of CommandNode.



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

def initialize(parent, phase, path, args = nil)
  constrain args, [String]
  super(parent, phase, :exe, path, args)
end

Instance Method Details

#filenameObject



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

def filename = File.basename(path)

#inspectObject



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

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

#relpathObject



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

def relpath = path.sub(/^#{Dir.getwd}\//, "")