Skip to content

Comments

resolve Ruby 4 warnings, closes #2008#2034

Open
ajwann wants to merge 1 commit intoopen-telemetry:mainfrom
ajwann:feature/clear-ruby-4-warnings
Open

resolve Ruby 4 warnings, closes #2008#2034
ajwann wants to merge 1 commit intoopen-telemetry:mainfrom
ajwann:feature/clear-ruby-4-warnings

Conversation

@ajwann
Copy link

@ajwann ajwann commented Feb 3, 2026

Hey @arielvalentin! I saw #2008 and thought it was a good opportunity for a first time contributor.

Here's a summary of changes:

  • Fixed Ruby-4 related warnings related to the following gems:
    • Ostruct:
      • Warning: warning: ostruct used to be loaded from the standard library, but is not part of the default gems since Ruby 4.0.0..
      • Resolution: added to the gem spec of any gem which relied on ostruct.
    • CGI:
      • Warning: warning: CGI library is removed from Ruby 4.0. Please use cgi/escape instead for CGI.escape and CGI.unescape features.
      • Resolution: confirmed we’re only using escape and unescape, changed require statement in several gems text_map_propagator.rb file from cgi to cgi/escape.
    • Logger:
      • Warning: warning: logger used to be loaded from the standard library, but is not part of the default gems since Ruby 4.0.0
      • Resolution: add logger to gemspec for several gems.
  • Tested with Ruby 4.0.1 and also with 3.3.5 for backwards compatibility

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 3, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: ajwann / name: Adam Wanninger (8db251b)


spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'opentelemetry-test-helpers'
spec.add_development_dependency 'ostruct'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not every gemspec needed the ostruct dependency added, but for the ones that did, I placed it in alphabetical order to keep things tidy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant