In the capitate gem, we added a task_arg metho to the task DSL, so
that we could document and setup defaults for cap variables.
For example,
---
desc <<-DESC
Run the migrate rake task ....
DESC
task_arg(:rake, "Path to rake", :default => "rake")
task_arg(:merb_env, "Merb environment", :default => "")
task_arg(:migrate_target, "Migration target", :default => :latest)
task :migrate, :roles => :db, :only => { :primary => true } do
current_directory = case migrate_target.to_sym
when :current then current_path
when :latest then current_release
else raise ArgumentError, "unknown migration target
#{migrate_target.inspect}"
end
run "cd #{current_directory}; #{rake} MERB_ENV=#{merb_env}
#{migrate_env} db:migrate"
end
---
http://github.com/gabriel/capitate/tree/master/lib/recipes/merb.rb
Using this info, we also generate documentation, for example:
http://capitate.rubyforge.org/recipes/merb.html
Is this a weird "extension" of cap or do you think its something that
might be useful to add in?
Thanks!
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---