Skip to content

Commit

Permalink
Small tweak to allow plugins to specify gem dependencies. [rick]
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9141 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
technoweenie committed Mar 30, 2008
1 parent 088ef18 commit 65b4702
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
15 changes: 15 additions & 0 deletions railties/CHANGELOG
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,20 @@
*SVN* *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] * 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| Rails::Initializer.run do |config|
Expand Down
5 changes: 5 additions & 0 deletions railties/lib/initializer.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ def process


load_gems load_gems
load_plugins load_plugins

# pick up any gems that plugins depend on
add_gem_load_paths
load_gems

load_application_initializers load_application_initializers


# the framework is now fully initialized # the framework is now fully initialized
Expand Down
2 changes: 1 addition & 1 deletion railties/lib/rails/gem_dependency.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def add_load_paths
end end


def load def load
return if @load_paths_added == false return if @loaded || @load_paths_added == false
require(@lib || @name) require(@lib || @name)
@loaded = true @loaded = true
rescue LoadError rescue LoadError
Expand Down

0 comments on commit 65b4702

Please sign in to comment.