lib/hanuman/graph.rb in wukong-3.0.0.pre2 vs lib/hanuman/graph.rb in wukong-3.0.0.pre3

- old
+ new

@@ -29,11 +29,16 @@ graph.register end def build(options = {}) attrs = serialize - stages = attrs.delete(:stages).inject({}){ |hsh, (name, builder)| hsh[name] = builder.build(options) ; hsh } + stages = attrs.delete(:stages).inject({}){ |hsh, (name, builder)| hsh[name] = builder.build(stage_specific_options(name, options)) ; hsh } for_class.receive attrs.merge(stages: stages) + end + + def stage_specific_options(stage, options) + scope = options.delete(stage) || {} + options.merge(scope) end def namespace() Hanuman::Graph ; end def handle_dsl_arguments_for(stage, *args, &blk)