]> projects.mako.cc - selectricity-live/blob - vendor/plugins/engines/lib/engines/routing_extensions.rb
00f6b6387f955fa2efb45a7d4f22e959b5b04699
[selectricity-live] / vendor / plugins / engines / lib / engines / routing_extensions.rb
1 module ActionController
2   module Routing
3     
4     class << self
5       # This holds the global list of valid controller paths
6       attr_accessor :controller_paths
7     end
8     
9     class ControllerComponent
10       class << self
11       protected
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) } * '|'}/)
18             end
19             Engines.log.debug "Engines safe_load_paths: #{paths.inspect}"
20             paths
21           else
22             $LOAD_PATH
23           end
24         end        
25       end
26     end
27   end
28 end

Benjamin Mako Hill || Want to submit a patch?