Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
# Rubinius alone succeeds where others fail. class String alias old_hash hash def hash self.downcase.old_hash end def eql?(other) self.hash == other.hash end end require 'test/unit' class TestCaseInsensitiveHashAccess < Test::Unit::TestCase def test_case_insensitivity h = {'a' => 1, 'B' => 'buzz'} assert_equal(1, h['A']) assert_equal('buzz', h['b']) end end
Pasted April 22, 200810:49PM EDT
by Christopher Shea (cms)
Embed