Class: Gat::Action::ShellCommandChild
- Inherits:
-
Object
- Object
- Gat::Action::ShellCommandChild
- Includes:
- Interpreter
- Defined in:
- lib/gat/action/shell_command.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#syntax ⇒ Object
Returns the value of attribute syntax.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
- #exec ⇒ Object
-
#initialize(parent, values) ⇒ ShellCommandChild
constructor
A new instance of ShellCommandChild.
Methods included from Interpreter
#interpreter_parameter, #interpreter_parameters, #interpreter_shell_command
Constructor Details
#initialize(parent, values) ⇒ ShellCommandChild
Returns a new instance of ShellCommandChild.
165 166 167 168 169 170 171 172 |
# File 'lib/gat/action/shell_command.rb', line 165 def initialize(parent, values) @parent = parent @values = values @syntax = parent.syntax @name = "#{ parent.name }*over* #{ values.values.join("_") }" end |
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments.
162 163 164 |
# File 'lib/gat/action/shell_command.rb', line 162 def arguments @arguments end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
159 160 161 |
# File 'lib/gat/action/shell_command.rb', line 159 def name @name end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
156 157 158 |
# File 'lib/gat/action/shell_command.rb', line 156 def parent @parent end |
#syntax ⇒ Object
Returns the value of attribute syntax.
157 158 159 |
# File 'lib/gat/action/shell_command.rb', line 157 def syntax @syntax end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
158 159 160 |
# File 'lib/gat/action/shell_command.rb', line 158 def values @values end |
Instance Method Details
#exec ⇒ Object
174 175 176 177 178 179 180 181 182 |
# File 'lib/gat/action/shell_command.rb', line 174 def exec # make the substitution of each parameter and exec like other action values.each_pair do |parameter_key, parameter_value | self.syntax = self.syntax.gsub(/\{\{#{ parameter_key }\}\}/, parameter_value) end parse_syntax = interpreter_parameters(self.syntax, self.parent.operation.gatget) self.parent.exec(parse_syntax, " *over* #{ values.values.join("_") }") end |