Class: Perkins::Build::Shell::Cmd

Inherits:
Node show all
Defined in:
lib/perkins/build/shell/node.rb

Instance Attribute Summary

Attributes inherited from Node

#level, #options

Instance Method Summary collapse

Methods inherited from Node

#escape, #initialize, #name, #to_s

Constructor Details

This class inherits a constructor from Perkins::Build::Shell::Node

Instance Method Details

#codeObject



31
32
33
34
35
36
37
# File 'lib/perkins/build/shell/node.rb', line 31

def code
  if opts.any?
    ['travis_cmd', escape(super), *opts].join(' ')
  else
    super
  end
end

#optsObject



39
40
41
42
43
44
45
46
47
# File 'lib/perkins/build/shell/node.rb', line 39

def opts
  opts ||= []
  opts << '--assert' if options[:assert]
  opts << '--echo'   if options[:echo]
  opts << '--retry'  if options[:retry]
  opts << '--timing' if options[:timing]
  opts << "--display #{escape(options[:echo])}" if options[:echo].is_a?(String)
  opts
end