I'll give it a shot. Thanks, Jamis. On Apr 16, 5:47 pm, Jamis Buck <[EMAIL PROTECTED]> wrote: > You'll need to walk the namespace tree and collect tasks, something > like this: > > def walk_namespace(namespace, pattern, &block) > namespace.tasks.each do |task| > block.call(task) if task.fully_qualified_name =~ pattern > end > > namespace.namespaces.each do |ns| > walk_namespace(ns, pattern, &block) > end > > self > end > > walk_namespace(top, /^\w+:permissions$/) do |task| > execute_task(task) > end > > (The above code has _not_ been tested, and was written pretty much off- > the-cuff, so you may need to tweak it a bit.) > > - Jamis > > On Apr 16, 2008, at 3:15 PM, Josh French wrote: > > > > > Is there a way to detect and run arbitrary cap tasks from another > > task, similar to the way I might look for Rake tasks matching a > > namespace or file pattern and execute them without explicitly naming > > each one? > > > The problem I'm solving for is: I'd like to split a large deploy > > recipe across several files so that I can pick and choose individual > > components for different applications. I'd like a master recipe with > > e.g. a permissions task that would collect the present component > > recipes and run each component:permissions:default, without being told > > ahead of time what components are present. > > > Thanks, > > Josh > > > > > > smime.p7s > 3KDownload
--~--~---------~--~----~------------~-------~--~----~ To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/capistrano -~----------~----~----~----~------~----~------~--~---
