Skip to content

Instantly share code, notes, and snippets.

@aereal
Created June 4, 2010 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aereal/425357 to your computer and use it in GitHub Desktop.
Save aereal/425357 to your computer and use it in GitHub Desktop.
module Enumerable
def like?(val, op = :===)
any? {|i| i.__send__(op, val) }
end
end
ignore_pattern = [/\.$/, /\.(?:svn|git)$/]
ignore_pattern.include?('..') # => false
ignore_pattern.like?('..') # => true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment