erb 5.1.3-java → 6.0.0-java
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/.github/workflows/push-gem.yml +3 -2
- data/.github/workflows/test.yml +1 -1
- data/NEWS.md +5 -0
- data/lib/erb/compiler.rb +0 -1
- data/lib/erb/util.rb +3 -2
- data/lib/erb/version.rb +1 -1
- data/lib/erb.rb +4 -49
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ba1b9709ae5687dafc656b4b7cfc3321310b6861160c17fa670cd3c6469fa9d1
|
|
4
|
+
data.tar.gz: cb34212a548f3b1ea10ca1f07ed21f53729fd35cc9171799db67d558c857c4d0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 397d22d7c008018e40c489bb4bb7bbaf4c765457534c07f580b7b86d7f279a2aee3ed510c5df5dca9b35d403e7feb942f0273531b2561a8a9264aba7a77a98cf
|
|
7
|
+
data.tar.gz: c578aa4a8db6d5dbf05d98f90e758b71459c954f23bae1498d9ae97c81b9a28d039c27ee634c0b4b2b6a67c8abbc2e0df912b2a7b8bfa2a2974c2dfd39dcc276
|
|
@@ -34,13 +34,13 @@ jobs:
|
|
|
34
34
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
35
35
|
|
|
36
36
|
- name: Set up Ruby
|
|
37
|
-
uses: ruby/setup-ruby@
|
|
37
|
+
uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
|
|
38
38
|
with:
|
|
39
39
|
bundler-cache: true
|
|
40
40
|
ruby-version: ${{ matrix.ruby }}
|
|
41
41
|
|
|
42
42
|
- name: Publish to RubyGems
|
|
43
|
-
uses: rubygems/release-gem@
|
|
43
|
+
uses: rubygems/release-gem@1c162a739e8b4cb21a676e97b087e8268d8fc40b # v1.1.2
|
|
44
44
|
|
|
45
45
|
- name: Create GitHub release
|
|
46
46
|
run: |
|
|
@@ -48,3 +48,4 @@ jobs:
|
|
|
48
48
|
gh release create "${tag_name}" --verify-tag --generate-notes
|
|
49
49
|
env:
|
|
50
50
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
51
|
+
if: ${{ matrix.ruby == 'ruby' }}
|
data/.github/workflows/test.yml
CHANGED
data/NEWS.md
CHANGED
data/lib/erb/compiler.rb
CHANGED
|
@@ -480,7 +480,6 @@ class ERB::Compiler # :nodoc:
|
|
|
480
480
|
end
|
|
481
481
|
}.new(caller(0)).c
|
|
482
482
|
private_constant :WARNING_UPLEVEL
|
|
483
|
-
# :startdoc:
|
|
484
483
|
|
|
485
484
|
def warn_invalid_trim_mode(mode, uplevel:)
|
|
486
485
|
warn "Invalid ERB trim mode: #{mode.inspect} (trim_mode: nil, 0, 1, 2, or String composed of '%' and/or '-', '>', '<>')", uplevel: uplevel + WARNING_UPLEVEL
|
data/lib/erb/util.rb
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Load CGI.escapeHTML and CGI.escapeURIComponent.
|
|
4
4
|
# CRuby:
|
|
5
|
-
# cgi.gem v0.1.0+ (Ruby 2.7-3.4) and Ruby
|
|
6
|
-
# cgi.gem v0.3.3+ (Ruby 3.2-3.4) and Ruby
|
|
5
|
+
# cgi.gem v0.1.0+ (Ruby 2.7-3.4) and Ruby 4.0+ stdlib have 'cgi/escape' and CGI.escapeHTML.
|
|
6
|
+
# cgi.gem v0.3.3+ (Ruby 3.2-3.4) and Ruby 4.0+ stdlib have CGI.escapeURIComponent.
|
|
7
7
|
# JRuby: cgi.gem has a Java extension 'cgi/escape'.
|
|
8
8
|
# TruffleRuby: lib/truffle/cgi/escape.rb requires 'cgi/util'.
|
|
9
9
|
require 'cgi/escape'
|
|
@@ -19,6 +19,7 @@ rescue LoadError
|
|
|
19
19
|
# A subset of ERB::Util. Unlike ERB::Util#html_escape, we expect/hope
|
|
20
20
|
# Rails will not monkey-patch ERB::Escape#html_escape.
|
|
21
21
|
module ERB::Escape
|
|
22
|
+
# :stopdoc:
|
|
22
23
|
def html_escape(s)
|
|
23
24
|
CGI.escapeHTML(s.to_s)
|
|
24
25
|
end
|
data/lib/erb/version.rb
CHANGED
data/lib/erb.rb
CHANGED
|
@@ -60,7 +60,7 @@ require 'erb/util'
|
|
|
60
60
|
# \ERB supports tags of three kinds:
|
|
61
61
|
#
|
|
62
62
|
# - [Expression tags][expression tags]:
|
|
63
|
-
# each begins with `'
|
|
63
|
+
# each begins with `'<%='`, ends with `'%>'`; contains a Ruby expression;
|
|
64
64
|
# in the result, the value of the expression replaces the entire tag:
|
|
65
65
|
#
|
|
66
66
|
# template = 'The magic word is <%= magic_word %>.'
|
|
@@ -77,7 +77,7 @@ require 'erb/util'
|
|
|
77
77
|
# ERB.new('Today is <%= Date::DAYNAMES[Date.today.wday] %>.').result # => "Today is Monday."
|
|
78
78
|
#
|
|
79
79
|
# - [Execution tags][execution tags]:
|
|
80
|
-
# each begins with `'
|
|
80
|
+
# each begins with `'<%'`, ends with `'%>'`; contains Ruby code to be executed:
|
|
81
81
|
#
|
|
82
82
|
# template = '<% File.write("t.txt", "Some stuff.") %>'
|
|
83
83
|
# ERB.new(template).result
|
|
@@ -467,7 +467,7 @@ require 'erb/util'
|
|
|
467
467
|
# ```
|
|
468
468
|
#
|
|
469
469
|
# You can give `trim_mode: '>'` to suppress the trailing newline
|
|
470
|
-
# for each line that ends with `'
|
|
470
|
+
# for each line that ends with `'%>'` (regardless of its beginning):
|
|
471
471
|
#
|
|
472
472
|
# ```
|
|
473
473
|
# ERB.new(template, trim_mode: '>').result.lines.each {|line| puts line.inspect }
|
|
@@ -778,9 +778,6 @@ require 'erb/util'
|
|
|
778
778
|
# [template processor]: https://en.wikipedia.org/wiki/Template_processor
|
|
779
779
|
#
|
|
780
780
|
class ERB
|
|
781
|
-
Revision = '$Date:: $' # :nodoc: #'
|
|
782
|
-
deprecate_constant :Revision
|
|
783
|
-
|
|
784
781
|
# :markup: markdown
|
|
785
782
|
#
|
|
786
783
|
# :call-seq:
|
|
@@ -827,46 +824,12 @@ class ERB
|
|
|
827
824
|
#
|
|
828
825
|
# It's good practice to choose a variable name that begins with an underscore: `'_'`.
|
|
829
826
|
#
|
|
830
|
-
# <b>Backward Compatibility</b>
|
|
831
|
-
#
|
|
832
|
-
# The calling sequence given above -- which is the one you should use --
|
|
833
|
-
# is a simplified version of the complete formal calling sequence,
|
|
834
|
-
# which is:
|
|
835
|
-
#
|
|
836
|
-
# ```
|
|
837
|
-
# ERB.new(template,
|
|
838
|
-
# safe_level=NOT_GIVEN, legacy_trim_mode=NOT_GIVEN, legacy_eoutvar=NOT_GIVEN,
|
|
839
|
-
# trim_mode: nil, eoutvar: '_erbout')
|
|
840
|
-
# ```
|
|
841
|
-
#
|
|
842
|
-
# The second, third, and fourth positional arguments (those in the second line above) are deprecated;
|
|
843
|
-
# this method issues warnings if they are given.
|
|
844
|
-
#
|
|
845
|
-
# However, their values, if given, are handled thus:
|
|
846
|
-
#
|
|
847
|
-
# - `safe_level`: ignored.
|
|
848
|
-
# - `legacy_trim_mode`: overrides keyword argument `trim_mode`.
|
|
849
|
-
# - `legacy_eoutvar`: overrides keyword argument `eoutvar`.
|
|
850
|
-
#
|
|
851
827
|
# [blank line control]: rdoc-ref:ERB@Suppressing+Unwanted+Blank+Lines
|
|
852
828
|
# [combine trim modes]: rdoc-ref:ERB@Combining+Trim+Modes
|
|
853
829
|
# [newline control]: rdoc-ref:ERB@Suppressing+Unwanted+Newlines
|
|
854
830
|
# [shorthand format]: rdoc-ref:ERB@Shorthand+Format+for+Execution+Tags
|
|
855
831
|
#
|
|
856
|
-
def initialize(str,
|
|
857
|
-
# Complex initializer for $SAFE deprecation at [Feature #14256]. Use keyword arguments to pass trim_mode or eoutvar.
|
|
858
|
-
if safe_level != NOT_GIVEN
|
|
859
|
-
warn 'Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.', uplevel: 1
|
|
860
|
-
end
|
|
861
|
-
if legacy_trim_mode != NOT_GIVEN
|
|
862
|
-
warn 'Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.', uplevel: 1
|
|
863
|
-
trim_mode = legacy_trim_mode
|
|
864
|
-
end
|
|
865
|
-
if legacy_eoutvar != NOT_GIVEN
|
|
866
|
-
warn 'Passing eoutvar with the 4th argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, eoutvar: ...) instead.', uplevel: 1
|
|
867
|
-
eoutvar = legacy_eoutvar
|
|
868
|
-
end
|
|
869
|
-
|
|
832
|
+
def initialize(str, trim_mode: nil, eoutvar: '_erbout')
|
|
870
833
|
compiler = make_compiler(trim_mode)
|
|
871
834
|
set_eoutvar(compiler, eoutvar)
|
|
872
835
|
@src, @encoding, @frozen_string = *compiler.compile(str)
|
|
@@ -875,12 +838,6 @@ class ERB
|
|
|
875
838
|
@_init = self.class.singleton_class
|
|
876
839
|
end
|
|
877
840
|
|
|
878
|
-
# :markup: markdown
|
|
879
|
-
#
|
|
880
|
-
# Placeholder constant; used as default value for certain method arguments.
|
|
881
|
-
NOT_GIVEN = defined?(Ractor) ? Ractor.make_shareable(Object.new) : Object.new
|
|
882
|
-
private_constant :NOT_GIVEN
|
|
883
|
-
|
|
884
841
|
# :markup: markdown
|
|
885
842
|
#
|
|
886
843
|
# :call-seq:
|
|
@@ -894,7 +851,6 @@ class ERB
|
|
|
894
851
|
# # => #<ERB::Compiler:0x000001cff9467678 @insert_cmd="print", @percent=false, @post_cmd=[], @pre_cmd=[], @put_cmd="print", @trim_mode=nil>
|
|
895
852
|
# ```
|
|
896
853
|
#
|
|
897
|
-
|
|
898
854
|
def make_compiler(trim_mode)
|
|
899
855
|
ERB::Compiler.new(trim_mode)
|
|
900
856
|
end
|
|
@@ -1211,7 +1167,6 @@ class ERB
|
|
|
1211
1167
|
# </html>
|
|
1212
1168
|
# ```
|
|
1213
1169
|
#
|
|
1214
|
-
#
|
|
1215
1170
|
def def_class(superklass=Object, methodname='result')
|
|
1216
1171
|
cls = Class.new(superklass)
|
|
1217
1172
|
def_method(cls, methodname, @filename || '(ERB)')
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: erb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 6.0.0
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- Masatoshi SEKI
|
|
8
8
|
- Takashi Kokubun
|
|
9
9
|
bindir: libexec
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: An easy to use but powerful templating system for Ruby.
|
|
14
14
|
email:
|
|
@@ -54,7 +54,7 @@ licenses:
|
|
|
54
54
|
metadata:
|
|
55
55
|
homepage_uri: https://github.com/ruby/erb
|
|
56
56
|
source_code_uri: https://github.com/ruby/erb
|
|
57
|
-
changelog_uri: https://github.com/ruby/erb/blob/
|
|
57
|
+
changelog_uri: https://github.com/ruby/erb/blob/v6.0.0/NEWS.md
|
|
58
58
|
rdoc_options: []
|
|
59
59
|
require_paths:
|
|
60
60
|
- lib
|
|
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
69
69
|
- !ruby/object:Gem::Version
|
|
70
70
|
version: '0'
|
|
71
71
|
requirements: []
|
|
72
|
-
rubygems_version: 3.6.
|
|
72
|
+
rubygems_version: 3.6.9
|
|
73
73
|
specification_version: 4
|
|
74
74
|
summary: An easy to use but powerful templating system for Ruby.
|
|
75
75
|
test_files: []
|