I'm working on a complex Capistrano recipe that requires being able to
run a task without callbacks. After some searching through source and
rdocs, it seems that "execute_task" is the intended way to do this.
The documentation states that it "executes the task with the given
name, without invoking any associated callbacks." However, when I run
a task with execute_task, its callbacks are executed. I also tried
using invoke_task_directly, which is what execute_task calls
internally, and that also runs callbacks. Am I misunderstanding the
purpose of execute_task? Is there some other method I should be using?
I'm including a minimal Capfile which demonstrates the problem I'm
having along with the results I'm getting and the results I'm
expecting.

I've spend a little bit of time trying to figure out what's happening
with this in the ruby debugger, but with all the meta-programming
going on in Capistrano, I had a hard time figuring out what's actually
happening. So I thought that before I spend a whole day digging
through the source code, I'd see if perhaps anyone else had
experienced something similar or if I was misinterpreting what
execute_task is supposed to do.

Thanks in advance for your help,
- Emily

The capfile:
task :say_foo_without_callback do
  t = top.find_task 'say_foo'
  execute_task t
end

task :say_foo do
  puts 'foo!'
end

task :say_bar do
  puts 'bar!'
end

after :say_foo, :say_bar


Output from 'cap say_foo':
  * executing `say_foo'
foo!
    triggering after callbacks for `say_foo'
  * executing `say_bar'
bar!


Output from 'cap say_foo_without_callback':
  * executing `say_foo_without_callback'
  * executing `say_foo'
foo!
    triggering after callbacks for `say_foo'
  * executing `say_bar'
bar!


What I would expect from 'cap say_foo_without_callback':
  * executing `say_foo_without_callback'
  * executing `say_foo'
foo!

--~--~---------~--~----~------------~-------~--~----~
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