A class for encapsulating file types - type checking is quite common in
many triggers so it’s nice to have it available to all.
Provide a regexp that the filetype must match and a message for the types
that match the regexp. i.e.
FileType.new( /u?binary/, "binary/ubinary" )
# File P4Triggers.rb, line 109
def initialize( regexp, message )
@re = regexp
@msg = message
end
Test to see if the given filetype matches this type using the regexp.
# File P4Triggers.rb, line 118
def match( type )
@re.match( type )
end