Sha256: 47f3c2918a7a32eb77787dc965af9ff69d9d6d1a4b72fca268f59e96252e9c6f
Contents?: true
Size: 484 Bytes
Versions: 34
Compression:
Stored size: 484 Bytes
Contents
module Cuboid module Support # @author Tasos "Zapotek" Laskos <tasos.laskos@gmail.com> class Glob def self.to_regexp( glob ) escaped = Regexp.escape( glob ).gsub( '\*', '.*?' ) Regexp.new( "^#{escaped}$", Regexp::IGNORECASE ) end attr_reader :regexp def initialize( glob ) @regexp = self.class.to_regexp( glob ) end def =~( str ) @regexp.match? str end alias :matches? :=~ alias :match? :matches? end end end
Version data entries
34 entries across 34 versions & 1 rubygems