diff options
author | Jacek Becela <jacek.becela@gmail.com> | 2008-05-28 21:30:44 +0200 |
---|---|---|
committer | rick <technoweenie@gmail.com> | 2008-06-08 13:05:45 -0400 |
commit | 86a042ddd9dba8f62e7328c7258a798aef73d57f (patch) | |
tree | bedcafcbc1a37ba1ea6d50956febf32bc2611d92 /railties/lib/rails | |
parent | b336ce9e062e4de0d20aa359b08e86fe83b6dd89 (diff) | |
download | rails-86a042ddd9dba8f62e7328c7258a798aef73d57f.tar.gz rails-86a042ddd9dba8f62e7328c7258a798aef73d57f.tar.bz2 rails-86a042ddd9dba8f62e7328c7258a798aef73d57f.zip |
Make plugins initialize also from rails/init.rb to ensure consistency with gems used as plugins
[#272 state:resolved]
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/plugin.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb index 256f4b0132..a54ab85dbe 100644 --- a/railties/lib/rails/plugin.rb +++ b/railties/lib/rails/plugin.rb @@ -74,10 +74,18 @@ module Rails File.join(directory, 'lib') end - def init_path + def classic_init_path File.join(directory, 'init.rb') end + def gem_init_path + File.join(directory, 'rails', 'init.rb') + end + + def init_path + File.file?(gem_init_path) ? gem_init_path : classic_init_path + end + def has_lib_directory? File.directory?(lib_path) end |