Method: Packer::Binary#method_missing

Defined in:
lib/packer/binary.rb

#method_missing(method, *args, &block) ⇒ Object (private)

Note:

if the method is an invalid sub-command or if the command fails you will get a Packer::Binary::Command::CommandFailure exception

This method maps Packer::Binary method calls to Packer sub-commands Ex. to run packer build test.json -machine-readable:

Packer::Binary.build('test.json -machine-readable')

Since:

  • 0.2.0



41
42
43
44
45
46
47
48
# File 'lib/packer/binary.rb', line 41

def method_missing(method, *args, &block)
  if method.to_s =~ /(\w+)/
    puts "#{method.to_s.downcase} #{args.join(' ')}"
    Command.run("#{method.to_s.downcase} #{args.join(' ')}")
  else
    super
  end
end