From 21de164f8a3e501f9c66336e6e9f10e23daa43b3 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 21 Mar 2009 04:14:22 -0700 Subject: Convert LoadError extension modules to class reopens --- activesupport/lib/active_support/core_ext/load_error.rb | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/activesupport/lib/active_support/core_ext/load_error.rb b/activesupport/lib/active_support/core_ext/load_error.rb index 6165e95443..f36a21818f 100644 --- a/activesupport/lib/active_support/core_ext/load_error.rb +++ b/activesupport/lib/active_support/core_ext/load_error.rb @@ -24,15 +24,12 @@ class MissingSourceFile < LoadError #:nodoc: ] unless defined?(REGEXPS) end -module ActiveSupport #:nodoc: - module CoreExtensions #:nodoc: - module LoadErrorExtensions #:nodoc: - module LoadErrorClassMethods #:nodoc: - def new(*args) - (self == LoadError && MissingSourceFile.from_message(args.first)) || super - end - end - ::LoadError.extend(LoadErrorClassMethods) +class LoadError + def self.new(*args) + if self == LoadError + MissingSourceFile.from_message(args.first) + else + super end end end -- cgit v1.2.3