On May 25, 2007, at 12:54 AM, lee hartley wrote:
> # create the array of args to pass to cap, this would be ARGV
> in a command
> argv = %W{-vvv -S hosts=#{hosts}}
> postargs = %W{-p xxx -f [EMAIL PROTECTED] #{task}}
>
> #add options to array in proper order so that task is on end
> argv << options
> argv << postargs
>
> Capistrano::CLI.new(argv).execute!
Note that Array#<< just adds the argument to the end of the array--it
does not actually concatenate if the argument is an array.
In other words, consider this example:
a = [1,2,3]
b = [4,5]
a << b
In that case, a would be [1,2,3,[4,5]], not [1,2,3,4,5].
If you want the latter, you need to use Array#concat:
a.concat(b)
That will give you [1,2,3,4,5].
Hope that helps,
Jamis
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---