Returns all but the last component of the path.
Don’t chain this when the path is relative:
Path('.').dir # => #<Path .>
Use #parent instead. See File.dirname.
File.dirname
31 32 33
# File 'lib/path/parts.rb', line 31 def dir Path.new(File.dirname(@path)) end