Sha256: 37bf3e8ac34cc872df75ebe91e613b54f67bf6ca9650c3a61bd678c9d9b0a5ea

Contents?: true

Size: 469 Bytes

Versions: 8

Compression:

Stored size: 469 Bytes

Contents

module Guard
  class Watcher
    class Pattern
      class Matcher
        def initialize(obj)
          @matcher = obj
        end

        def match(string_or_pathname)
          @matcher.match(normalized(string_or_pathname))
        end

        private

        def normalized(string_or_pathname)
          path = Pathname.new(string_or_pathname).cleanpath
          return path.to_s if @matcher.is_a?(Regexp)
          path
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 4 rubygems

Version Path
guard-2.14.2 lib/guard/watcher/pattern/matcher.rb
comiditaULL-0.1.1 vendor/bundle/ruby/2.3.0/gems/guard-2.14.1/lib/guard/watcher/pattern/matcher.rb
comidita_ull-0.1.1 vendor/bundle/ruby/2.3.0/gems/guard-2.14.1/lib/guard/watcher/pattern/matcher.rb
comidita_ull-0.1.0 vendor/bundle/ruby/2.3.0/gems/guard-2.14.1/lib/guard/watcher/pattern/matcher.rb
guard-2.14.1 lib/guard/watcher/pattern/matcher.rb
gameboard-3.1.0 vendor/bundle/ruby/2.3.0/gems/guard-2.14.0/lib/guard/watcher/pattern/matcher.rb
gameboard-3.0.0 vendor/bundle/ruby/2.3.0/gems/guard-2.14.0/lib/guard/watcher/pattern/matcher.rb
guard-2.14.0 lib/guard/watcher/pattern/matcher.rb