From 224c8e6afb464a4b04621189963ec03d1d3487d0 Mon Sep 17 00:00:00 2001 From: Dmitriy Timokhin Date: Wed, 7 May 2008 17:43:12 +0400 Subject: 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. [#213 state:resolved] --- railties/lib/rails/plugin.rb | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb index 04f7e37a20..fdaec34c59 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 - [] + def init_path + File.join(directory, 'rails', 'init.rb') end end end \ No newline at end of file -- cgit v1.2.3