Module: Puppet::Util::PTomulik::Package::Ports::Execution
- Included in:
- Options, PkgSearch, PortSearch
- Defined in:
- lib/puppet/util/ptomulik/package/ports/execution.rb
Overview
Provides ‘execute_command` and `execpipe` method
Instance Method Summary collapse
-
#execpipe(command, *args) ⇒ Object
Invoke ‘Puppet::Util::Execution.execpipe` or `Puppet::Util.execpipe` depending on which one is available first.
-
#execute_command(command, options = {}) ⇒ Object
Execute command via execpipe.
Instance Method Details
#execpipe(command, *args) ⇒ Object
Invoke ‘Puppet::Util::Execution.execpipe` or `Puppet::Util.execpipe` depending on which one is available first.
36 37 38 39 40 |
# File 'lib/puppet/util/ptomulik/package/ports/execution.rb', line 36 def execpipe(command, *args) # Puppet 2.7 would join with '', but we wish ' ' (spaces) between args.. command_str = command.respond_to?(:join) ? command.join(' ') : command execpipe_method.call(command_str, *args) { |pipe| yield pipe } end |
#execute_command(command, options = {}) ⇒ Object
Execute command via execpipe
51 52 53 54 55 56 |
# File 'lib/puppet/util/ptomulik/package/ports/execution.rb', line 51 def execute_command(command, = {}) executor = [:execpipe] || method(:execpipe) args = [command] args << [:failonfail] if .include?(:failonfail) executor.call(*args) { |pipe| yield pipe } end |