Created
March 2, 2014 01:14
-
-
Save agrimm/9300399 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simplified version of the bug LiteralInCondition detected in my code | |
def parse_string(string) | |
case | |
when string =~ /foo/ then foo | |
when string =~ /bar/ then bar | |
when ["a", "b", "c"].include?(string) then baz | |
# goto fail. Go directly to fail. Do not pass go, do not collect $200. | |
when /something_else/ then something_else | |
else fail | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment