Permalink
Browse files

Escape the file name (who knows when a "(" might appear in a filename!)

  • Loading branch information...
1 parent d8acaf2 commit 1c9de08734f5305f5cff560a192f7f58d3f3fc11 Yehuda Katz committed Feb 27, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/dependencies.rb
View
2 activesupport/lib/active_support/dependencies.rb
@@ -442,7 +442,7 @@ def load_missing_constant(from_mod, const_name)
qualified_name = qualified_name_for from_mod, const_name
path_suffix = qualified_name.underscore
- trace = caller.reject {|l| l =~ %r{#{__FILE__}}}
+ trace = caller.reject {|l| l =~ %r{#{Regexp.escape(__FILE__)}}}
name_error = NameError.new("uninitialized constant #{qualified_name}")
name_error.set_backtrace(trace)

0 comments on commit 1c9de08

Please sign in to comment.