fix: openstruct broken unless explicit require of ostruct #155
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.
So as of the latest release of pact-ruby-cli, we had some errors reported
NameError - uninitialized constant Pactflow::Client::ProviderContracts::Publish::OpenStruct
pact-foundation/pact-ruby-cli#131
passing the following env var
-e RUBYOPT="-rostruct"
fixes it, temporarily for end users.
Interesting, re-running our CI today, with no code changes other than adding in ruby 3.3 to the matrix, resulted in the same test failures.
https://github.com/pact-foundation/pact_broker-client/actions/runs/9066772247/job/24910431506
across Ruby 2.7 - Ruby 3.3
I wondered if it was because there was a new release of Rubies, on 2024-04-23 but that was only for Ruby 3.0.x and upwards, where we see failures today on Ruby 2.7, which we did not see 3 months ago.
Explicitly requiring 'ostruct' has resolved the test failures, but hasn't aided in reducing my confusion as to how this has suddenly manifested!
edit: to further muddy the water, I was able to successfully run the tests on my mac with ruby 3.2.4 without these changes 😅 (it also passes after) 🤷🏾♂️