Method: ShellHelpers::PathnameExt::Base#rel_path

Defined in:
lib/shell_helpers/pathname.rb

#rel_path(base: self.class.pwd, checkdir: false) ⇒ Object



221
222
223
224
225
226
227
# File 'lib/shell_helpers/pathname.rb', line 221

def rel_path(base: self.class.pwd, checkdir: false)
	base=base.dirname unless base.directory? if checkdir
	relative_path_from(base)
rescue ArgumentError => e
	warn "#{self}.relative_path_from(#{base}): #{e}"
	self
end