erb 2.2.3 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +13 -8
- data/NEWS.md +10 -0
- data/README.md +1 -1
- data/Rakefile +7 -0
- data/erb.gemspec +3 -1
- data/lib/erb/version.rb +1 -1
- data/lib/erb.rb +3 -5
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 853983c0a4e1b81c59b0fee415b27383d0f12c372ea6b534e27f39d1f1ce4022
|
4
|
+
data.tar.gz: 568d2f27aa45623fd24e8d65325edf092b9c63154992800589da605e46256869
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7e82ab6f0359e0185529481b05267c6837b9574af77a7fe5d01678fb10a61c8e51677c52a347d178c0c7c8a8f3b93f59e56846a9476020c4230a0a0081ddad7
|
7
|
+
data.tar.gz: 3914c61780fc17624f3e6d8848b9c0dcbf6a7ebfbadb1d6b8daecf3ebfc75d12e5ab54ba182fb5d8f1a3e51a00410fd1bf355b4f6c3a0c9a3dccf77c3b5ede51
|
data/.github/workflows/test.yml
CHANGED
@@ -3,20 +3,25 @@ name: test
|
|
3
3
|
on: [push, pull_request]
|
4
4
|
|
5
5
|
jobs:
|
6
|
-
|
6
|
+
ruby-versions:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
outputs:
|
9
|
+
versions: ${{ steps.versions.outputs.value }}
|
10
|
+
steps:
|
11
|
+
- id: versions
|
12
|
+
run: |
|
13
|
+
versions=$(curl -s 'https://cache.ruby-lang.org/pub/misc/ci_versions/cruby.json')
|
14
|
+
echo "::set-output name=value::${versions}"
|
15
|
+
test:
|
16
|
+
needs: ruby-versions
|
7
17
|
name: build (${{ matrix.ruby }} / ${{ matrix.os }})
|
8
18
|
strategy:
|
9
19
|
matrix:
|
10
|
-
ruby:
|
11
|
-
- '2.5'
|
12
|
-
- '2.6'
|
13
|
-
- '2.7'
|
14
|
-
- '3.0'
|
15
|
-
- head
|
20
|
+
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
|
16
21
|
os: [ubuntu-latest]
|
17
22
|
runs-on: ${{ matrix.os }}
|
18
23
|
steps:
|
19
|
-
- uses: actions/checkout@
|
24
|
+
- uses: actions/checkout@v2
|
20
25
|
- name: Set up Ruby
|
21
26
|
uses: ruby/setup-ruby@v1
|
22
27
|
with:
|
data/NEWS.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 3.0.0
|
4
|
+
|
5
|
+
- Bump `required_ruby_version` to Ruby 2.7+ [#23](https://github.com/ruby/erb/pull/23)
|
6
|
+
- `ERB::Util.url_encode` uses a native implementation [#23](https://github.com/ruby/erb/pull/23)
|
7
|
+
- Fix a bug that a magic comment with a wrong format could be detected [#6](https://github.com/ruby/erb/pull/6)
|
8
|
+
|
9
|
+
## 2.2.3
|
10
|
+
|
11
|
+
- Bump `required_ruby_version` from 2.3 to 2.5 as it has never been supported [#3](https://github.com/ruby/erb/pull/3)
|
12
|
+
|
3
13
|
## 2.2.2
|
4
14
|
|
5
15
|
- `ERB.version` returns just a version number
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@ on the rules below:
|
|
32
32
|
```erb
|
33
33
|
<% Ruby code -- inline with output %>
|
34
34
|
<%= Ruby expression -- replace with result %>
|
35
|
-
<%# comment -- ignored -- useful in testing %>
|
35
|
+
<%# comment -- ignored -- useful in testing %> (`<% #` doesn't work. Don't use Ruby comments.)
|
36
36
|
% a line of Ruby code -- treated as <% line %> (optional -- see ERB.new)
|
37
37
|
%% replaced with % if first thing on a line and % processing is used
|
38
38
|
<%% or %%> -- replace with <% or %> respectively
|
data/Rakefile
CHANGED
@@ -7,4 +7,11 @@ Rake::TestTask.new(:test) do |t|
|
|
7
7
|
t.test_files = FileList['test/**/test_*.rb']
|
8
8
|
end
|
9
9
|
|
10
|
+
task :sync_tool do
|
11
|
+
require 'fileutils'
|
12
|
+
FileUtils.cp '../ruby/tool/lib/core_assertions.rb', './test/lib'
|
13
|
+
FileUtils.cp '../ruby/tool/lib/envutil.rb', './test/lib'
|
14
|
+
FileUtils.cp '../ruby/tool/lib/find_executable.rb', './test/lib'
|
15
|
+
end
|
16
|
+
|
10
17
|
task default: :test
|
data/erb.gemspec
CHANGED
data/lib/erb/version.rb
CHANGED
data/lib/erb.rb
CHANGED
@@ -46,7 +46,7 @@ require 'erb/version'
|
|
46
46
|
#
|
47
47
|
# <% Ruby code -- inline with output %>
|
48
48
|
# <%= Ruby expression -- replace with result %>
|
49
|
-
# <%# comment -- ignored -- useful in testing %>
|
49
|
+
# <%# comment -- ignored -- useful in testing %> (`<% #` doesn't work. Don't use Ruby comments.)
|
50
50
|
# % a line of Ruby code -- treated as <% line %> (optional -- see ERB.new)
|
51
51
|
# %% replaced with % if first thing on a line and % processing is used
|
52
52
|
# <%% or %%> -- replace with <% or %> respectively
|
@@ -724,7 +724,7 @@ class ERB
|
|
724
724
|
frozen = nil
|
725
725
|
s.scan(re) do
|
726
726
|
comment = $+
|
727
|
-
comment = $1 if comment[/-\*-\s*(.*?)\s
|
727
|
+
comment = $1 if comment[/-\*-\s*([^\s].*?)\s*-\*-$/]
|
728
728
|
case comment
|
729
729
|
when %r"coding\s*[=:]\s*([[:alnum:]\-_]+)"
|
730
730
|
enc = Encoding.find($1.sub(/-(?:mac|dos|unix)/i, ''))
|
@@ -1019,9 +1019,7 @@ class ERB
|
|
1019
1019
|
# Programming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%20Guide
|
1020
1020
|
#
|
1021
1021
|
def url_encode(s)
|
1022
|
-
s.to_s
|
1023
|
-
sprintf("%%%02X", m.unpack1("C"))
|
1024
|
-
}
|
1022
|
+
CGI.escapeURIComponent(s.to_s)
|
1025
1023
|
end
|
1026
1024
|
alias u url_encode
|
1027
1025
|
module_function :u
|
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: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masatoshi SEKI
|
8
8
|
autorequire:
|
9
9
|
bindir: libexec
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cgi
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.3.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.3.3
|
27
27
|
description: An easy to use but powerful templating system for Ruby.
|
28
28
|
email:
|
29
29
|
- seki@ruby-lang.org
|
@@ -60,14 +60,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
60
60
|
requirements:
|
61
61
|
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 2.
|
63
|
+
version: 2.7.0
|
64
64
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
requirements: []
|
70
|
-
rubygems_version: 3.
|
70
|
+
rubygems_version: 3.3.7
|
71
71
|
signing_key:
|
72
72
|
specification_version: 4
|
73
73
|
summary: An easy to use but powerful templating system for Ruby.
|