Module: Beaker::DSL::Wrappers
- Included in:
- Beaker::DSL
- Defined in:
- lib/beaker/dsl/wrappers.rb
Overview
These are wrappers to equivalent Command objects so that command line actions are executed within an appropriate and configurable environment.
I find most of these adapters of suspicious value and have deprecated many of them.
Instance Method Summary collapse
-
#cfacter(*args) ⇒ Object
This is hairy and because of legacy code it will take a bit more work to disentangle all of the things that are being passed into this catchall param.
-
#facter(*args) ⇒ Object
This is hairy and because of legacy code it will take a bit more work to disentangle all of the things that are being passed into this catchall param.
-
#hiera(*args) ⇒ Object
This is hairy and because of legacy code it will take a bit more work to disentangle all of the things that are being passed into this catchall param.
-
#powershell(command, args = {}) ⇒ Command
Returns a Command object for executing powershell commands on a host.
-
#puppet(*args) ⇒ Object
This is hairy and because of legacy code it will take a bit more work to disentangle all of the things that are being passed into this catchall param.
Instance Method Details
#cfacter(*args) ⇒ Object
This is hairy and because of legacy code it will take a bit more work to disentangle all of the things that are being passed into this catchall param.
28 29 30 31 32 33 |
# File 'lib/beaker/dsl/wrappers.rb', line 28 def cfacter(*args) = args.last.is_a?(Hash) ? args.pop : {} ['ENV'] ||= {} [:cmdexe] = true Command.new('cfacter', args, ) end |
#facter(*args) ⇒ Object
This is hairy and because of legacy code it will take a bit more work to disentangle all of the things that are being passed into this catchall param.
16 17 18 19 20 21 |
# File 'lib/beaker/dsl/wrappers.rb', line 16 def facter(*args) = args.last.is_a?(Hash) ? args.pop : {} ['ENV'] ||= {} [:cmdexe] = true Command.new('facter', args, ) end |
#hiera(*args) ⇒ Object
This is hairy and because of legacy code it will take a bit more work to disentangle all of the things that are being passed into this catchall param.
40 41 42 43 44 45 |
# File 'lib/beaker/dsl/wrappers.rb', line 40 def hiera(*args) = args.last.is_a?(Hash) ? args.pop : {} ['ENV'] ||= {} [:cmdexe] = true Command.new('hiera', args, ) end |
#powershell(command, args = {}) ⇒ Command
Returns a Command object for executing powershell commands on a host
123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/beaker/dsl/wrappers.rb', line 123 def powershell(command, args={}) ps_opts = { 'ExecutionPolicy' => 'Bypass', 'InputFormat' => 'None', 'NoLogo' => '', 'NoProfile' => '', 'NonInteractive' => '' } ps_opts.merge!(args) arguments = " #{ps_opts.sort.map{|k,v| v.eql?('') ? "-#{k}" : "-#{k} #{v}" }.join(' ')} -Command \"#{command}\"" Command.new('powershell.exe', arguments, {}) end |
#puppet(*args) ⇒ Object
This is hairy and because of legacy code it will take a bit more work to disentangle all of the things that are being passed into this catchall param.
61 62 63 64 65 66 67 68 69 |
# File 'lib/beaker/dsl/wrappers.rb', line 61 def puppet(*args) = args.last.is_a?(Hash) ? args.pop : {} ['ENV'] ||= {} [:cmdexe] = true # we assume that an invocation with `puppet()` will have it's first argument # a face or sub command cmd = "puppet #{args.shift}" Command.new( cmd, args, ) end |