Permalink
Browse files

Readable

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/stable@4748 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent ce692cd commit 94e1350667eb666eda63341b539d466e4b0efc3d @seckar seckar committed Aug 10, 2006
Showing with 2 additions and 6 deletions.
  1. +2 −6 actionpack/lib/action_controller/routing.rb
@@ -219,10 +219,6 @@ def assign_controller(g, controller)
g.result :controller, expr, true
end
- def file_kinds(kind)
- ((@file_kinds ||= [:components]) << kind).uniq! || @file_kinds
- end
-
def traverse_to_controller(segments, start_at = 0)
mod = ::Object
length = segments.length
@@ -232,7 +228,6 @@ def traverse_to_controller(segments, start_at = 0)
return nil unless /\A[A-Za-z][A-Za-z\d_]*\Z/ =~ (segment = segments[index])
index += 1
- file_kinds :app
mod_name = segment.camelize
controller_name = "#{mod_name}Controller"
path_suffix = File.join(segments[start_at..(index - 1)])
@@ -273,7 +268,8 @@ def safe_load_paths #:nodoc:
$LOAD_PATH.select do |base|
base = File.expand_path(base)
extended_root = File.expand_path(RAILS_ROOT)
- base.match(/\A#{Regexp.escape(extended_root)}\/*(#{file_kinds(:lib) * '|'})\/[a-z]/) || base =~ %r{rails-[\d.]+/builtin}
+ # Exclude all paths that are not nested within app, lib, or components.
+ base.match(/\A#{Regexp.escape(extended_root)}\/*(app|lib|components)\/[a-z]/) || base =~ %r{rails-[\d.]+/builtin}
end
else
$LOAD_PATH

0 comments on commit 94e1350

Please sign in to comment.