public
Fork of rails/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/jeremy/rails.git
Use config.controller_paths instead of pattern matching

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/stable@4749 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Nicholas Seckar (author)
Thu Aug 10 09:46:43 -0700 2006
commit  720f990472f206788227ee8d3fc7d9c91a4cfd6e
tree    fb43db023ba2ebad2556d7b09c6819a8dbf0c0bc
parent  94e1350667eb666eda63341b539d466e4b0efc3d
...
262
263
264
 
 
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
 
282
283
284
...
262
263
264
265
266
267
 
 
 
 
 
 
 
 
 
 
 
 
268
269
270
 
271
272
273
274
0
@@ -262,23 +262,13 @@ module ActionController
0
           nil
0
         end
0
         
0
+ attr_accessor :controller_paths
0
+
0
       protected
0
- def safe_load_paths #:nodoc:
0
- if defined?(RAILS_ROOT)
0
- $LOAD_PATH.select do |base|
0
- base = File.expand_path(base)
0
- extended_root = File.expand_path(RAILS_ROOT)
0
- # Exclude all paths that are not nested within app, lib, or components.
0
- base.match(/\A#{Regexp.escape(extended_root)}\/*(app|lib|components)\/[a-z]/) || base =~ %r{rails-[\d.]+/builtin}
0
- end
0
- else
0
- $LOAD_PATH
0
- end
0
- end
0
         
0
         def attempt_load(mod, const_name, path)
0
           has_dir = false
0
- safe_load_paths.each do |load_path|
0
+ controller_paths.each do |load_path|
0
             full_path = File.join(load_path, path)
0
             file_path = full_path + '.rb'
0
             if File.file?(file_path) # Found a .rb file? Load it up
...
236
237
238
 
239
240
241
...
236
237
238
239
240
241
242
0
@@ -236,6 +236,7 @@ module Rails
0
     # loading module used to lazily load controllers (Configuration#controller_paths).
0
     def initialize_routing
0
       return unless configuration.frameworks.include?(:action_controller)
0
+ ActionController::Routing::ControllerComponent.controller_paths = configuration.controller_paths
0
       ActionController::Routing::Routes.reload
0
     end
0
     

Comments

    No one has commented yet.