-
-
Notifications
You must be signed in to change notification settings - Fork 1
Ruby implementation #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
7c49898
Initial files
luke-hill c6a0dba
Add hidden files
luke-hill 5f4a90b
Fix typo
luke-hill a988fd0
Add cucumber messages to runtime requirements and port over existing …
luke-hill 273e248
Add in spec files
luke-hill b6c0a15
Fix up all loading, relations and requirements
luke-hill 36e2a52
Alter error class for new API
luke-hill 8db670b
Alter all other tests to pass
luke-hill e3637f1
Auto-gen rubocop config;
luke-hill b096339
Add note about duplication of code
luke-hill c0637d8
Minor linting and starting to unpick redundant pieces of spec support
luke-hill ef56500
Lint / DRY up tests
luke-hill f0b2552
Linting for tests and 1 bug fix where test case started was firing pr…
luke-hill c900365
Add in legacy ns;
luke-hill f35fa9b
Ported over helpers from JS
luke-hill c3d7fe5
Initial implementation of initializer and update method
luke-hill 0a4c755
Remove un-needed placeholder
luke-hill 2b2b2d0
Regen the rubocop config;
luke-hill f780531
Remove all legacy query entities
luke-hill 47e4f14
Move query into correct NS and rename helpers
luke-hill 3e72470
Remove legacy tests
luke-hill b2b1c59
Fix readme
luke-hill 354aee3
Remove un-necessary items from package
luke-hill df0df56
Move Ruby query implementation into gem
mattwynne d238b78
Fix Ruby query packaging and test step lookup
mattwynne 18b10c8
Add Ruby CI and release workflow
mattwynne 367300f
Align Ruby gem version
mattwynne 4c70e37
Update Ruby lockfile version
mattwynne 004ccfa
Update changelog for Ruby implementation
mattwynne 0ff633e
Pin Ruby workflow actions
mattwynne 05cba61
Disable bundler cache in Ruby release workflow
mattwynne 7b446a7
Add RubyGems badge
mattwynne ca2efd2
Tidy Ruby query implementation
mattwynne e98f91f
Merge branch 'main' into feature/ruby_implementation
mattwynne 171185e
Update .github/workflows/test-ruby.yml
mattwynne 985d991
Bump gemspec to only use ruby 3.3+ and higher dev gems
luke-hill 92a4ed3
Target Ruby 3.3+
luke-hill 5d39812
Fix CI
luke-hill 648fa0c
Convert into new testing format for new query;
luke-hill 84e1560
Tidy up test iteration code to ensure we only select files that will …
luke-hill f385309
Add in more cck examples to be tested against
luke-hill 048184e
Remove gemfile.lock
luke-hill 0575da5
Nitpicks
mpkorstanje b6d01eb
Fix version
luke-hill 3e82877
Merge branch 'main' into feature/ruby_implementation
luke-hill 74ad722
Fix for old ruby
luke-hill 4f274cf
Fix requirements and rdoc
luke-hill 831859f
Fix up test code
luke-hill 1fcf781
Refactor out symbol refs to use verbose classes
luke-hill 53e4325
Fix required version of messages and improve handlers by utilising ne…
luke-hill 8f9af81
Tidy up line length and remove comments
luke-hill 6f79e9e
Add in some more simple lambdas to validate more of the queries
luke-hill 2023797
Fix findAll lambdas to return int
luke-hill 7fdde96
Fix findMeta to return name of implementation
luke-hill 7077a0d
Add in 2 new queries which also return simple counters;
luke-hill e04185b
Bump version requirements for messages
luke-hill 6dabc4b
Merge branch 'main' into feature/ruby_implementation
luke-hill be8521b
Add in missing message handlers for 2 message updates plus catchall f…
luke-hill File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| name: Release RubyGems | ||
|
|
||
| permissions: {} | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - release/* | ||
|
|
||
| jobs: | ||
| publish-rubygem: | ||
| name: Publish Ruby Gem | ||
| runs-on: ubuntu-latest | ||
| environment: Release | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 | ||
| with: | ||
| ruby-version: 4.0.5 | ||
| working-directory: ruby | ||
| - uses: rubygems/configure-rubygems-credentials@dc5a8d8553e6ee01fc26761a49e99e733d17954a # v2.1.0 | ||
| - uses: cucumber/action-publish-rubygem@4e79bb9aed597c835e8438f57c04d0996ab80d72 # v2.0.0 | ||
| with: | ||
| working-directory: ruby |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: test-ruby | ||
|
|
||
| permissions: {} | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - renovate/** | ||
| paths: | ||
| - ruby/** | ||
| - testdata/** | ||
| - .github/** | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - renovate/** | ||
| paths: | ||
| - ruby/** | ||
| - testdata/** | ||
| - .github/** | ||
|
|
||
| jobs: | ||
| test-ruby: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: true | ||
| matrix: | ||
| os: | ||
| - ubuntu-latest | ||
| ruby: ['3.3', '3.4', '4.0'] | ||
| include: | ||
| - os: macos-latest | ||
| ruby: '4.0' | ||
| - os: windows-latest | ||
| ruby: '4.0' | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: ruby/setup-ruby@6aaa311d81eba98ae12eaffbcb63296ace0efcde # v1.307.0 | ||
| with: | ||
| ruby-version: ${{ matrix.ruby }} | ||
| bundler-cache: true | ||
| working-directory: ruby | ||
| - run: bundle exec rspec | ||
| working-directory: ruby |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Gemfile.lock | ||
| *.gem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --require spec_helper | ||
| --color |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| inherit_from: .rubocop_todo.yml | ||
|
|
||
| plugins: | ||
| - rubocop-performance | ||
| - rubocop-rspec | ||
|
|
||
| inherit_mode: | ||
| merge: | ||
| - Exclude | ||
|
|
||
| AllCops: | ||
| TargetRubyVersion: 3.3 | ||
| NewCops: enable | ||
|
|
||
| # Stylistic preference for cucumber | ||
| Gemspec/DevelopmentDependencies: | ||
| Enabled: false | ||
|
|
||
| # Disabled on our repo's to enable polyglot-release | ||
| Gemspec/RequireMFA: | ||
| Enabled: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| # This configuration was generated by | ||
| # `rubocop --auto-gen-config` | ||
| # on 2025-09-05 19:34:38 UTC using RuboCop version 1.80.2. | ||
| # The point is for the user to remove these configuration records | ||
| # one by one as the offenses are removed from the code base. | ||
| # Note that changes in the inspected code, or installation of new | ||
| # versions of RuboCop, may require this file to be generated again. | ||
|
|
||
| # Offense count: 1 | ||
| # This cop supports safe autocorrection (--autocorrect). | ||
| # Configuration parameters: EnforcedStyle. | ||
| # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines | ||
| Layout/EmptyLinesAroundModuleBody: | ||
| Exclude: | ||
| - 'spec/support/runner_helper.rb' | ||
|
|
||
| # Offense count: 1 | ||
| # This cop supports safe autocorrection (--autocorrect). | ||
| # Configuration parameters: AllowInHeredoc. | ||
| Layout/TrailingWhitespace: | ||
| Exclude: | ||
| - 'spec/cucumber/query/legacy/step_definitions_by_test_step_spec.rb' | ||
|
|
||
| # Offense count: 8 | ||
| # Configuration parameters: AllowComments, AllowEmptyLambdas. | ||
| Lint/EmptyBlock: | ||
| Exclude: | ||
| - 'spec/cucumber/query/legacy/hook_by_test_step_spec.rb' | ||
| - 'spec/cucumber/query/legacy/step_definitions_by_test_step_spec.rb' | ||
|
|
||
| # Offense count: 8 | ||
| # This cop supports safe autocorrection (--autocorrect). | ||
| # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions. | ||
| # NotImplementedExceptions: NotImplementedError | ||
| Lint/UnusedMethodArgument: | ||
| Exclude: | ||
| - 'lib/cucumber/query/query.rb' | ||
|
|
||
| # Offense count: 4 | ||
| # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. | ||
| Metrics/AbcSize: | ||
| Max: 43 | ||
|
|
||
| # Offense count: 1 | ||
| # Configuration parameters: AllowedMethods, AllowedPatterns. | ||
| Metrics/CyclomaticComplexity: | ||
| Max: 14 | ||
|
|
||
| # Offense count: 2 | ||
| # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. | ||
| Metrics/ClassLength: | ||
| Max: 160 | ||
|
|
||
| # Offense count: 3 | ||
| # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. | ||
| Metrics/MethodLength: | ||
| Max: 24 | ||
|
|
||
| # Offense count: 1 | ||
| # Configuration parameters: AllowedMethods, AllowedPatterns. | ||
| Metrics/PerceivedComplexity: | ||
| Max: 14 | ||
|
|
||
| # Offense count: 8 | ||
| Performance/MethodObjectAsBlock: | ||
| Exclude: | ||
| - 'lib/cucumber/query/legacy/hook_by_test_step.rb' | ||
| - 'lib/cucumber/query/legacy/pickle_by_test.rb' | ||
| - 'lib/cucumber/query/legacy/pickle_step_by_test_step.rb' | ||
| - 'lib/cucumber/query/legacy/step_definitions_by_test_step.rb' | ||
| - 'lib/cucumber/query/legacy/test_case_started_by_test_case.rb' | ||
|
|
||
| # Offense count: 1 | ||
| # Configuration parameters: Prefixes, AllowedPatterns. | ||
| # Prefixes: when, with, without | ||
| RSpec/ContextWording: | ||
| Exclude: | ||
| - 'spec/cucumber/query/legacy/hook_by_test_step_spec.rb' | ||
|
|
||
| # Offense count: 1 | ||
| # Configuration parameters: CountAsOne. | ||
| RSpec/ExampleLength: | ||
| Max: 7 | ||
|
|
||
| # Offense count: 32 | ||
| # Configuration parameters: AssignmentOnly. | ||
| RSpec/InstanceVariable: | ||
| Exclude: | ||
| - 'spec/cucumber/query/legacy/hook_by_test_step_spec.rb' | ||
| - 'spec/cucumber/query/legacy/pickle_by_test_spec.rb' | ||
| - 'spec/cucumber/query/legacy/pickle_step_by_test_step_spec.rb' | ||
| - 'spec/cucumber/query/legacy/step_definitions_by_test_step_spec.rb' | ||
| - 'spec/cucumber/query/legacy/test_case_started_by_test_case_spec.rb' | ||
|
|
||
| # Offense count: 3 | ||
| RSpec/MultipleExpectations: | ||
| Max: 3 | ||
|
|
||
| # Offense count: 12 | ||
| # Configuration parameters: AllowedGroups. | ||
| RSpec/NestedGroups: | ||
| Max: 5 | ||
|
|
||
| # Offense count: 8 | ||
| # Configuration parameters: AllowedConstants. | ||
| Style/Documentation: | ||
| Exclude: | ||
| - 'lib/cucumber/query/helpers.rb' | ||
| - 'lib/cucumber/query/legacy/hook_by_test_step.rb' | ||
| - 'lib/cucumber/query/legacy/pickle_by_test.rb' | ||
| - 'lib/cucumber/query/legacy/pickle_step_by_test_step.rb' | ||
| - 'lib/cucumber/query/legacy/step_definitions_by_test_step.rb' | ||
| - 'lib/cucumber/query/legacy/test_case_started_by_test_case.rb' | ||
| - 'lib/cucumber/query/legacy/test_run_started.rb' | ||
| - 'lib/cucumber/query/query.rb' | ||
|
|
||
| # Offense count: 4 | ||
| # This cop supports unsafe autocorrection (--autocorrect-all). | ||
| # Configuration parameters: EnforcedStyle. | ||
| # SupportedStyles: always, always_true, never | ||
| Style/FrozenStringLiteralComment: | ||
| Exclude: | ||
| - 'lib/cucumber/query/helpers.rb' | ||
| - 'lib/cucumber/query/query.rb' | ||
| - 'spec/support/gherkin_helper.rb' | ||
| - 'spec/support/runner_helper.rb' | ||
|
|
||
| # Offense count: 8 | ||
| # This cop supports safe autocorrection (--autocorrect). | ||
| # Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings. | ||
| # URISchemes: http, https | ||
| Layout/LineLength: | ||
| Max: 198 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| source 'https://rubygems.org' | ||
|
|
||
| gemspec |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2020 Cucumber Ltd and contributors | ||
|
|
||
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 16.0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| Gem::Specification.new do |s| | ||
| s.name = 'cucumber-query' | ||
| s.version = File.read(File.expand_path('VERSION', __dir__)).strip | ||
| s.authors = ['Luke Hill'] | ||
| s.description = 'Cucumber Query - query messages' | ||
| s.summary = "#{s.name}-#{s.version}" | ||
| s.email = 'cukebot@cucumber.io' | ||
| s.homepage = 'https://github.com/cucumber/query' | ||
| s.platform = Gem::Platform::RUBY | ||
| s.license = 'MIT' | ||
| s.required_ruby_version = '>= 3.3' | ||
| s.required_rubygems_version = '>= 3.2.8' | ||
|
|
||
| s.metadata = { | ||
| 'bug_tracker_uri' => 'https://github.com/cucumber/query/issues', | ||
| 'changelog_uri' => 'https://github.com/cucumber/query/blob/main/CHANGELOG.md', | ||
| 'documentation_uri' => 'https://github.com/cucumber/query/blob/main/README.md', | ||
| 'mailing_list_uri' => 'https://groups.google.com/forum/#!forum/cukes', | ||
| 'source_code_uri' => 'https://github.com/cucumber/query/blob/main/ruby' | ||
| } | ||
|
|
||
| s.add_dependency 'cucumber-messages', '> 34', '< 36' | ||
|
|
||
| s.add_development_dependency 'rspec', '~> 3.13' | ||
| s.add_development_dependency 'rubocop', '~> 1.88.0' | ||
| s.add_development_dependency 'rubocop-performance', '~> 1.26.1' | ||
| s.add_development_dependency 'rubocop-rspec', '~> 3.10.2' | ||
|
|
||
| s.files = Dir['LICENSE', 'VERSION', 'lib/**/*'] | ||
| s.rdoc_options = ['--charset=UTF-8'] | ||
| s.require_path = 'lib' | ||
| end | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.