Class: PackRb::SubCommands

Inherits:
Object
  • Object
show all
Includes:
Build, Inspect, Validate
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

Methods included from Validate

#validate

Methods included from Inspect

#inspect_tpl

Methods included from Build

#build, #parse_options

Instance Method Details

#execute(opts) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/pack_rb/sub_commands.rb', line 13

def execute(opts)
  cmd = opts[:cmd]
  tpl = opts[:tpl]

  out, err, status = Open3.capture3("#{cmd} -", stdin_data: tpl)

  if status.exitstatus != 0
    puts out if out
    puts err if err
  end
end