Hi capistranoers,

As a longtime cap user, I am programmed to use the remote:<task> for
most common tasks, and I know it's being deprecated, but in spite of
bad habits, I still use it.  I know it only works for the tasks that
had the definition, and that's why it's being deprecated.

So, I used Geoffery Grosenbach's rake "method_missing" on the remote:
namespace to automatically make all tasks available, by just sending
them to cap:

whereas before you had:

namespace :remote do
  desc "Removes unused releases from the releases directory."
  task(:cleanup) { cap :cleanup }

  desc "Used only for deploying when the spinner isn't running."
  task(:cold_deploy) { cap :cold_deploy }

  # etc. etc., repeated rules
end

Now instead all those tasks are gone and you can just add:

  rule "" do |t|
    if /(remote:)([^.]+)$/.match(t.name)
      task_name = $2
      cap task_name
    end
  end

Now when you run: remote:<whatever> it just sends cap <whatever>

Seems to be working well, but I'd love some comments or to see if this
works on all setups.  I still left the remote:exec task, because
that's the other one I use.

patch attached.  enjoy,
-- 
Charles Brian Quinn
self-promotion: www.seebq.com
highgroove studios: www.highgroove.com
slingshot hosting: www.slingshothosting.com


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

Attachment: remote_namespace_method_missing_addition.diff
Description: Binary data

Reply via email to