Class: Remocon::Command::Create
- Inherits:
-
Object
- Object
- Remocon::Command::Create
- Includes:
- InterpreterHelper
- Defined in:
- lib/remocon/command/create_command.rb
Instance Attribute Summary collapse
-
#cmd_opts ⇒ Object
readonly
Returns the value of attribute cmd_opts.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Create
constructor
A new instance of Create.
- #require_conditions_file_path ⇒ Object
- #require_parameters_file_path ⇒ Object
- #run ⇒ Object
Methods included from InterpreterHelper
#condition_array, #condition_names, #parameter_hash, #read_conditions, #read_parameters
Constructor Details
Instance Attribute Details
#cmd_opts ⇒ Object (readonly)
Returns the value of attribute cmd_opts.
8 9 10 |
# File 'lib/remocon/command/create_command.rb', line 8 def cmd_opts @cmd_opts end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/remocon/command/create_command.rb', line 8 def config @config end |
Instance Method Details
#require_conditions_file_path ⇒ Object
19 20 21 |
# File 'lib/remocon/command/create_command.rb', line 19 def require_conditions_file_path config.conditions_file_path end |
#require_parameters_file_path ⇒ Object
15 16 17 |
# File 'lib/remocon/command/create_command.rb', line 15 def require_parameters_file_path config.parameters_file_path end |
#run ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/remocon/command/create_command.rb', line 23 def run artifact = { conditions: condition_array, parameters: parameter_hash }.skip_nil_values.stringify_values File.open(config.config_json_file_path, "w+") do |f| # remote config allows only string values ;( f.write(JSON.pretty_generate(artifact)) f.flush end artifact end |