Sha256: 3878e2e7ec5d2ffadb518800e6cbe9313aed2e97e36b7b8aaf7cd23d40d5ac70

Contents?: true

Size: 499 Bytes

Versions: 35

Compression:

Stored size: 499 Bytes

Contents

module Guard
  class Watcher
    class Pattern
      class SimplePath
        def initialize(string_or_pathname)
          @path = normalize(string_or_pathname)
        end

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

        protected

        def normalize(string_or_pathname)
          Pathname.new(string_or_pathname).cleanpath.to_s
        end
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 8 rubygems

Version Path
guard-2.19.1 lib/guard/watcher/pattern/simple_path.rb
guard-2.19.0 lib/guard/watcher/pattern/simple_path.rb
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/guard-2.18.1/lib/guard/watcher/pattern/simple_path.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/guard-2.18.1/lib/guard/watcher/pattern/simple_path.rb
guard-2.18.1 lib/guard/watcher/pattern/simple_path.rb
op_connect-0.1.2 vendor/bundle/ruby/3.1.0/gems/guard-2.18.0/lib/guard/watcher/pattern/simple_path.rb
guard-2.18.0 lib/guard/watcher/pattern/simple_path.rb
guard-2.17.0 lib/guard/watcher/pattern/simple_path.rb
qiita_org-0.1.35 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/watcher/pattern/simple_path.rb
qiita_org-0.1.34 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/watcher/pattern/simple_path.rb
qiita_org-0.1.33 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/watcher/pattern/simple_path.rb
qiita_org-0.1.32 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/watcher/pattern/simple_path.rb
qiita_org-0.1.31 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/watcher/pattern/simple_path.rb
qiita_org-0.1.30 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/watcher/pattern/simple_path.rb
qiita_org-0.1.29 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/watcher/pattern/simple_path.rb
qiita_org-0.1.28 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/watcher/pattern/simple_path.rb
qiita_org-0.1.27 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/watcher/pattern/simple_path.rb
qiita_org-0.1.26 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/watcher/pattern/simple_path.rb
qiita_org-0.1.25 gems/ruby/2.7.0/gems/guard-2.16.2/lib/guard/watcher/pattern/simple_path.rb
guard-2.16.2 lib/guard/watcher/pattern/simple_path.rb