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.
164 165 166 167 168 169 170 171 |
# File 'lib/gat/action/shell_command.rb', line 164 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.
161 162 163 |
# File 'lib/gat/action/shell_command.rb', line 161 def arguments @arguments end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
158 159 160 |
# File 'lib/gat/action/shell_command.rb', line 158 def name @name end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
155 156 157 |
# File 'lib/gat/action/shell_command.rb', line 155 def parent @parent end |
#syntax ⇒ Object
Returns the value of attribute syntax.
156 157 158 |
# File 'lib/gat/action/shell_command.rb', line 156 def syntax @syntax end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
157 158 159 |
# File 'lib/gat/action/shell_command.rb', line 157 def values @values end |
Instance Method Details
#exec ⇒ Object
173 174 175 176 177 178 179 180 181 |
# File 'lib/gat/action/shell_command.rb', line 173 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 |