barby
barby copied to clipboard
Fix 'warning: literal string will be frozen in the future' introduced by ruby 3.4
Ruby 3.4 #20205 feature makes the barby gem output warnings when used, such as:
/path/to/barby/lib/barby/barcode/qr_code.rb:56: warning: literal string will be frozen in the future (run with --debug-frozen-string-literal for more information)
/path/to/barby/lib/barby/barcode/qr_code.rb:56: warning: literal string will be frozen in the future (run with --debug-frozen-string-literal for more information)
This PR is an attempt to fix the problem by:
- using .freeze on constants
- rewriting some inject calls
- and using pragma frozen_string_literal: false elsewhere
Note: I ran the test suite with ruby 3.4, and remove all warnings of this type. This PR does NOT tackle other warnings introduced by Ruby 3.4
Hi @toretore 👋🏻 Any chance you could please review and release this change? This includes the single line change from #122 so that one can be closed once this is merged.
hi @toretore, we would also very much like this fixed and released :) +1 on the request from me.
Is there anything I can assist you with to get this done? Happy to spend a bit of my time if wanted.