class Guard::Watcher::Pattern::SimplePath

Public Class Methods

new(string_or_pathname) click to toggle source
# File lib/guard/watcher/pattern/simple_path.rb, line 5
def initialize(string_or_pathname)
  @path = normalize(string_or_pathname)
end

Public Instance Methods

match(string_or_pathname) click to toggle source
# 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

Protected Instance Methods

normalize(string_or_pathname) click to toggle source
# File lib/guard/watcher/pattern/simple_path.rb, line 17
def normalize(string_or_pathname)
  Pathname.new(string_or_pathname).cleanpath.to_s
end