Created
June 20, 2012 16:28
-
-
Save blambeau/2960784 to your computer and use it in GitHub Desktop.
Path coercible
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
def source_text(arg) | |
case arg | |
when IO then arg.read | |
when Path then Path(arg).read | |
else | |
raise "Unable to find source text for `#{arg}`" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The first seems more accurate IMHO