lib/fezzik/base.rb in fezzik-0.8.1 vs lib/fezzik/base.rb in fezzik-0.8.2
- old
+ new
@@ -32,18 +32,23 @@
roles = (Hash === args.last && args.last[:roles]) ? args.pop[:roles] : []
name, args, deps = Rake.application.resolve_args(args)
host_task(name, { :args => Array(args), :deps => Array(deps), :roles => Array(roles) }, &block)
end
+ WEAVE_OPTIONS = [:num_threads, :serial, :batch_by]
+
def self.host_task(name, options = {}, &block)
options = {
:args => [],
:deps => [],
:roles => []
}.merge(options)
+ weave_options = options.dup.keep_if { |k, v| WEAVE_OPTIONS.include? k }
+ options.delete_if { |k, v| WEAVE_OPTIONS.include? k }
options.each { |key, value| options[key] = Array(value) }
t = HostTask.define_task(name, { options[:args] => options[:deps] }, &block)
t.roles += options[:roles]
+ t.weave_options = t.weave_options.merge(weave_options)
end
def self.init(options={})
@options = options
@target_destination = ENV["fezzik_destination"].to_sym rescue nil