Created
January 11, 2012 23:54
-
-
Save stouset/1597554 to your computer and use it in GitHub Desktop.
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
def join(*args) | |
args.unshift self | |
result = args.pop | |
result = Pathname.new(result) unless Pathname === result | |
return result if result.absolute? | |
args.reverse_each {|arg| | |
arg = Pathname.new(arg) unless Pathname === arg | |
result = arg + result | |
return result if result.absolute? | |
} | |
result | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment