Created
December 7, 2015 03:01
-
-
Save suer/022e9c42f3f06b056d7f to your computer and use it in GitHub Desktop.
Dark patch for Errbit
This file contains 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
class NilClass | |
def match(pattern) | |
"".match(pattern) | |
end | |
end | |
class File | |
class << self | |
def dirname_with_nullable(filename) | |
return dirname_without_nullable(filename) if filename | |
"" | |
end | |
alias_method_chain :dirname, :nullable | |
def basename_with_nullable(filename, suffix = "") | |
return basename_without_nullable(filename, suffix) if filename | |
"" | |
end | |
alias_method_chain :basename, :nullable | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment