{"id":15033195,"url":"https://github.com/highb/pathspec-ruby","last_synced_at":"2026-01-17T17:46:06.188Z","repository":{"id":423929,"uuid":"21711620","full_name":"highb/pathspec-ruby","owner":"highb","description":"Match Path Specifications, such as .gitignore, in Ruby!","archived":false,"fork":false,"pushed_at":"2026-01-13T06:34:17.000Z","size":159,"stargazers_count":24,"open_issues_count":3,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-13T09:43:37.377Z","etag":null,"topics":["gitignore","regex","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/highb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-07-10T21:51:39.000Z","updated_at":"2025-11-20T21:34:39.000Z","dependencies_parsed_at":"2024-04-10T01:35:13.638Z","dependency_job_id":"b1cf2ced-65bd-4069-80ca-a6736f9bd6de","html_url":"https://github.com/highb/pathspec-ruby","commit_stats":{"total_commits":130,"total_committers":13,"mean_commits":10.0,"dds":0.6692307692307693,"last_synced_commit":"5d3daab4bced0bb45c9cb593b6935dfc510bca38"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/highb/pathspec-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highb%2Fpathspec-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highb%2Fpathspec-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highb%2Fpathspec-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highb%2Fpathspec-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/highb","download_url":"https://codeload.github.com/highb/pathspec-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highb%2Fpathspec-ruby/sbom","scorecard":{"id":464403,"data":{"date":"2025-08-11","repo":{"name":"github.com/highb/pathspec-ruby","commit":"ed1437d66b09ea8c7e13443fa109cf4d4e123008"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 1/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gem-push.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/highb/pathspec-ruby/gem-push.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/gem-push.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/highb/pathspec-ruby/gem-push.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ruby.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/highb/pathspec-ruby/ruby.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ruby.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/highb/pathspec-ruby/ruby.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ruby.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/highb/pathspec-ruby/ruby.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ruby.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/highb/pathspec-ruby/ruby.yml/master?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/gem-push.yml:14","Warn: no topLevel permission defined: .github/workflows/gem-push.yml:1","Warn: no topLevel permission defined: .github/workflows/ruby.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 1.1.3 not signed: https://api.github.com/repos/highb/pathspec-ruby/releases/58292726","Warn: release artifact 1.1.1 not signed: https://api.github.com/repos/highb/pathspec-ruby/releases/58291429","Warn: release artifact 1.0.0 not signed: https://api.github.com/repos/highb/pathspec-ruby/releases/35977196","Warn: release artifact 1.1.3 does not have provenance: https://api.github.com/repos/highb/pathspec-ruby/releases/58292726","Warn: release artifact 1.1.1 does not have provenance: https://api.github.com/repos/highb/pathspec-ruby/releases/58291429","Warn: release artifact 1.0.0 does not have provenance: https://api.github.com/repos/highb/pathspec-ruby/releases/35977196"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T12:05:00.957Z","repository_id":423929,"created_at":"2025-08-19T12:05:00.957Z","updated_at":"2025-08-19T12:05:00.957Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28513975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gitignore","regex","ruby"],"created_at":"2024-09-24T20:20:21.456Z","updated_at":"2026-01-17T17:46:06.178Z","avatar_url":"https://github.com/highb.png","language":"Ruby","readme":"# pathspec-ruby\n\n[![Gem Version](https://badge.fury.io/rb/pathspec.svg)](https://badge.fury.io/rb/pathspec) [![Ruby](https://github.com/highb/pathspec-ruby/actions/workflows/ruby.yml/badge.svg)](https://github.com/highb/pathspec-ruby/actions/workflows/ruby.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/4f3b5917e01fb34f790d/maintainability)](https://codeclimate.com/github/highb/pathspec-ruby/maintainability)\n\n[man Page as HTML](http://highb.github.io/pathspec-ruby/)\n\n[Supported Rubies](https://www.ruby-lang.org/en/downloads/):\n\n- 3.2 (Stable, Tested)\n- 3.3 (Stable, Tested)\n- 3.4 (Stable, Tested)\n- 4.0.1 (Preview, Tested)\n\n## Deprecated Rubies\n\nThe following Ruby versions are no longer supported. If you need to use an older Ruby version, please use an earlier version of this gem:\n\n- Ruby 3.1: Deprecated in version 3.0.0 (current project, not yet released)\n- Ruby 3.0: Deprecated in version 2.0.0 (January 2024)\n- Ruby 2.x (2.6-2.7): Deprecated in version 2.0.0 (January 2024)\n- Ruby 2.5 and earlier: Deprecated in version 1.0.0 (January 2021)\n- Ruby 1.8 and 1.9: Deprecated in version 0.2.0 (circa 2017)\n\nMatch Path Specifications, such as .gitignore, in Ruby!\n\nFollows .gitignore syntax defined on [gitscm](http://git-scm.com/docs/gitignore)\n\n.gitignore functionality ported from [Python pathspec](https://pypi.python.org/pypi/pathspec/0.2.2) by [@cpburnz](https://github.com/cpburnz/python-path-specification)\n\n## Build/Install from Rubygems\n\n```shell\ngem install pathspec\n```\n\n## CLI Usage\n\n```bash\n➜ cat .gitignore\n*.swp\n/coverage/\n➜ bundle exec pathspec-rb specs_match \"coverage/foo\"\n/coverage/\n➜ bundle exec pathspec-rb specs_match \"file.swp\"\n*.swp\n➜ bundle exec pathspec-rb match \"file.swp\"\n➜ echo $?\n0\n➜ ls\nGemfile      Gemfile.lock coverage     file.swp     source.rb\n➜ bundle exec pathspec-rb tree .\n./coverage\n./coverage/index.html\n./file.swp\n```\n\n## Usage\n\n```ruby\nrequire 'pathspec'\n\n# Create a .gitignore-style Pathspec by giving it newline separated gitignore\n# lines, an array of gitignore lines, or any other enumable object that will\n# give strings matching the .gitignore-style (File, etc.)\ngitignore = PathSpec.from_filename('spec/files/gitignore_readme')\n\n# Our .gitignore in this example contains:\n# !**/important.txt\n# abc/**\n\n# true, matches \"abc/**\"\ngitignore.match 'abc/def.rb'\n# CLI equivalent: pathspec.rb -f spec/files/gitignore_readme match 'abc/def.rb'\n\n# false, because it has been negated using the line \"!**/important.txt\"\ngitignore.match 'abc/important.txt'\n# CLI equivalent: pathspec.rb -f spec/files/gitignore_readme match 'abc/important.txt'\n\n# Give a path somewhere in the filesystem, and the Pathspec will return all\n# matching files underneath.\n# Returns ['/src/repo/abc/', '/src/repo/abc/123']\ngitignore.match_tree '/src/repo'\n# CLI equivalent: pathspec.rb -f spec/files/gitignore_readme tree /src/repo\n\n# Give an enumerable of paths, and Pathspec will return the ones that match.\n# Returns ['/abc/123', '/abc/']\ngitignore.match_paths ['/abc/123', '/abc/important.txt', '/abc/']\n# There is no CLI equivalent to this.\n```\n\n## Example Usage in Gemspec\n\n```\nlib = File.expand_path(\"lib\", __dir__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"gemspec_pathspec_test/version\"\nrequire 'pathspec'\n\nGem::Specification.new do |spec|\n  spec.name          = \"gemspec_pathspec_test\"\n  spec.version       = GemspecPathspecTest::VERSION\n  spec.authors       = [\"Brandon High\"]\n  spec.email         = [\"highb@users.noreply.github.com\"]\n\n  spec.summary = \"whatever\"\n\n  spec.metadata[\"allowed_push_host\"] = \"TODO: Set to 'http://mygemserver.com'\"\n\n  ps = PathSpec.from_filename('.gitignore')\n  spec.files         = Dir['lib/*.rb'].reject { |f| ps.match(f) }\n  spec.bindir        = \"exe\"\n  spec.executables   = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }\n  spec.require_paths = [\"lib\"]\n\n  spec.add_development_dependency \"bundler\", \"~\u003e 2.0\"\n  spec.add_development_dependency \"rake\", \"~\u003e 10.0\"\n  spec.add_development_dependency \"rspec\", \"~\u003e 3.0\"\nend\n```\n\n## Building/Installing from Source\n\n```shell\ngit clone git@github.com:highb/pathspec-ruby.git\ncd pathspec-ruby \u0026\u0026 bash ./build_from_source.sh\n```\n\n## Development Setup\n\nThis project uses [mise](https://mise.jdx.dev/) for managing Ruby and bundler versions.\n\n### Install mise\n\n```shell\n# macOS\nbrew install mise\n\n# Other platforms: https://mise.jdx.dev/getting-started.html\n```\n\n### Activate mise\n\nAdd to your shell profile (`~/.zshrc`, `~/.bashrc`, etc.):\n\n```shell\neval \"$(mise activate zsh)\"  # or bash, fish, etc.\n```\n\n### Install Dependencies\n\n```shell\n# Install Ruby and bundler versions defined in .tool-versions\nmise install\n\n# Install gem dependencies\nmise run install\n# or: bundle install\n```\n\n### Development Tasks\n\n```shell\n# Run all tests (rubocop, unit tests, integration tests, docs)\nmise run test\n# or: bundle exec rake\n\n# Run only unit tests\nmise run test:unit\n# or: bundle exec rake spec\n\n# Run only integration tests\nmise run test:integration\n# or: bundle exec rake spec_integration\n\n# Run all specs (unit + integration)\nmise run test:all\n# or: bundle exec rake spec_all\n\n# Run tests across all Ruby versions (3.2, 3.3, 3.4, 4.0.1) using Docker\nmise run test:matrix\n# or: bundle exec rake test_matrix\n\n# Build the gem\nmise run build\n# or: gem build pathspec.gemspec\n```\n\nThe `test:matrix` task runs the full test suite across all supported Ruby versions in Docker containers, matching the CI environment. Integration tests cover the CLI executable (`bin/pathspec-rb`).\n\n## Contributing\n\nPull requests, bug reports, and feature requests welcome! :smile: I've tried to write exhaustive tests but who knows what cases I've missed.\n\n## Releasing\n\nThis is mainly a reminder to myself but the release process is:\n1. Make sure CI is passing\n2. Update the CHANGELOG with relevant changes to Gem consumers\n3. Update version in gemspec with correct SemVer bump for scope of changes\n4. Tag/release using GitHub UI and the Build \u0026 Push workflow should do the rest.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhighb%2Fpathspec-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhighb%2Fpathspec-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhighb%2Fpathspec-ruby/lists"}