Skip to content

Instantly share code, notes, and snippets.

@kachick
Created June 6, 2013 12:20
Show Gist options
  • Save kachick/5721092 to your computer and use it in GitHub Desktop.
Save kachick/5721092 to your computer and use it in GitHub Desktop.
Pathname#start_with?
# I've written at this commit.
# https://github.com/KitaitiMakoto/pathname-common_prefix/commit/904420faed7f73a758a35eafa74151fd7724918f
class Pathname
def start_with?(other)
to_enum(:descend).include?(Pathname(other))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment