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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e39ac89a663f9ec9c2dd46af732f74e814b95167967f5efcf1aa35dbe640ea63
4
- data.tar.gz: cfceb3434204b17b65d00a0eab2f73e7abca7c1c67bfa7baefeea151346dae5b
3
+ metadata.gz: 853983c0a4e1b81c59b0fee415b27383d0f12c372ea6b534e27f39d1f1ce4022
4
+ data.tar.gz: 568d2f27aa45623fd24e8d65325edf092b9c63154992800589da605e46256869
5
5
  SHA512:
6
- metadata.gz: d71d4bdcf0f0a027f1897a2c74aa56c728658d96f2f88c5e1e4e3e33d5d5707c514a3ed39946335cf9f94ccd4734ee33ad21a1a8f57b547339ef1b49a81681b4
7
- data.tar.gz: b85fd09d707a9e92adfd1e8d827cf4c172106cce3f3207495944f8e4fa5b966fb9af2b52053af02e39bd2b1f1db06d9bb00ebe31bc4409b9ff5339a976cee938
6
+ metadata.gz: f7e82ab6f0359e0185529481b05267c6837b9574af77a7fe5d01678fb10a61c8e51677c52a347d178c0c7c8a8f3b93f59e56846a9476020c4230a0a0081ddad7
7
+ data.tar.gz: 3914c61780fc17624f3e6d8848b9c0dcbf6a7ebfbadb1d6b8daecf3ebfc75d12e5ab54ba182fb5d8f1a3e51a00410fd1bf355b4f6c3a0c9a3dccf77c3b5ede51
@@ -3,20 +3,25 @@ name: test
3
3
  on: [push, pull_request]
4
4
 
5
5
  jobs:
6
- build:
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@master
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
@@ -27,5 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = ['erb']
28
28
  spec.require_paths = ['lib']
29
29
 
30
- spec.add_dependency 'cgi'
30
+ spec.required_ruby_version = ">= 2.7.0"
31
+
32
+ spec.add_dependency 'cgi', '>= 0.3.3'
31
33
  end
data/lib/erb/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  class ERB
3
- VERSION = '2.2.3'
3
+ VERSION = '3.0.0'
4
4
  private_constant :VERSION
5
5
  end
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.b.gsub(/[^a-zA-Z0-9_\-.~]/n) { |m|
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: 2.2.3
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: 2021-03-26 00:00:00.000000000 Z
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: '0'
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: '0'
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.5.0
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.2.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.