Skip to content

Instantly share code, notes, and snippets.

@mojavelinux
Last active January 23, 2020 08:36
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mojavelinux/6ee34b77281a384a45b5bad5f165bf88 to your computer and use it in GitHub Desktop.
File.absolute_path?
class File
class << self
def absolute_path? path
(path.start_with? '/') || (ALT_SEPARATOR && (path.start_with? (absolute_path path).slice 0, 3))
end unless method_defined? :absolute_path?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment