I am having a bit of an issue...i imagine it is a basic problem that
someone familiar with ruby could answer

i have been using the cli lib with cap to give it the args like so

@successful = Capistrano::CLI.new(%W(-vvvv -S
[EMAIL PROTECTED] -S [EMAIL PROTECTED] -S
[EMAIL PROTECTED] -S [EMAIL PROTECTED] -S
[EMAIL PROTECTED] -S -f [EMAIL PROTECTED] config_appliance -p
xxx)).execute!

and it works fine

but i wanted to create a general method for running cap task, so, i
wanted to take all that stuff as options...and end up with something
like this

 def run_cap_task(hosts,task,options=[])

@recipe =  File.expand_path(File.dirname(__FILE__) +
"/../../config/deploy_products.rb")

    # 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!

with argv being an array...i have tried a variety of attempts

snip from the cap cli side:

def initialize(args = ARGV)
      @args = args
      @options = { :recipes => [], :actions => [], :vars => {},
        :pre_vars => {}, :sysconf => default_sysconf, :dotfile =>
default_dotfile }

      OptionParser.new do |opts|
.........

the error i get is
["-S", "serial=99999", "-S", "hw_type=tmp", "-S", "sw_type=0", "-S",
"drives=1", "-S", "-S", "product=sw"] is not a symbol

i have tried turning it into :argv still with errors (don't recall
what they were)...and various other attempts...any pointers would be
great

are there any docs about using embedded cap? If not, I will write up
my experiences...once it is sorted out

thanks
lee

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to