Class: Kitchen::LoginCommand
- Inherits:
-
Object
- Object
- Kitchen::LoginCommand
- Defined in:
- lib/kitchen/login_command.rb
Overview
Value object to track a shell command that will be passed to Kernel.exec for execution.
Instance Attribute Summary collapse
-
#arguments ⇒ Array
readonly
Array of arguments to the command.
-
#command ⇒ String
readonly
Login command.
-
#options ⇒ Hash
readonly
Options hash, passed to ‘Kernel#exec`.
Instance Method Summary collapse
- #exec_args ⇒ Object
-
#initialize(command, arguments, options = {}) ⇒ LoginCommand
constructor
Constructs a new LoginCommand instance.
Constructor Details
#initialize(command, arguments, options = {}) ⇒ LoginCommand
Constructs a new LoginCommand instance.
39 40 41 42 43 |
# File 'lib/kitchen/login_command.rb', line 39 def initialize(command, arguments, = {}) @command = command @arguments = Array(arguments) @options = end |
Instance Attribute Details
#arguments ⇒ Array (readonly)
Returns array of arguments to the command.
28 29 30 |
# File 'lib/kitchen/login_command.rb', line 28 def arguments @arguments end |
#command ⇒ String (readonly)
Returns login command.
25 26 27 |
# File 'lib/kitchen/login_command.rb', line 25 def command @command end |
#options ⇒ Hash (readonly)
Returns options hash, passed to ‘Kernel#exec`.
31 32 33 |
# File 'lib/kitchen/login_command.rb', line 31 def @options end |
Instance Method Details
#exec_args ⇒ Object
45 46 47 |
# File 'lib/kitchen/login_command.rb', line 45 def exec_args [command, *arguments, ] end |