Commit 38b0819
committed
Fix Ruby 3.4 frozen string literal warnings with StringIO
PR #123 fixed frozen string warnings on line 127 (buffer creation)
but missed the warnings triggered by calling binmode/set_encoding on
StringIO objects at lines 120-121.
These methods modify StringIO's internal string encoding, which
triggers Ruby 3.4 deprecation warnings when running with verbose
warnings (-W2), which Rails test suites use by default.
Skip these calls for StringIO objects since marcel's byte-reading
operations work correctly without the encoding modification, as
demonstrated by all 384 tests passing.
This maintains the existing defensive respond_to? checks for File objects.1 parent 3d3c5dc commit 38b0819
2 files changed
+27
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
119 | 124 | | |
120 | | - | |
121 | | - | |
122 | 125 | | |
123 | 126 | | |
124 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
28 | 49 | | |
0 commit comments