Class: Taketo::Constructs::Command
- Inherits:
-
BaseConstruct
- Object
- BaseConstruct
- Taketo::Constructs::Command
- Includes:
- Shellwords
- Defined in:
- lib/taketo/constructs/command.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#description ⇒ Object
Returns the value of attribute description.
Attributes inherited from BaseConstruct
#default_server_config, #name, #parent
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from BaseConstruct
#initialize, #node_type, #parents, #path, #qualified_name
Methods included from AssociatedNodes
Constructor Details
This class inherits a constructor from Taketo::Constructs::BaseConstruct
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
9 10 11 |
# File 'lib/taketo/constructs/command.rb', line 9 def command @command end |
#description ⇒ Object
Returns the value of attribute description.
9 10 11 |
# File 'lib/taketo/constructs/command.rb', line 9 def description @description end |
Class Method Details
.default ⇒ Object
11 12 13 |
# File 'lib/taketo/constructs/command.rb', line 11 def self.default new(:default).tap { |cmd| cmd.command = "bash" } end |
.explicit_command(command_string) ⇒ Object
15 16 17 |
# File 'lib/taketo/constructs/command.rb', line 15 def self.explicit_command(command_string) new(:explicit_command).tap { |cmd| cmd.command = command_string.to_s } end |
Instance Method Details
#render(server, options = {}) ⇒ Object
19 20 21 |
# File 'lib/taketo/constructs/command.rb', line 19 def render(server, = {}) %Q[#{location(server, )} #{environment_variables(server)} #{command}].strip.squeeze(" ") end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/taketo/constructs/command.rb', line 23 def to_s command.to_s end |