Module: Packer::Binary::Helpers
- Included in:
- Compressor, Executable
- Defined in:
- lib/packer/binary/helpers.rb
Overview
Generic helper methods
Class Method Summary collapse
-
.debug(message) ⇒ Object
prints to
stfout
ifENV['DEBUG']
is set. -
.err(message) ⇒ Object
prints to
stderr
. -
.msg(message) ⇒ Object
prints to
stdout
. - .stderr ⇒ Object
- .stdout ⇒ Object
-
.system_command(*command_args) ⇒ Object
Runs given commands using mixlib-shellout.
Class Method Details
.debug(message) ⇒ Object
prints to stfout
if ENV['DEBUG']
is set
25 26 27 |
# File 'lib/packer/binary/helpers.rb', line 25 def debug() stdout.print("#{message}\n") if ENV['DEBUG'] end |
.err(message) ⇒ Object
prints to stderr
15 16 17 |
# File 'lib/packer/binary/helpers.rb', line 15 def err() stderr.print("#{message}\n") end |
.msg(message) ⇒ Object
prints to stdout
20 21 22 |
# File 'lib/packer/binary/helpers.rb', line 20 def msg() stdout.print("#{message}\n") end |
.stderr ⇒ Object
33 34 35 |
# File 'lib/packer/binary/helpers.rb', line 33 def stderr $stderr end |
.stdout ⇒ Object
29 30 31 |
# File 'lib/packer/binary/helpers.rb', line 29 def stdout $stdout end |
.system_command(*command_args) ⇒ Object
Runs given commands using mixlib-shellout
8 9 10 11 12 |
# File 'lib/packer/binary/helpers.rb', line 8 def system_command(*command_args) cmd = Mixlib::ShellOut.new(*command_args) cmd.run_command cmd end |