Commit 79ebfd37 authored by Laurent Briais's avatar Laurent Briais

- Bump `universe_compiler` (now handles entity types inheritance).

- Fix for properties set on command-line when creating en entity to handle both standard and `has_one` properties.
parent c868c312
......@@ -19,15 +19,19 @@ module PowerStencil
if md = property_def.match(/^\s*(?<prop_name>[^:=]+)\s*[:=]\s*(?<prop_val>.*)\s*$/)
property_value = md['prop_val']
logger.debug "Using extra properties from command line '#{md['prop_name']}' = '#{property_value}'"
esr = PowerStencil::Utils::EntityHelper::EntitySearchReference.from_string property_value
if esr
type, name = esr.to_a
referenced_entity = project.engine.entity(type, name)
property_value = referenced_entity.to_reference unless referenced_entity.nil?
puts_and_logs "Could not find entity '#{type.to_s}/#{name}' !", logs_as: :error, check_verbose: false if referenced_entity.nil?
if pd = property_value.match(/^\s*!entity\s+(?<entity_id>.+)\s*$/)
property_value = pd['entity_id']
esr = PowerStencil::Utils::EntityHelper::EntitySearchReference.from_string property_value
if esr
type, name = esr.to_a
referenced_entity = project.engine.entity(type, name)
property_value = referenced_entity.to_reference unless referenced_entity.nil?
puts_and_logs "Could not find entity '#{type.to_s}/#{name}' !", logs_as: :error, check_verbose: false if referenced_entity.nil?
end
end
entity_as_hash[md['prop_name'].to_sym] = property_value
else
raise PowerStencil::Error, "Invalid command line property definition: '#{property_def}'"
end
......
......@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'climatic', '~> 0.2.35'
spec.add_dependency 'dir_glob_ignore', '~> 0.3'
spec.add_dependency 'universe_compiler', '~> 0.5.5'
spec.add_dependency 'universe_compiler', '~> 0.5.6'
spec.add_dependency 'pry'
spec.add_dependency 'git' , '~> 1.5.0'
spec.add_dependency 'haml', '~> 5.1.2'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment