aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/plugin.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-06-12 17:48:30 -0500
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-06-12 17:48:30 -0500
commitea3a7e1bb1efc8b3ca10c4163bc116f3d5e23af1 (patch)
treea3cce25be0c613a8e1444e1d0ff53aaed3497057 /railties/lib/rails/plugin.rb
parent556204abaf95f7c995576cb1358f13de406682ab (diff)
parentdd4181f47dc0f166eb5d3e47a4a0dc1594cc5669 (diff)
downloadrails-ea3a7e1bb1efc8b3ca10c4163bc116f3d5e23af1.tar.gz
rails-ea3a7e1bb1efc8b3ca10c4163bc116f3d5e23af1.tar.bz2
rails-ea3a7e1bb1efc8b3ca10c4163bc116f3d5e23af1.zip
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'railties/lib/rails/plugin.rb')
-rw-r--r--railties/lib/rails/plugin.rb10
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