From c98cd2272db790c4b7bbc3ef2707fb1fc3ef909d Mon Sep 17 00:00:00 2001 From: Dmitriy Timokhin Date: Wed, 7 May 2008 17:43:12 +0400 Subject: [PATCH] Expose GemPlugin load_paths so they can be added to Dependencies.load_paths. Also use full_gem_path as root of GemPlugin to make things compatible. --- railties/lib/rails/plugin.rb | 18 +++++++----------- 1 files changed, 7 insertions(+), 11 deletions(-) diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb index 04f7e37..5f90640 100644 --- a/railties/lib/rails/plugin.rb +++ b/railties/lib/rails/plugin.rb @@ -98,23 +98,19 @@ module Rails end end - # This Plugin subclass represents a Gem plugin. It behaves exactly like a - # "traditional" Rails plugin, but doesn't expose any additional load paths, - # since RubyGems has already taken care of things. + # This Plugin subclass represents a Gem plugin. Although RubyGems has already + # taken care of $LOAD_PATH's, it have to expose its load_path's to add them + # to Dependencies.load_paths. class GemPlugin < Plugin # Initialize this plugin from a Gem::Specification. def initialize(spec) - super(File.join(spec.full_gem_path, "rails")) + super(File.join(spec.full_gem_path)) @name = spec.name end - def valid? - true - end - - def load_paths - [] - end + def init_path + File.join(directory, 'rails', 'init.rb') + end end end \ No newline at end of file -- 1.5.5.1