bin/clouddns in clouddns-0.0.1 vs bin/clouddns in clouddns-0.0.2

- old
+ new

@@ -35,13 +35,19 @@ files = ARGV raise "No action specified" unless action raise "No files specified" if files.empty? +action = Clouddns::Actions.by_name(action) + zones = files.map do |file| - Clouddns::DSL.parse_file(file).zones -end.flatten + dsl = Clouddns::DSL.parse_file(file) -zones.each do |zone| - Clouddns::Actions.by_name(action).run(zone, options) + dsloptions = {:fog => dsl.fog_options}.merge(options) do |key, oldval, newval| + oldval.merge(newval) + end + + dsl.zones.each do |zone| + action.run(zone, dsloptions) + end end