Extract the name of the missing constant from the exception message.
# File lib/active_support/core_ext/name_error.rb, line 3 3: def missing_name 4: if /undefined local variable or method/ !~ message 5: $1 if /((::)?([A-Z]\w*)(::[A-Z]\w*)*)$/ =~ message 6: end 7: end
Was this exception raised because the given name was missing?
# File lib/active_support/core_ext/name_error.rb, line 10
10: def missing_name?(name)
11: if name.is_a? Symbol
12: last_name = (missing_name || '').split('::').last
13: last_name == name.to_s
14: else
15: missing_name == name.to_s
16: end
17: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.