diff options
author | Rick Olson <technoweenie@gmail.com> | 2008-03-30 02:35:08 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2008-03-30 02:35:08 +0000 |
commit | 65b4702c4f410b0ff1443eccf48f578a495cb7bf (patch) | |
tree | 4dda3e9d94d4423af8c44679afc7c1061095ed77 /railties | |
parent | 088ef182e3006294b8f0e9b185d272a777c4437a (diff) | |
download | rails-65b4702c4f410b0ff1443eccf48f578a495cb7bf.tar.gz rails-65b4702c4f410b0ff1443eccf48f578a495cb7bf.tar.bz2 rails-65b4702c4f410b0ff1443eccf48f578a495cb7bf.zip |
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
Diffstat (limited to 'railties')
-rw-r--r-- | railties/CHANGELOG | 15 | ||||
-rw-r--r-- | railties/lib/initializer.rb | 5 | ||||
-rw-r--r-- | railties/lib/rails/gem_dependency.rb | 2 |
3 files changed, 21 insertions, 1 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 7950e6a14f..97bb718e37 100644 --- a/railties/CHANGELOG +++ b/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| diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 4be7b06f93..ec3e1d79d6 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -102,6 +102,11 @@ module Rails 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 diff --git a/railties/lib/rails/gem_dependency.rb b/railties/lib/rails/gem_dependency.rb index ed16464887..2ffacd17b6 100644 --- a/railties/lib/rails/gem_dependency.rb +++ b/railties/lib/rails/gem_dependency.rb @@ -35,7 +35,7 @@ module Rails end def load - return if @load_paths_added == false + return if @loaded || @load_paths_added == false require(@lib || @name) @loaded = true rescue LoadError |