2010-01-23 21:30:17 +00:00
|
|
|
require 'rails/railtie/configuration'
|
|
|
|
|
|
|
|
module Rails
|
|
|
|
class Engine
|
|
|
|
class Configuration < ::Rails::Railtie::Configuration
|
|
|
|
attr_reader :root
|
2010-06-22 21:17:20 +00:00
|
|
|
attr_writer :eager_load_paths, :autoload_once_paths, :autoload_paths
|
2010-01-23 21:30:17 +00:00
|
|
|
|
|
|
|
def initialize(root=nil)
|
2010-03-04 23:06:25 +00:00
|
|
|
super()
|
2010-01-23 21:30:17 +00:00
|
|
|
@root = root
|
|
|
|
end
|
|
|
|
|
|
|
|
def paths
|
|
|
|
@paths ||= begin
|
|
|
|
paths = Rails::Paths::Root.new(@root)
|
|
|
|
paths.app "app", :eager_load => true, :glob => "*"
|
|
|
|
paths.app.controllers "app/controllers", :eager_load => true
|
2010-01-24 11:04:37 +00:00
|
|
|
paths.app.helpers "app/helpers", :eager_load => true
|
2010-01-25 00:06:12 +00:00
|
|
|
paths.app.models "app/models", :eager_load => true
|
2010-03-06 18:19:26 +00:00
|
|
|
paths.app.mailers "app/mailers", :eager_load => true
|
2010-04-05 10:30:59 +00:00
|
|
|
paths.app.views "app/views"
|
2010-06-20 23:46:24 +00:00
|
|
|
paths.lib "lib", :load_path => true
|
2010-01-23 21:30:17 +00:00
|
|
|
paths.lib.tasks "lib/tasks", :glob => "**/*.rake"
|
|
|
|
paths.config "config"
|
|
|
|
paths.config.initializers "config/initializers", :glob => "**/*.rb"
|
|
|
|
paths.config.locales "config/locales", :glob => "*.{rb,yml}"
|
|
|
|
paths.config.routes "config/routes.rb"
|
2010-03-04 01:36:08 +00:00
|
|
|
paths.public "public"
|
|
|
|
paths.public.javascripts "public/javascripts"
|
|
|
|
paths.public.stylesheets "public/stylesheets"
|
2010-01-23 21:30:17 +00:00
|
|
|
paths
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def root=(value)
|
|
|
|
@root = paths.path = Pathname.new(value).expand_path
|
|
|
|
end
|
|
|
|
|
|
|
|
def eager_load_paths
|
|
|
|
@eager_load_paths ||= paths.eager_load
|
|
|
|
end
|
|
|
|
|
2010-06-22 21:17:20 +00:00
|
|
|
def autoload_once_paths
|
2010-06-27 22:57:47 +00:00
|
|
|
@autoload_once_paths ||= paths.autoload_once
|
2010-01-23 21:30:17 +00:00
|
|
|
end
|
|
|
|
|
2010-06-22 21:17:20 +00:00
|
|
|
def autoload_paths
|
2010-06-27 22:57:47 +00:00
|
|
|
@autoload_paths ||= paths.autoload_paths
|
2010-01-23 21:30:17 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|