1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add experimental plugin support #2335

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2465 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2005-10-05 18:25:15 +00:00
parent d364164763
commit 7a854b5379
2 changed files with 28 additions and 1 deletions

View file

@ -1,5 +1,7 @@
*SVN*
* Add experimental plugin support #2335
* Removed all the scripts in script/* and replaced it with one generic portal: script/run
* Made Rakefile aware of new .js files in script.aculo.us [Thomas Fuchs]

View file

@ -33,6 +33,7 @@ module Rails
set_connection_adapters
require_frameworks
load_plugins
load_environment
initialize_database
@ -65,6 +66,26 @@ module Rails
configuration.frameworks.each { |framework| require(framework.to_s) }
end
def load_plugins
config = configuration
Dir.glob("#{configuration.plugins_path}/*") do |directory|
next if File.basename(directory)[0] == ?. || !File.directory?(directory)
if File.exist?("#{directory}/init.rb")
silence_warnings do
eval(IO.read("#{directory}/init.rb"), binding)
end
end
if File.directory?("#{directory}/lib")
$LOAD_PATH.unshift "#{directory}/lib"
end
end
$LOAD_PATH.uniq!
end
def load_environment
silence_warnings do
config = configuration
@ -177,6 +198,10 @@ module Rails
def environment_path
"#{RAILS_ROOT}/config/environments/#{environment}.rb"
end
def plugins_path
"#{RAILS_ROOT}/vendor/plugins"
end
def environment
::RAILS_ENV
@ -286,4 +311,4 @@ class OrderedOptions < Array # :nodoc:
self.each { |i| return i if i.first == key }
return false
end
end
end