erubi 1.13.0 → 1.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/Rakefile +1 -1
- data/lib/erubi.rb +15 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 547aa741f72fd87ac7747c597614f457b3880d01d3b3aa161c24e62c93f00cc7
|
4
|
+
data.tar.gz: d465d4b57e9abe24de9cf5859773691dfee9198ca0c4d05a5ca8f0903b2acefd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 109432844ed8df5daab8e5b6e6aa2404c314009f968129ec02c920f6c75094f4a484207751d34cb2255d6c3d5f286e14c369ba54dc398e06266d22e84e2f4e24
|
7
|
+
data.tar.gz: 5eab140a49714dd65c67b9eb7e196a86f25c9a3a59348b04dc3d7b57db8c0cbccbca28f94dae2ae69c04382e5ab6c4350c7f8dd99db2dbbd0121ba0759bd0ca1
|
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -42,7 +42,7 @@ end
|
|
42
42
|
|
43
43
|
spec = proc do |env|
|
44
44
|
env.each{|k,v| ENV[k] = v}
|
45
|
-
sh "#{FileUtils::RUBY} #{'-w' if RUBY_VERSION >= '3'} test/test.rb"
|
45
|
+
sh "#{FileUtils::RUBY} #{'-w' if RUBY_VERSION >= '3'} #{'-W:strict_unused_block' if RUBY_VERSION >= '3.4'} test/test.rb"
|
46
46
|
env.each{|k,v| ENV.delete(k)}
|
47
47
|
end
|
48
48
|
|
data/lib/erubi.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Erubi
|
4
|
-
VERSION = '1.13.
|
4
|
+
VERSION = '1.13.1'
|
5
5
|
|
6
6
|
# :nocov:
|
7
7
|
if RUBY_VERSION >= '1.9'
|
@@ -205,16 +205,25 @@ module Erubi
|
|
205
205
|
|
206
206
|
private
|
207
207
|
|
208
|
+
if RUBY_VERSION >= '2.3'
|
209
|
+
def _dup_string_if_frozen(string)
|
210
|
+
+string
|
211
|
+
end
|
212
|
+
# :nocov:
|
213
|
+
else
|
214
|
+
def _dup_string_if_frozen(string)
|
215
|
+
string.frozen? ? string.dup : string
|
216
|
+
end
|
217
|
+
end
|
218
|
+
# :nocov:
|
219
|
+
|
208
220
|
# Add raw text to the template. Modifies argument if argument is mutable as a memory optimization.
|
209
221
|
# Must be called with a string, cannot be called with nil (Rails's subclass depends on it).
|
210
222
|
def add_text(text)
|
211
223
|
return if text.empty?
|
212
224
|
|
213
|
-
|
214
|
-
|
215
|
-
else
|
216
|
-
text.gsub!(/['\\]/, '\\\\\&')
|
217
|
-
end
|
225
|
+
text = _dup_string_if_frozen(text)
|
226
|
+
text.gsub!(/['\\]/, '\\\\\&')
|
218
227
|
|
219
228
|
with_buffer{@src << " << '" << text << @text_end}
|
220
229
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erubi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.13.
|
4
|
+
version: 1.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Evans
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-12-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
87
|
requirements: []
|
88
|
-
rubygems_version: 3.5.
|
88
|
+
rubygems_version: 3.5.22
|
89
89
|
signing_key:
|
90
90
|
specification_version: 4
|
91
91
|
summary: Small ERB Implementation
|