Module: Packer::Binary::Command
- Defined in:
- lib/packer/binary/command.rb
Overview
This module handles running the actual CLI commands
Defined Under Namespace
Classes: CommandFailure
Class Method Summary collapse
-
.binary ⇒ String
Downloads, extracts and returns the path to the binary.
-
.run(command) ⇒ String
Runs the given command with
Core::Kernel.system
Examplerun('sub-command -var "key=value" -machine-readable')
.
Class Method Details
.binary ⇒ String
Downloads, extracts and returns the path to the binary
20 21 22 23 24 25 |
# File 'lib/packer/binary/command.rb', line 20 def binary e = Executable.new e.download e.extract e.binary end |
.run(command) ⇒ String
Runs the given command with Core::Kernel.system
Example run('sub-command -var "key=value" -machine-readable')
14 15 16 |
# File 'lib/packer/binary/command.rb', line 14 def run(command) system("#{binary} #{command}") || (raise CommandFailure) end |