Just type app, without the colon. This is because ui.ask returns a String, not a Symbol, and you want the String "app", which is the string version of the Symbol :app.
Hope that makes some sense. - Jamis On 1/16/09 4:30 PM, pete wrote: > I'd say there's nothing dumb about it, aliases are good. > > Anyhow, can the array of machines be identifiers to roles that were > created inside the capfile? > > For example, on prompt can I type :app, where :app is some list of > machines? > > I have tried several variations but am getting a negative response on > all of them. > > On Jan 16, 3:58 pm, Jamis Buck <[email protected]> wrote: >> Sorry I wasn't clear. The defer() method is an alias for Proc.new. So >> you'd just do: >> >> :roles => defer { Capistrano::CLI.ui.ask(...) } >> >> Or, if you prefer: >> >> :roles => Proc.new { Capistrano::CLI.ui.ask(...) } >> >> Some might say that adding defer() was dumb on my part, but I think it >> reads much nicer than Proc.new. So, choose your poison. :) >> >> - Jamis >> >> On 1/16/09 3:45 PM, pete wrote: >> >>> Ok, I know it's possible, but I seem to be messing this up... >>> Would it be like this? >>> task :test_task, :roles => defer { Proc.new { Capistrano::CLI.ui.ask >>> ("Please specify ENV: " )} } do >>> run "echo hi" >>> end >>> On Jan 16, 2:38 pm, Jamis Buck <[email protected]> wrote: >>>> Pete, yes you can pass a Proc object as the value of the :roles option, >>>> and it will get evaluated when the task is considered for execution. The >>>> proc should return an array of role names. >>>> Capistrano provides a defer() helper to make declaring the procs a bit >>>> easier to read: >>>> task :generic_task, :roles => defer { compute_role_names_here } do >>>> # ... >>>> end >>>> - Jamis >>>> On 1/16/09 1:48 PM, pete wrote: >>>>> Hello- >>>>> Is it possible to dynamically set roles for a specific task? >>>>> For example, I want to create some generic tasks, along with groups of >>>>> servers I use, and I wan tto be able to execute these commands on >>>>> different groups, without having to duplicate code. >>>>> role :group1, m1, m2, m3 >>>>> role :group2, m4, m5, m6 >>>>> task :generic_task, :roles => [some passed in variable] do >>>>> run "echo hi" >>>>> end >>>>> Is something like this possible? I have tried a couple options, none >>>>> of which worked. >>>>> Thanks! >> > > --~--~---------~--~----~------------~-------~--~----~ To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/capistrano -~----------~----~----~----~------~----~------~--~---
