class Arachni::Support::Glob

@author Tasos “Zapotek” Laskos <tasos.laskos@arachni-scanner.com>

Attributes

regexp[R]

Public Class Methods

new( glob ) click to toggle source
# File lib/arachni/support/glob.rb, line 22
def initialize( glob )
    @regexp = self.class.to_regexp( glob )
end
to_regexp( glob ) click to toggle source
# File lib/arachni/support/glob.rb, line 15
def self.to_regexp( glob )
    escaped = Regexp.escape( glob ).gsub( '\*', '.*?' )
    Regexp.new( "^#{escaped}$", Regexp::IGNORECASE )
end

Public Instance Methods

=~( str ) click to toggle source
# File lib/arachni/support/glob.rb, line 26
def =~( str )
    !!(str =~ @regexp)
end
Also aliased as: matches?
match?( str )
Alias for: matches?
matches?( str )
Also aliased as: match?
Alias for: =~