lib/applix.rb in applix-0.3.7 vs lib/applix.rb in applix-0.3.8
- old
+ new
@@ -48,12 +48,16 @@
# case #4: we must un-shift the name back into the args list to lets any
# see it as its first argument,
(args.unshift name.to_s) if(name != :any && task[:name] == :any)
- # do the call
- rc = task[:code].call(*args, options)
+ # cluster for nesting or direct calling?
+ if task[:cluster]
+ rc = Applix.main(args, options, &task[:code])
+ else
+ rc = task[:code].call(*args, options)
+ end
# post handle
unless @epilog_cb.nil?
rc = @epilog_cb.call(rc, args, options)
end
@@ -71,9 +75,13 @@
@epilog_cb = blk
end
def any &blk
tasks[:any] = { :name => :any, :code => blk }
+ end
+
+ def cluster name, &blk
+ tasks[name.to_sym] = { :name => name, :code => blk, :cluster => true }
end
def handle name, &blk
tasks[name.to_sym] = { :name => name, :code => blk }
end