Class: Mustermann::Shell

Inherits:
Pattern show all
Defined in:
lib/mustermann/shell.rb

Overview

Matches strings that are identical to the pattern.

Examples:

Mustermann.new('/*.*', type: :shell) === '/bar' # => false

See Also:

Instance Method Summary collapse

Methods inherited from Pattern

#=~, #expand, #initialize, #match, #named_captures, #names, new, #params, supported?, supported_options, #to_s

Constructor Details

This class inherits a constructor from Mustermann::Pattern

Instance Method Details

#===(string) ⇒ Boolean

Returns Whether or not the pattern matches the given string.

Parameters:

  • string (String)

    The string to match against

Returns:

  • (Boolean)

    Whether or not the pattern matches the given string

See Also:



18
19
20
# File 'lib/mustermann/shell.rb', line 18

def ===(string)
  File.fnmatch? @string, unescape(string), FLAGS
end