Skip to content
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

Remove runtime dependency on base64 #1046

Merged
merged 1 commit into from
Feb 4, 2024

Conversation

Earlopain
Copy link
Contributor

Ruby 3.3 shows a warning when using base64 without declaring it in the gemspec. Ruby 3.4 will remove base64 as a default gem.

Since this gem is only using a single method in one place there is no need to pull in the full dependency. It is only a wrapper over Array#pack.

Alternative to #1041

Other gems have taken the same/similar approach:

Ruby 3.3 shows a warning when using base64 without declaring it in the gemspec.
Ruby 3.4 will remove base64 as a default gem.
@mattbrictson
Copy link
Contributor

As of 2 weeks ago, it looks like Ruby head has now removed the default base64 gem entirely. So projects that use webmock fail with this exception:

/home/runner/.rubies/ruby-head/lib/ruby/3.4.0+0/bundled_gems.rb:74:in `require': cannot load such file -- base64 (LoadError)

A workaround exists: any project using webmock also has to add base64 to their Gemfile. Still, it would be nice to see this PR merged. Thanks! 🙏

@bblimke
Copy link
Owner

bblimke commented Feb 4, 2024

@Earlopain thank you for providing this solution. I appreciate the simplicity! 👍 It's great to have a solution that doesn't require adding another dependency to the gemspec.

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.

3 participants