Class: PackRb::SubCommands
- Inherits:
-
Object
- Object
- PackRb::SubCommands
- Defined in:
- lib/pack_rb/sub_commands.rb,
lib/pack_rb/sub_commands/build.rb,
lib/pack_rb/sub_commands/inspect.rb,
lib/pack_rb/sub_commands/validate.rb,
lib/pack_rb/sub_commands/error/errors.rb
Defined Under Namespace
Modules: Build, Error, Inspect, Validate
Instance Method Summary collapse
-
#execute(opts) ⇒ Array
Execute a Packer command via Executor.run_cmd_stream_output.
-
#initialize(opts = {}) ⇒ SubCommands
constructor
A new instance of SubCommands.
Methods included from Validate
Methods included from Inspect
Methods included from Build
Constructor Details
#initialize(opts = {}) ⇒ SubCommands
Returns a new instance of SubCommands.
12 13 14 15 16 17 |
# File 'lib/pack_rb/sub_commands.rb', line 12 def initialize(opts = {}) if opts[:stream_output] STDOUT.sync = true STDERR.sync = true end end |
Instance Method Details
#execute(opts) ⇒ Array
Execute a Packer command via Executor.run_cmd_stream_output
24 25 26 27 28 29 |
# File 'lib/pack_rb/sub_commands.rb', line 24 def execute(opts) cmd = opts[:cmd] tpl = opts[:tpl] PackRb::Executor.run_cmd_stream_output("#{cmd} -", tpl) end |