lib/mothership/inputs.rb in mothership-0.0.4 vs lib/mothership/inputs.rb in mothership-0.0.5
- old
+ new
@@ -40,11 +40,17 @@
meta = @command.inputs[name]
return unless meta
if @inputs.key?(name) && @inputs[name] != []
val =
- if meta[:from_given]
- @context.instance_exec(@inputs[name], *args, &meta[:from_given])
+ if convert = meta[:from_given]
+ if @inputs[name].is_a?(Array)
+ @inputs[name].collect do |i|
+ @context.instance_exec(i, *args, &convert)
+ end
+ else
+ @context.instance_exec(@inputs[name], *args, &convert)
+ end
else
@inputs[name]
end
return @cache[name] = val