Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 4749

Show
Ignore:
Timestamp:
08/10/06 16:46:43 (2 years ago)
Author:
ulysses
Message:

Use config.controller_paths instead of pattern matching

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/stable/actionpack/lib/action_controller/routing.rb

    r4748 r4749  
    263263        end 
    264264         
     265        attr_accessor :controller_paths 
     266         
    265267      protected 
    266         def safe_load_paths #:nodoc: 
    267           if defined?(RAILS_ROOT) 
    268             $LOAD_PATH.select do |base| 
    269               base = File.expand_path(base) 
    270               extended_root = File.expand_path(RAILS_ROOT) 
    271               # Exclude all paths that are not nested within app, lib, or components. 
    272               base.match(/\A#{Regexp.escape(extended_root)}\/*(app|lib|components)\/[a-z]/) || base =~ %r{rails-[\d.]+/builtin} 
    273             end 
    274           else 
    275             $LOAD_PATH 
    276           end 
    277         end 
    278268         
    279269        def attempt_load(mod, const_name, path) 
    280270          has_dir = false 
    281           safe_load_paths.each do |load_path| 
     271          controller_paths.each do |load_path| 
    282272            full_path = File.join(load_path, path) 
    283273            file_path = full_path + '.rb' 
  • branches/stable/railties/lib/initializer.rb

    r3982 r4749  
    237237    def initialize_routing 
    238238      return unless configuration.frameworks.include?(:action_controller) 
     239      ActionController::Routing::ControllerComponent.controller_paths = configuration.controller_paths 
    239240      ActionController::Routing::Routes.reload 
    240241    end