Skip to content

Commit

Permalink
Fix clash with ActiveSupport autoloader.
Browse files Browse the repository at this point in the history
For example, passing :message to ColorScheme#color should not cause message.rb to be loaded, and it certainly shouldn't bail when it finds Message instead of MESSAGE.
  • Loading branch information
chewi committed Aug 13, 2012
1 parent 465a4ea commit d78c8d9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/logging/color_scheme.rb
Expand Up @@ -203,9 +203,8 @@ def to_key( t )
# Return a normalized representation of a color setting.
#
def to_constant( v )
ColorScheme.const_get(v.to_s.upcase)
rescue NameError
return nil
v = v.to_s.upcase
ColorScheme.const_get(v) if ColorScheme.const_defined?(v)
end

# Embed in a String to clear all previous ANSI sequences. This *MUST* be
Expand Down

0 comments on commit d78c8d9

Please sign in to comment.