Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added support for plugins to be installed as submodules with the appl…

…ication templater. [#1517 state:resolved]

Signed-off-by: Pratik Naik <>
  • Loading branch information...
commit 9eca588bdfbb41f6b48477025d1cd8eea4a38296 1 parent 731dcd8
@peterc peterc authored lifo committed
8 railties/lib/rails_generator/generators/applications/app/template_runner.rb
@@ -57,16 +57,22 @@ def file(filename, data = nil, &block)
# 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://'
+ # plugin 'restful-authentication', :git => 'git://', :submodule => true
# plugin 'restful-authentication', :svn => 'svn://'
def plugin(name, options)
puts "installing plugin #{name}"
- if options[:git] || options[:svn]
+ if options[:git] && options[:submodule]
+ in_root do
+"submodule add #{options[:git]} vendor/plugins/#{name}")
+ end
+ elsif options[:git] || options[:svn]
in_root do
`script/plugin install #{options[:svn] || options[:git]}`
Please sign in to comment.
Something went wrong with that request. Please try again.