1 module ActionController
5 # This holds the global list of valid controller paths
6 attr_accessor :controller_paths
9 class ControllerComponent
12 def safe_load_paths #:nodoc:
13 if defined?(RAILS_ROOT)
14 paths = $LOAD_PATH.select do |base|
15 base = File.expand_path(base)
16 # Check that the path matches one of the allowed paths in controller_paths
17 base.match(/^#{ActionController::Routing.controller_paths.map { |p| File.expand_path(p) } * '|'}/)
19 Engines.log.debug "Engines safe_load_paths: #{paths.inspect}"