public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Added support for plugins to be installed as submodules with the application 
templater. [#1517 state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
peterc (author)
Fri Dec 05 02:56:46 -0800 2008
lifo (committer)
Fri Dec 05 15:01:42 -0800 2008
commit  9eca588bdfbb41f6b48477025d1cd8eea4a38296
tree    dfb0c15ee1c5d68e0df3550b98b2938e267a41cb
parent  731dcd84048ef259684cc8005101f65d1941e495
...
57
58
59
 
60
61
62
63
 
64
65
66
67
68
69
 
 
 
 
 
70
71
72
...
57
58
59
60
61
62
63
64
65
66
67
68
69
70
 
71
72
73
74
75
76
77
78
0
@@ -57,16 +57,22 @@ module Rails
0
     end
0
 
0
     # Install a plugin.  You must provide either a Subversion url or Git url.
0
+    # For a Git-hosted plugin, you can specify if it should be added as a submodule instead of cloned.
0
     #
0
     # ==== Examples
0
     #
0
     #   plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git'
0
+    #   plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git', :submodule => true
0
     #   plugin 'restful-authentication', :svn => 'svn://svnhub.com/technoweenie/restful-authentication/trunk'
0
     #
0
     def plugin(name, options)
0
       puts "installing plugin #{name}"
0
 
0
-      if options[:git] || options[:svn]
0
+      if options[:git] && options[:submodule]
0
+        in_root do
0
+          Git.run("submodule add #{options[:git]} vendor/plugins/#{name}")
0
+        end
0
+      elsif options[:git] || options[:svn]
0
         in_root do
0
           `script/plugin install #{options[:svn] || options[:git]}`
0
         end

Comments