Class: Guard::Watcher::Pattern::SimplePath

Inherits:
Object
  • Object
show all
Defined in:
lib/guard/watcher/pattern/simple_path.rb

Direct Known Subclasses

PathnamePath

Instance Method Summary collapse

Constructor Details

#initialize(string_or_pathname) ⇒ SimplePath

Returns a new instance of SimplePath.



5
6
7
# File 'lib/guard/watcher/pattern/simple_path.rb', line 5

def initialize(string_or_pathname)
  @path = normalize(string_or_pathname)
end

Instance Method Details

#match(string_or_pathname) ⇒ Object



9
10
11
12
13
# File 'lib/guard/watcher/pattern/simple_path.rb', line 9

def match(string_or_pathname)
  cleaned = normalize(string_or_pathname)
  return nil unless @path == cleaned
  [cleaned]
end