Method: String#relative_path_from
- Defined in:
- lib/extlib/string.rb
#relative_path_from(other) ⇒ String
Calculate a relative path from other.
"/opt/local/lib".relative_path_from("/opt/local/lib/ruby/site_ruby") # => "../.."
107 108 109 |
# File 'lib/extlib/string.rb', line 107 def relative_path_from(other) Pathname.new(self).relative_path_from(Pathname.new(other)).to_s end |