2008-07-12 14:17:14 +04:00
|
|
|
begin
|
|
|
|
require 'rails/version'
|
2009-02-21 14:04:50 +03:00
|
|
|
unless Rails::VERSION::MAJOR >= 2 && Rails::VERSION::MINOR >= 2 && Rails::VERSION::TINY >= 0
|
|
|
|
raise "This version of the engines plugin requires Rails 2.2.0 or later!"
|
2008-07-12 14:17:14 +04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
require File.join(File.dirname(__FILE__), 'lib/engines')
|
|
|
|
|
|
|
|
# initialize Rails::Configuration with our own default values to spare users
|
|
|
|
# some hassle with the installation and keep the environment cleaner
|
|
|
|
|
|
|
|
{ :default_plugin_locators => [Engines::Plugin::FileSystemLocator],
|
|
|
|
:default_plugin_loader => Engines::Plugin::Loader,
|
|
|
|
:default_plugins => [:engines, :all] }.each do |name, default|
|
|
|
|
Rails::Configuration.send(:define_method, name) { default }
|
|
|
|
end
|