Method: FakeFS::Pathname#join
- Defined in:
- lib/fakefs/pathname.rb
#join(*args) ⇒ Object
Pathname#join joins pathnames.
path0.join(path1, ..., pathN) is the same as path0 + path1 + ... + pathN.
489 490 491 492 493 494 495 496 497 498 499 500 |
# File 'lib/fakefs/pathname.rb', line 489 def join(*args) args.unshift self result = args.pop result = Pathname.new(result) unless result.is_a?(Pathname) return result if result.absolute? args.reverse_each do |arg| arg = Pathname.new(arg) unless arg.is_a?(Pathname) result = arg + result return result if result.absolute? end result end |