diff options
author | Peter Cooper <peter@peterc.org> | 2008-12-05 10:56:46 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-12-06 00:01:42 +0100 |
commit | 9eca588bdfbb41f6b48477025d1cd8eea4a38296 (patch) | |
tree | dfb0c15ee1c5d68e0df3550b98b2938e267a41cb /railties/lib/rails_generator | |
parent | 731dcd84048ef259684cc8005101f65d1941e495 (diff) | |
download | rails-9eca588bdfbb41f6b48477025d1cd8eea4a38296.tar.gz rails-9eca588bdfbb41f6b48477025d1cd8eea4a38296.tar.bz2 rails-9eca588bdfbb41f6b48477025d1cd8eea4a38296.zip |
Added support for plugins to be installed as submodules with the application templater. [#1517 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'railties/lib/rails_generator')
-rw-r--r-- | railties/lib/rails_generator/generators/applications/app/template_runner.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/railties/lib/rails_generator/generators/applications/app/template_runner.rb b/railties/lib/rails_generator/generators/applications/app/template_runner.rb index 3a4815c0dd..fb4b768265 100644 --- a/railties/lib/rails_generator/generators/applications/app/template_runner.rb +++ b/railties/lib/rails_generator/generators/applications/app/template_runner.rb @@ -57,16 +57,22 @@ module Rails end # 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. # # ==== Examples # # plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git' + # plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git', :submodule => true # plugin 'restful-authentication', :svn => 'svn://svnhub.com/technoweenie/restful-authentication/trunk' # def plugin(name, options) puts "installing plugin #{name}" - if options[:git] || options[:svn] + if options[:git] && options[:submodule] + in_root do + Git.run("submodule add #{options[:git]} vendor/plugins/#{name}") + end + elsif options[:git] || options[:svn] in_root do `script/plugin install #{options[:svn] || options[:git]}` end |