diff options
author | Matt Duncan <mrduncan@gmail.com> | 2009-08-08 18:07:17 -0400 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-08-08 23:42:18 +0100 |
commit | bee3e099bd3f4038f8a4122ad48446a232cbf21a (patch) | |
tree | 871d562aeeadf644e7bfd68b842d934aa839cbab /railties/lib | |
parent | 3ea091e1cc4deab1410676d080dc1fcdc572d65f (diff) | |
download | rails-bee3e099bd3f4038f8a4122ad48446a232cbf21a.tar.gz rails-bee3e099bd3f4038f8a4122ad48446a232cbf21a.tar.bz2 rails-bee3e099bd3f4038f8a4122ad48446a232cbf21a.zip |
Users can now pass :branch for git plugins and :revision for subversion plugins
[#2352 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/generators/actions.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/railties/lib/generators/actions.rb b/railties/lib/generators/actions.rb index 55ef212abb..03d0d11a07 100644 --- a/railties/lib/generators/actions.rb +++ b/railties/lib/generators/actions.rb @@ -5,22 +5,31 @@ module Rails module Actions # Install a plugin. You must provide either a Subversion url or Git url. - # For a Git-hosted plugin, you can specify if it should be added as a submodule instead of cloned. + # + # For a Git-hosted plugin, you can specify a branch and + # whether it should be added as a submodule instead of cloned. + # + # For a Subversion-hosted plugin you can specify a revision. # # ==== Examples # # plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git' + # plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git', :branch => 'stable' # plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git', :submodule => true # plugin 'restful-authentication', :svn => 'svn://svnhub.com/technoweenie/restful-authentication/trunk' + # plugin 'restful-authentication', :svn => 'svn://svnhub.com/technoweenie/restful-authentication/trunk', :revision => 1234 # def plugin(name, options) log :plugin, name if options[:git] && options[:submodule] + options[:git] = "-b #{options[:branch]} #{options[:git]}" if options[:branch] in_root do run "git submodule add #{options[:git]} vendor/plugins/#{name}", :verbose => false end elsif options[:git] || options[:svn] + options[:git] = "-b #{options[:branch]} #{options[:git]}" if options[:branch] + options[:svn] = "-r #{options[:revision]} #{options[:svn]}" if options[:revision] in_root do run_ruby_script "script/plugin install #{options[:svn] || options[:git]}", :verbose => false end |