Skip to content

Instantly share code, notes, and snippets.

@skateinmars
Created April 24, 2013 23:13
Show Gist options
  • Select an option

  • Save skateinmars/5456363 to your computer and use it in GitHub Desktop.

Select an option

Save skateinmars/5456363 to your computer and use it in GitHub Desktop.

Revisions

  1. skateinmars created this gist Apr 24, 2013.
    10 changes: 10 additions & 0 deletions horrible.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    class String
    def new_compare(obj)
    send(:'old_=~', Regexp.new(obj))
    end

    alias_method :'old_=~', :'=~'
    alias_method :'=~', :'new_compare'
    end

    puts ("blah" =~ "blah") == 0