module Nab::Util

Public Class Methods

path_from_uri(uri,strip_dirs=false) click to toggle source
# File lib/nab/util.rb, line 3
def self.path_from_uri(uri,strip_dirs=false)
  if strip_dirs
    File.basename(uri.path.gsub(/^\//, ""))
  else
    uri.path.gsub(/^\//, "") # remove leading slashes
  end
end