diff options
author | rick <technoweenie@gmail.com> | 2008-06-08 14:04:04 -0400 |
---|---|---|
committer | rick <technoweenie@gmail.com> | 2008-06-08 14:04:04 -0400 |
commit | faad1e32a8ab81890018ba89d191607778830cf0 (patch) | |
tree | a7d07b839fae5004fac164cdceb9d76b9a568af2 /railties/lib/rails/plugin.rb | |
parent | 138adbf156905f5cc6669ba33dd94802c82514d9 (diff) | |
download | rails-faad1e32a8ab81890018ba89d191607778830cf0.tar.gz rails-faad1e32a8ab81890018ba89d191607778830cf0.tar.bz2 rails-faad1e32a8ab81890018ba89d191607778830cf0.zip |
Fix discrepancies with loading rails/init.rb from gems. [#324 state:resolved]
Diffstat (limited to 'railties/lib/rails/plugin.rb')
-rw-r--r-- | railties/lib/rails/plugin.rb | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb index a54ab85dbe..b8b2b57038 100644 --- a/railties/lib/rails/plugin.rb +++ b/railties/lib/rails/plugin.rb @@ -95,14 +95,14 @@ module Rails end def evaluate_init_rb(initializer) - if has_init_file? - silence_warnings do - # Allow plugins to reference the current configuration object - config = initializer.configuration - - eval(IO.read(init_path), binding, init_path) - end - end + if has_init_file? + silence_warnings do + # Allow plugins to reference the current configuration object + config = initializer.configuration + + eval(IO.read(init_path), binding, init_path) + end + end end end @@ -111,8 +111,9 @@ module Rails # to Dependencies.load_paths. class GemPlugin < Plugin # Initialize this plugin from a Gem::Specification. - def initialize(spec) - super(File.join(spec.full_gem_path)) + def initialize(spec, gem) + directory = (gem.frozen? && gem.unpacked_paths.first) || File.join(spec.full_gem_path) + super(directory) @name = spec.name end |