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

Changeset 4748

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

Readable

Files:

Legend:

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

    r4747 r4748  
    220220        end 
    221221 
    222         def file_kinds(kind) 
    223           ((@file_kinds ||= [:components]) << kind).uniq! || @file_kinds 
    224         end         
    225          
    226222        def traverse_to_controller(segments, start_at = 0) 
    227223          mod = ::Object 
     
    233229            index += 1 
    234230             
    235             file_kinds :app 
    236231            mod_name = segment.camelize 
    237232            controller_name = "#{mod_name}Controller" 
     
    274269              base = File.expand_path(base) 
    275270              extended_root = File.expand_path(RAILS_ROOT) 
    276               base.match(/\A#{Regexp.escape(extended_root)}\/*(#{file_kinds(:lib) * '|'})\/[a-z]/) || base =~ %r{rails-[\d.]+/builtin} 
     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} 
    277273            end 
    278274          else