Skip to content

Instantly share code, notes, and snippets.

@stouset
Created January 11, 2012 23:54
Show Gist options
  • Save stouset/1597554 to your computer and use it in GitHub Desktop.
Save stouset/1597554 to your computer and use it in GitHub Desktop.
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