lib/mistral_client/mixins/definable.rb in mistral_client-1.2.1 vs lib/mistral_client/mixins/definable.rb in mistral_client-1.3.0
- old
+ new
@@ -4,9 +4,10 @@
# rubocop:disable Metrics/MethodLength
def parse_definition(definition)
if definition.is_a?(Hash) || definition.is_a?(Array)
return YAML.dump(definition)
end
+
definition = File.read(definition) if File.exist?(definition)
# Called outside the if/else to validate the YAML.
parsed = YAML.safe_load(definition, [], [], true)
if defined? massage_definition
massage_definition(parsed)