lib/kubes/compiler/strategy/result.rb in kubes-0.6.8 vs lib/kubes/compiler/strategy/result.rb in kubes-0.7.0
- old
+ new
@@ -12,13 +12,17 @@
end
# decorate(:pre) or decorate(:post)
def decorate!(phase)
klass = "Kubes::Compiler::Decorator::#{phase.to_s.camelize}".constantize
- @data = klass.new(@data).result
+ results = [@data].flatten
+ results.map! do |r|
+ klass.new(r).result
+ end
end
def content
- yaml_dump(@data)
+ result = @data.size == 1 ? @data.first : @data
+ yaml_dump(result)
end
end
end