Closed danielmorrison closed 2 years ago
Thank you @danielmorrison :)
Out of curiosity, would it also work for you if this library didn't use bare string literals but used new string objects, i.e. String.new("literal data")
?
Out of curiosity, would it also work for you if this library didn't use bare string literals but used new string objects, i.e.
String.new("literal data")
?
It would. I tried to pick the least-invasive syntax to avoid any bike shedding.
When running in an environment that freezes string literals by default,
hybi.rb
raises exceptions as it modifies theformat = 'C2'
string (line 224).Adding the magic comment supports this use case without modifying behavior for anyone else. I added it to one spec too, so that running specs this way (
RUBYOPT="--enable=frozen-string-literal" rspec
) keeps them all passing.