Skip to content
Browse files

Small tweak to allow plugins to specify gem dependencies. [rick]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9141 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 088ef18 commit 65b4702c4f410b0ff1443eccf48f578a495cb7bf @technoweenie technoweenie committed
Showing with 21 additions and 1 deletion.
  1. +15 −0 railties/CHANGELOG
  2. +5 −0 railties/lib/initializer.rb
  3. +1 −1 railties/lib/rails/gem_dependency.rb
View
15 railties/CHANGELOG
@@ -1,5 +1,20 @@
*SVN*
+* Small tweak to allow plugins to specify gem dependencies. [rick]
+
+ # OLD open_id_authentication plugin init.rb
+ require 'yadis'
+ require 'openid'
+ ActionController::Base.send :include, OpenIdAuthentication
+
+ # NEW
+ config.gem "ruby-openid", :lib => "openid", :version => "1.1.4"
+ config.gem "ruby-yadis", :lib => "yadis", :version => "0.3.4"
+
+ config.after_initialize do
+ ActionController::Base.send :include, OpenIdAuthentication
+ end
+
* Added config.gem for specifying which gems are required by the application, as well as rake tasks for installing and freezing gems. [rick]
Rails::Initializer.run do |config|
View
5 railties/lib/initializer.rb
@@ -102,6 +102,11 @@ def process
load_gems
load_plugins
+
+ # pick up any gems that plugins depend on
+ add_gem_load_paths
+ load_gems
+
load_application_initializers
# the framework is now fully initialized
View
2 railties/lib/rails/gem_dependency.rb
@@ -35,7 +35,7 @@ def add_load_paths
end
def load
- return if @load_paths_added == false
+ return if @loaded || @load_paths_added == false
require(@lib || @name)
@loaded = true
rescue LoadError

0 comments on commit 65b4702

Please sign in to comment.
Something went wrong with that request. Please try again.