class MyPath::Handler::CWD

Public Class Methods

can_handle?(path) click to toggle source
# File lib/mypath/handler/cwd.rb, line 4
def self.can_handle?(path)
  parts = path.split("/")
  !Dir[*parts].empty?
end

Public Instance Methods

local_path() click to toggle source
# File lib/mypath/handler/cwd.rb, line 9
def local_path
  parts = path.split("/")
  rejoined = []
  parts.each_with_index do |part, index|
    rejoined << parts[index..-1].join("/")
  end
  local = Dir[*rejoined].first
end