lib/cl/runner/multi.rb in cl-0.1.12 vs lib/cl/runner/multi.rb in cl-0.1.13

- old
+ new

@@ -1,12 +1,14 @@ class Cl module Runner class Multi - attr_reader :name, :cmds + Runner.register :multi, self - def initialize(name, *args) - @name = name + attr_reader :ctx, :cmds + + def initialize(ctx, *args) + @ctx = ctx @cmds = build(group(args)) end def run cmds.map(&:run) @@ -22,10 +24,10 @@ end end def build(cmds) cmds.map do |(cmd, *args)| - cmd.new(name, args) + cmd.new(ctx, args) end end end end end