Class: Bolt::PAL::YamlPlan::Step::Script
Constant Summary
STEP_KEYS
Instance Attribute Summary
#body
Class Method Summary
collapse
create, #evaluate, #initialize, parse_code_string, #transpile, validate, validate_puppet_code
Class Method Details
.allowed_keys ⇒ Object
8
9
10
|
# File 'lib/bolt/pal/yaml_plan/step/script.rb', line 8
def self.allowed_keys
super + Set['arguments', 'pwsh_params']
end
|
.option_keys ⇒ Object
12
13
14
|
# File 'lib/bolt/pal/yaml_plan/step/script.rb', line 12
def self.option_keys
Set['catch_errors', 'env_vars', 'run_as']
end
|
.required_keys ⇒ Object
16
17
18
|
# File 'lib/bolt/pal/yaml_plan/step/script.rb', line 16
def self.required_keys
Set['script', 'targets']
end
|
.validate_step_keys(body, number) ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/bolt/pal/yaml_plan/step/script.rb', line 20
def self.validate_step_keys(body, number)
super
if body.key?('arguments') && !body['arguments'].nil? && !body['arguments'].is_a?(Array)
raise StepError.new('arguments key must be an array', body['name'], number)
end
if body.key?('pwsh_params') && !body['pwsh_params'].nil? && !body['pwsh_params'].is_a?(Hash)
raise StepError.new('pwsh_params key must be a hash', body['name'], number)
end
if body.key?('env_vars') && ![Hash, String].include?(body['env_vars'].class)
raise StepError.new('env_vars key must be a hash or evaluable string', body['name'], number)
end
end
|