glob-0.4.1/0000755000004100000410000000000014577274730012507 5ustar www-datawww-dataglob-0.4.1/glob.gemspec0000644000004100000410000000316514577274730015004 0ustar www-datawww-data# frozen_string_literal: true require_relative "lib/glob/version" Gem::Specification.new do |spec| spec.name = "glob" spec.version = Glob::VERSION spec.authors = ["Nando Vieira"] spec.email = ["me@fnando.com"] spec.summary = "Create a list of hash paths that match a given " \ "pattern. You can also generate a hash with only the " \ "matching paths." spec.description = spec.summary spec.license = "MIT" spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0") spec.metadata["rubygems_mfa_required"] = "true" github_url = "https://github.com/fnando/glob" github_tree_url = "#{github_url}/tree/v#{spec.version}" spec.homepage = github_url spec.metadata["homepage_uri"] = spec.homepage spec.metadata["bug_tracker_uri"] = "#{github_url}/issues" spec.metadata["source_code_uri"] = github_tree_url spec.metadata["changelog_uri"] = "#{github_tree_url}/CHANGELOG.md" spec.metadata["documentation_uri"] = "#{github_tree_url}/README.md" spec.metadata["license_uri"] = "#{github_tree_url}/LICENSE.md" spec.files = Dir.chdir(File.expand_path(__dir__)) do `git ls-files -z`.split("\x0") end spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) {|f| File.basename(f) } spec.require_paths = ["lib"] spec.add_development_dependency "minitest" spec.add_development_dependency "minitest-utils" spec.add_development_dependency "pry-meta" spec.add_development_dependency "rake" spec.add_development_dependency "rubocop" spec.add_development_dependency "rubocop-fnando" spec.add_development_dependency "simplecov" end glob-0.4.1/bin/0000755000004100000410000000000014577274730013257 5ustar www-datawww-dataglob-0.4.1/bin/setup0000755000004100000410000000020514577274730014342 0ustar www-datawww-data#!/usr/bin/env bash set -euo pipefail IFS=$'\n\t' set -vx bundle install # Do any other automated setup that you need to do here glob-0.4.1/bin/console0000755000004100000410000000052114577274730014645 0ustar www-datawww-data#!/usr/bin/env ruby # frozen_string_literal: true require "bundler/setup" require "glob" # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. begin require "pry" Pry.start rescue LoadError require "irb" IRB.start(__FILE__) end glob-0.4.1/.gitignore0000644000004100000410000000012614577274730014476 0ustar www-datawww-data/.bundle/ /.yardoc /_yardoc/ /coverage/ /doc/ /pkg/ /spec/reports/ /tmp/ Gemfile.lock glob-0.4.1/CONTRIBUTING.md0000644000004100000410000000634514577274730014750 0ustar www-datawww-data# Contributing to glob 👍🎉 First off, thanks for taking the time to contribute! 🎉👍 The following is a set of guidelines for contributing to this project. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. ## Code of Conduct Everyone interacting in this project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/fnando/glob/blob/main/CODE_OF_CONDUCT.md). ## Reporting bugs This section guides you through submitting a bug report. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports. - Before creating bug reports, please check the open issues; somebody may already have submitted something similar, and you may not need to create a new one. - When you are creating a bug report, please include as many details as possible, with an example reproducing the issue. ## Contributing with code Before making any radicals changes, please make sure you discuss your intention by [opening an issue on Github](https://github.com/fnando/glob/issues). When you're ready to make your pull request, follow checklist below to make sure your contribution is according to how this project works. 1. [Fork](https://help.github.com/forking/) glob 2. Create a topic branch - `git checkout -b my_branch` 3. Make your changes using [descriptive commit messages](#commit-messages) 4. Update CHANGELOG.md describing your changes by adding an entry to the "Unreleased" section. If this section is not available, create one right before the last version. 5. Push to your branch - `git push origin my_branch` 6. [Create a pull request](https://help.github.com/articles/creating-a-pull-request) 7. That's it! ## Styleguides ### Commit messages - Use the present tense ("Add feature" not "Added feature") - Use the imperative mood ("Move cursor to..." not "Moves cursor to...") - Limit the first line to 72 characters or less - Reference issues and pull requests liberally after the first line ### Changelog - Add a message describing your changes to the "Unreleased" section. The changelog message should follow the same style as the commit message. - Prefix your message with one of the following: - `[Added]` for new features. - `[Changed]` for changes in existing functionality. - `[Deprecated]` for soon-to-be removed features. - `[Removed]` for now removed features. - `[Fixed]` for any bug fixes. - `[Security]` in case of vulnerabilities. ### Ruby code - This project uses [Rubocop](https://rubocop.org) to enforce code style. Before submitting your changes, make sure your tests are passing and code conforms to the expected style by running `rake`. - Do not change the library version. This will be done by the maintainer whenever a new version is about to be released. ### JavaScript code - This project uses [ESLint](https://eslint.org) to enforce code style. Before submitting your changes, make sure your tests are passing and code conforms to the expected style by running `yarn test:ci`. - Do not change the library version. This will be done by the maintainer whenever a new version is about to be released. glob-0.4.1/.github/0000755000004100000410000000000014577274730014047 5ustar www-datawww-dataglob-0.4.1/.github/dependabot.yml0000644000004100000410000000051714577274730016702 0ustar www-datawww-data--- # Documentation: # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "daily" - package-ecosystem: "bundler" directory: "/" schedule: interval: "daily" glob-0.4.1/.github/PULL_REQUEST_TEMPLATE.md0000644000004100000410000000173114577274730017652 0ustar www-datawww-data
PR Checklist ### PR Structure - [ ] This PR has reasonably narrow scope (if not, break it down into smaller PRs). - [ ] This PR avoids mixing refactoring changes with feature changes (split into two PRs otherwise). - [ ] This PR's title starts is concise and descriptive. ### Thoroughness - [ ] This PR adds tests for the most critical parts of the new functionality or fixes. - [ ] I've updated any docs, `.md` files, etc… affected by this change.
### What [TODO: Short statement about what is changing.] ### Why [TODO: Why this change is being made. Include any context required to understand the why.] ### Known limitations [TODO or N/A] glob-0.4.1/.github/CODEOWNERS0000644000004100000410000000022214577274730015436 0ustar www-datawww-data# You can read more about CODEOWNERS at # https://help.github.com/github/creating-cloning-and-archiving-repositories/about-code-owners * @fnando glob-0.4.1/.github/workflows/0000755000004100000410000000000014577274730016104 5ustar www-datawww-dataglob-0.4.1/.github/workflows/ruby-tests.yml0000644000004100000410000000230414577274730020747 0ustar www-datawww-data--- name: ruby-tests on: pull_request_target: push: branches: - main workflow_dispatch: inputs: {} jobs: build: name: Tests with Ruby ${{ matrix.ruby }} and ${{ matrix.gemfile }} runs-on: "ubuntu-latest" if: | github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target' || github.actor != 'dependabot[bot]' strategy: fail-fast: false matrix: ruby: ["3.0", "3.1", "3.2", "3.3"] gemfile: - Gemfile steps: - uses: actions/checkout@v4 - uses: actions/cache@v3 with: path: vendor/bundle key: > ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ hashFiles(matrix.gemfile) }} - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - name: Install gem dependencies env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} run: | gem install bundler bundle config path vendor/bundle bundle update --jobs 4 --retry 3 - name: Run Tests env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} run: | bundle exec rake glob-0.4.1/.github/ISSUE_TEMPLATE/0000755000004100000410000000000014577274730016232 5ustar www-datawww-dataglob-0.4.1/.github/ISSUE_TEMPLATE/bug_report.md0000644000004100000410000000135214577274730020725 0ustar www-datawww-data--- name: "🐛 Bug Report" about: Report a reproducible bug or regression. title: 'Bug: ' labels: 'Status: Unconfirmed' --- ## Description [Add bug description here] ## How to reproduce [Add steps on how to reproduce this issue] ## What do you expect [Describe what do you expect to happen] ## What happened instead [Describe the actual results] ## Software: - Gem version: [Add gem version here] - Ruby version: [Add version here] ## Full backtrace ```text [Paste full backtrace here] ``` glob-0.4.1/.github/ISSUE_TEMPLATE/feature_request.md0000644000004100000410000000104214577274730021754 0ustar www-datawww-data--- name: "💡 Feature request" about: Have an idea that may be useful? Make a suggestion! title: 'Feature Request: ' labels: 'Feature request' --- ## Description _A clear and concise description of what the problem is._ ## Describe the solution _A clear and concise description of what you want to happen._ ## Alternatives you considered _A clear and concise description of any alternative solutions or features you've considered._ ## Additional context _Add any other context, screenshots, links, etc about the feature request here._ glob-0.4.1/.github/FUNDING.yml0000644000004100000410000000015714577274730015667 0ustar www-datawww-data# These are supported funding model platforms github: [fnando] custom: ["https://paypal.me/nandovieira/🍕"] glob-0.4.1/lib/0000755000004100000410000000000014577274730013255 5ustar www-datawww-dataglob-0.4.1/lib/glob/0000755000004100000410000000000014577274730014200 5ustar www-datawww-dataglob-0.4.1/lib/glob/matcher.rb0000644000004100000410000000131014577274730016143 0ustar www-datawww-data# frozen_string_literal: true module Glob class Matcher attr_reader :path, :regex def initialize(path) @path = path @reject = path.start_with?("!") pattern = Regexp.escape(path.gsub(/^!/, "")) .gsub(/(\\{.*?\\})/) {|match| process_group(match) } .gsub("\\*", "[^.]+") anchor = path.end_with?("*") ? "" : "$" @regex = Regexp.new("^#{pattern}#{anchor}") end def match?(other) other.match?(regex) end def include? !reject? end def reject? @reject end def process_group(group) group = group.gsub(/[{}\\]/, "").split(",").join("|") "(#{group})" end end end glob-0.4.1/lib/glob/object.rb0000644000004100000410000000310714577274730015774 0ustar www-datawww-data# frozen_string_literal: true module Glob class Object PATH_SPLIT_RE = /(? {"b" => 1}, 42 => "the answer"} expected = {a: {b: 1}, "42": "the answer"} actual = Glob::SymbolizeKeys.call(input) assert_equal expected, actual end test "symbolizes arrays" do input = [{"a" => {"b" => [1, 2, 3]}}] expected = [{a: {b: [1, 2, 3]}}] actual = Glob::SymbolizeKeys.call(input) assert_equal expected, actual end end glob-0.4.1/test/test_helper.rb0000644000004100000410000000035214577274730016331 0ustar www-datawww-data# frozen_string_literal: true require "simplecov" SimpleCov.start require "bundler/setup" require "glob" require "minitest/utils" require "minitest/autorun" Dir["#{__dir__}/support/**/*.rb"].sort.each do |file| require file end glob-0.4.1/test/glob_test.rb0000644000004100000410000001420714577274730016001 0ustar www-datawww-data# frozen_string_literal: true require "test_helper" class GlobTest < Minitest::Test test "with partial matching" do glob = Glob.new( en: {editor: "editor", edit: "edit"}, pt: {editor: "editor", edit: "edit"} ) glob << "*.edit" assert_equal ["en.edit", "pt.edit"], glob.paths end test "with rejecting filter" do glob = Glob.new( en: { messages: { hello: "Hello!", bye: "Bye!" } }, pt: { messages: { hello: "Olá!", bye: "Tchau!" } } ) glob << "*.messages.*" glob << "!*.messages.bye" expected = { en: { messages: { hello: "Hello!" } }, pt: { messages: { hello: "Olá!" } } } assert_equal ["en.messages.hello", "pt.messages.hello"], glob.paths assert_equal expected, glob.to_h assert_equal expected, glob.to_hash end test "with overlapping filters" do glob = Glob.new( en: { messages: { hello: "Hello!", bye: "Bye!" } }, pt: { messages: { hello: "Olá!", bye: "Tchau!" } } ) glob << "*.messages.*" glob << "!*.messages.bye" glob << "en.messages.bye" expected = { en: { messages: { bye: "Bye!", hello: "Hello!" } }, pt: { messages: { hello: "Olá!" } } } assert_equal [ "en.messages.bye", "en.messages.hello", "pt.messages.hello" ], glob.paths assert_equal expected, glob.to_h assert_equal expected, glob.to_hash end test "with last component as star" do glob = Glob.new( user: {name: "USER", email: "EMAIL"}, repo: {name: "REPO"} ) expected = {user: {name: "USER", email: "EMAIL"}} glob << "user.*" assert_equal ["user.email", "user.name"], glob.paths assert_equal expected, glob.to_hash end test "with star as the initial component" do glob = Glob.new( user: {name: "USER", email: "EMAIL"}, repo: {name: "REPO"} ) expected = {user: {name: "USER"}, repo: {name: "REPO"}} glob << "*.name" assert_equal ["repo.name", "user.name"], glob.paths assert_equal expected, glob.to_hash end test "with star as the middle component" do glob = Glob.new( config: { user: {name: "USER", email: "EMAIL"}, site: {name: "SITE", host: "HOST"} } ) expected = {config: {user: {name: "USER"}, site: {name: "SITE"}}} glob << "config.*.name" assert_equal ["config.site.name", "config.user.name"], glob.paths assert_equal expected, glob.to_hash end test "with just a star" do expected = { config: { user: {name: "USER", email: "EMAIL"}, site: {name: "SITE", host: "HOST"} } } glob = Glob.new(expected) glob << "*" assert_equal [ "config.site.host", "config.site.name", "config.user.email", "config.user.name" ], glob.paths assert_equal expected, glob.to_hash end test "with mixed stars" do glob = Glob.new( config: { user: {name: "USER", email: "EMAIL"}, site: {name: "SITE", host: "HOST"} } ) glob << "*.site.*" expected = { config: { site: {name: "SITE", host: "HOST"} } } assert_equal [ "config.site.host", "config.site.name" ], glob.paths assert_equal expected, glob.to_hash end test "filter includes everything by default" do data = { config: { user: {name: "USER", email: "EMAIL"}, site: {name: "SITE", host: "HOST"} } } actual = Glob.filter(data) assert_equal data, actual end test "filter using specified filters" do data = { config: { user: {name: "USER", email: "EMAIL"}, site: {name: "SITE", host: "HOST"} } } expected = {config: {user: {name: "USER"}}} actual = Glob.filter(data, ["config.user.name"]) assert_equal expected, actual end test "using groups as root key" do glob = Glob.new( pt: {hello: "Olá!"}, en: {hello: "Hello!"}, es: {hello: "¡Hola!"} ) glob << "{pt,en}.*" assert_equal ["en.hello", "pt.hello"], glob.paths end test "using groups in mixed positions" do glob = Glob.new( pt: {messages: {hello: "Olá!", goodbye: "Tchau!"}}, en: {messages: {hello: "Hello!", goodbye: "Goodbye!"}}, es: {messages: {hello: "¡Hola!", goodbye: "¡Adios!"}} ) glob << "{pt,en}.messages.{hello,goodbye}" expected = [ "en.messages.goodbye", "en.messages.hello", "pt.messages.goodbye", "pt.messages.hello" ] assert_equal expected, glob.paths end test "with keys that contain dots" do data = { "keys.with.dots" => "dots", node: { "more.keys.with.dots" => "more dots" } } glob = Glob.new(data) glob << "*" assert_equal %w[keys\\.with\\.dots node.more\\.keys\\.with\\.dots], glob.paths assert_equal Glob::SymbolizeKeys.call(data), glob.to_h assert_equal ({node: {"more.keys.with.dots": "more dots"}}), Glob.filter(data, ["node.more\\.keys\\.with\\.dots"]) end test "sorts set when setting new keys" do data = {d: "d", a: "a", b: "b"} glob = Glob.new(data) glob << "*" assert_equal({a: "a", b: "b", d: "d"}, glob.to_h) glob.set("c", "c") glob.set("e.b1.b2.b3", "e---b") glob.set("e.a1.a2.a3", "e---a") expected = { a: "a", b: "b", c: "c", d: "d", e: {a1: {a2: {a3: "e---a"}}, b1: {b2: {b3: "e---b"}}} } assert_equal(expected, glob.to_h) assert_equal ["a", "b", "c", "d", "e.a1.a2.a3", "e.b1.b2.b3"], glob.paths end test "replaces existing node when setting a new path" do glob = Glob.new(a: 1, b: {b1: {b2: 2}}) glob << "*" glob.set("a.a1.a2", 4) glob.set("b.b1.b2.b3", {b4: 5}) expected = { a: {a1: {a2: 4}}, b: {b1: {b2: {b3: {b4: 5}}}} } assert_equal expected, glob.to_h assert_equal ["a.a1.a2", "b.b1.b2.b3.b4"], glob.paths end end glob-0.4.1/Rakefile0000644000004100000410000000044014577274730014152 0ustar www-datawww-data# frozen_string_literal: true require "bundler/gem_tasks" require "rake/testtask" require "rubocop/rake_task" Rake::TestTask.new(:test) do |t| t.libs << "test" t.libs << "lib" t.test_files = FileList["test/**/*_test.rb"] end RuboCop::RakeTask.new task default: %i[test rubocop] glob-0.4.1/CODE_OF_CONDUCT.md0000644000004100000410000000623014577274730015307 0ustar www-datawww-data# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at me@fnando.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version] [homepage]: https://contributor-covenant.org [version]: https://contributor-covenant.org/version/1/4/ glob-0.4.1/LICENSE.md0000644000004100000410000000207114577274730014113 0ustar www-datawww-data# The MIT License (MIT) Copyright (c) 2020 Nando Vieira Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. glob-0.4.1/Gemfile0000644000004100000410000000010614577274730013777 0ustar www-datawww-data# frozen_string_literal: true source "https://rubygems.org" gemspec glob-0.4.1/README.md0000644000004100000410000000645714577274730014002 0ustar www-datawww-data# glob [![Tests](https://github.com/fnando/glob/workflows/ruby-tests/badge.svg)](https://github.com/fnando/glob) [![Code Climate](https://codeclimate.com/github/fnando/glob/badges/gpa.svg)](https://codeclimate.com/github/fnando/glob) [![Gem](https://img.shields.io/gem/v/glob.svg)](https://rubygems.org/gems/glob) [![Gem](https://img.shields.io/gem/dt/glob.svg)](https://rubygems.org/gems/glob) Create a list of hash paths that match a given pattern. You can also generate a hash with only the matching paths. ## Installation ```bash gem install glob ``` Or add the following line to your project's Gemfile: ```ruby gem "glob" ``` ## Usage There are two types of paths: `include` and `exclude`. - The `include` path adds that node to the new hash. - The `exclude` path is the one started by `!`, and will prevent that path from being added. Rules may also have groups. Let's say you want to target `en.*` and `pt.*`; you case set `{en,pt}.*` rather than having two separate rules. The latest rules have more precedence; that means that if you have the rule `*.messages.*`, then add a following rule as `!*.messages.bye`, all `*.messages.*` but `*.messages.bye` will be included. ```ruby glob = Glob.new( site: { settings: { name: "Site name", url: "https://example.com" } }, user: { settings: { name: "User name" } } ) glob << "*.settings.*" glob.paths #=> ["site.settings.name", "site.settings.url", "user.settings.name"] glob.to_h #=> { #=> site: { #=> settings: { #=> name: "Site name" #=> } #=> }, #=> user: { #=> settings: { #=> name: "User name" #=> } #=> } #=> } ``` Notice that the return result will have symbolized keys. If the key contain dots, then the result will use `\\.` as the escape sequence. Similarly, you need to escape keys with dots when filtering results. ```ruby glob = Glob.new( formats: { ".txt" => "Text", ".json" => "JSON", ".rb" => "Ruby" } ) glob << "*" glob.paths #=> ["formats.\\.json", "formats.\\.rb", "formats.\\.txt"] glob.to_h #=> {:formats=>{:".json"=>"JSON", :".rb"=>"Ruby", :".txt"=>"Text"}} # Remove all existing matchers glob.matchers.clear glob << "formats.\\.rb" glob.paths #=> ["formats.\\.rb"] glob.to_h #=> {:formats=>{:".rb"=>"Ruby"}} ``` You can set new keys by using `.set(path, value)`: ```ruby glob = Glob.new glob << "*" glob.set "a.b.c", "hello" glob.to_h #=> {:a=>{:b=>{:c=>"hello"}}} glob.paths #=> ["a.b.c"] # The non-hash value will be replaced in case the new path overlaps it glob.set "a.b.c.d.e", "hello" glob.to_h #=> {:a=>{:b=>{:c=>{:d=>{:e=>"hello"}}}}} glob.paths #=> ["a.b.c.d.e"] ``` ## Maintainer - [Nando Vieira](https://github.com/fnando) ## Contributors - https://github.com/fnando/glob/contributors ## Contributing For more details about how to contribute, please read https://github.com/fnando/glob/blob/main/CONTRIBUTING.md. ## License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). A copy of the license can be found at https://github.com/fnando/glob/blob/main/LICENSE.md. ## Code of Conduct Everyone interacting in the glob project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/fnando/glob/blob/main/CODE_OF_CONDUCT.md). glob-0.4.1/.rubocop.yml0000644000004100000410000000022614577274730014761 0ustar www-datawww-data--- inherit_gem: rubocop-fnando: .rubocop.yml AllCops: TargetRubyVersion: 2.7 NewCops: enable Exclude: - vendor/**/* - gemfiles/**/* glob-0.4.1/CHANGELOG.md0000644000004100000410000000171614577274730014325 0ustar www-datawww-data# Changelog ## v0.4.1 - 2024-01-03 - [Fixed] Fix partial matching when not using `*`. ## v0.4.0 - 2022-12-05 - [Changed] `Glob::Query` has been renamed to `Glob::Object`. - [Added] Allow adding new keys with `glob.set(path, value)`. ## v0.3.1 - 2022-09-01 - [Fixed] Handle keys with dots properly by using `\\.` as a escape sequence. ## v0.3.0 - 2022-08-01 - [Added] Patterns can have groups like in `{a,b}.*`. ## v0.2.2 - 2022-02-01 - [Fixed] Properly handle numeric keys. ## v0.2.1 - 2022-01-13 - [Changed] .gem package now include tests files. ## v0.2.0 - [Added] Allow rejecting patterns like `!*.activerecord`. - [Changed] New API. ## v0.1.0 - Initial release