ruby3-backward-compatibility 1.5.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/README.md +6 -1
- data/lib/ruby3_backward_compatibility/compatibility/erb.rb +20 -0
- data/lib/ruby3_backward_compatibility/version.rb +1 -1
- metadata +3 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 99e016f667fe875a4ee28e52d02fbacc029bbf1b4cd90f2779643057a80489c4
|
|
4
|
+
data.tar.gz: 6a8817e47418e7790613d8feeae7f57b8f371c3fc4264931f79b23ca98c8eafb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8c24e4cb277bd6ecaca7531b49adfd139fd7ec9af8b96208b1458b1501bf12cd3acc45cf7b9ae4b90ff23d55f619ab5ab2973a0833d0ea860aeb2549d61f5e4b
|
|
7
|
+
data.tar.gz: 13e9d000313664cf9aee7cfef4a903b31fe834909c46b63c789d7282d3afc7487d07d55e4f4ca0f3fca036f9b4695617bfd9d04953204234c809d5da52ed9f55
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.6.0] - 2026-08-21
|
|
4
|
+
|
|
5
|
+
- `ERB#src` gives back a mutable string again. Newer erb 6 releases freeze the
|
|
6
|
+
compiled source, which breaks callers that modify it in place, for example tilt 1.x
|
|
7
|
+
force_encodings it.
|
|
8
|
+
|
|
3
9
|
## [1.5.1] - 2026-01-13
|
|
4
10
|
|
|
5
11
|
- Ruby 4: Gem will no longer refuse to load.
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -105,7 +105,12 @@ but this was changed to
|
|
|
105
105
|
ERB.new(string, safe_level: nil, trim_mode: nil, eoutvar: '_erbout')
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
|
|
109
|
+
Additionally, ERB#src used to return a mutable string, which
|
|
110
|
+
some consumer might rely on. New ERB versions return frozen strings.
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
To fix both these issues,
|
|
109
114
|
|
|
110
115
|
```
|
|
111
116
|
require 'ruby3_backward_compatibility/compatibility/erb'
|
|
@@ -11,6 +11,26 @@ module Ruby3BackwardCompatibility
|
|
|
11
11
|
end
|
|
12
12
|
super(str, trim_mode: trim_mode, eoutvar: eoutvar)
|
|
13
13
|
end
|
|
14
|
+
|
|
15
|
+
# Newer erb 6 releases freeze the compiled source that #src returns. Every
|
|
16
|
+
# earlier erb handed back a mutable string, and callers written against those
|
|
17
|
+
# are free to modify it in place, e.g. tilt 1.x.
|
|
18
|
+
def src
|
|
19
|
+
original = super
|
|
20
|
+
return original unless original.frozen?
|
|
21
|
+
|
|
22
|
+
# A frozen ERB cannot hold the memo, and raising FrozenError here would be
|
|
23
|
+
# a regression: erb itself is happy to return #src from a frozen template,
|
|
24
|
+
# and Ractor.make_shareable deep-freezes, so anything sharing a compiled
|
|
25
|
+
# template across Ractors would break.
|
|
26
|
+
return original.dup if frozen?
|
|
27
|
+
|
|
28
|
+
unless @_ruby3_backward_compatibility_src_of.equal?(original)
|
|
29
|
+
@_ruby3_backward_compatibility_src_of = original
|
|
30
|
+
@_ruby3_backward_compatibility_src = original.dup
|
|
31
|
+
end
|
|
32
|
+
@_ruby3_backward_compatibility_src
|
|
33
|
+
end
|
|
14
34
|
end
|
|
15
35
|
end
|
|
16
36
|
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby3-backward-compatibility
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tobias Kraze
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: byebug
|
|
@@ -24,7 +23,6 @@ dependencies:
|
|
|
24
23
|
- - ">="
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
25
|
version: '0'
|
|
27
|
-
description:
|
|
28
26
|
email:
|
|
29
27
|
- tobias.kraze@makandra.de
|
|
30
28
|
executables: []
|
|
@@ -65,7 +63,6 @@ metadata:
|
|
|
65
63
|
homepage_uri: https://github.com/makandra/ruby3-backward-compatibility
|
|
66
64
|
source_code_uri: https://github.com/makandra/ruby3-backward-compatibility
|
|
67
65
|
changelog_uri: https://github.com/makandra/ruby3-backward-compatibility/blob/main/CHANGELOG.md
|
|
68
|
-
post_install_message:
|
|
69
66
|
rdoc_options: []
|
|
70
67
|
require_paths:
|
|
71
68
|
- lib
|
|
@@ -80,8 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
80
77
|
- !ruby/object:Gem::Version
|
|
81
78
|
version: '0'
|
|
82
79
|
requirements: []
|
|
83
|
-
rubygems_version: 3.
|
|
84
|
-
signing_key:
|
|
80
|
+
rubygems_version: 3.6.9
|
|
85
81
|
specification_version: 4
|
|
86
82
|
summary: Backward compatibility for Ruby 3 stdlib
|
|
87
83
|
test_files: []
|