erb 4.0.0 → 4.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b2863be9c08d529339d060f45fe14a92ddc56e5107c4e96d96f62c5bb3891ef
4
- data.tar.gz: 5bedf59f948afda25ce5a9b34ffeba0ec9c8d69cce09ee20a00f63ab0f468363
3
+ metadata.gz: e00dd4c30b3c6affa697b52c33f6888583030f2cd90ae088e92dc36e1e2d513b
4
+ data.tar.gz: 5c778ef315846ec45a3c2f0413ca1c1f1bf38727037bcb2c23be2a2782f4f5b9
5
5
  SHA512:
6
- metadata.gz: f3c5db15f023dd2cca0c76a9fad16746f98d44adc41284308c6baad9eebb75ac3aa54a7a89f3457f9e82ddc62cf7c42ddf1050cd5aef7811b74ab7513822a92f
7
- data.tar.gz: dfb6828690e0e3ea9572692534f676d07a952d2db47726f7c3de7da38ca8a970ed4d26525698b56de04bc4956bbd032bf7b2f15515a9f649cc3c0c4dbb02a067
6
+ metadata.gz: f3ec96b260c70b9a3c673d21500a5b2e4834870caecb0153b0f7bf5337581e5183a90ed81b59e5a26843b76012540d5c695c26cfe206b636e7a33a2639c4d6fa
7
+ data.tar.gz: f918bf3065949b0ab784212357a160bce6432b284509660d0949d8479866cc5577bbe3892a9f1dee721d501f5a09d522efcd22473aee84c14a4557ae94ca6dc8
data/NEWS.md CHANGED
@@ -1,12 +1,16 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.0.1
4
+
5
+ * Stop building the C extension for TruffleRuby [#39](https://github.com/ruby/erb/pull/39)
6
+
3
7
  ## 4.0.0
4
8
 
5
- * Optimize `ERB::Util.html_escape`
9
+ * Optimize `ERB::Util.html_escape` [#27](https://github.com/ruby/erb/pull/27)
6
10
  * No longer duplicate an argument string when nothing is escaped.
7
11
  * This makes `ERB::Util.html_escape` faster than `CGI.escapeHTML` in no-escape cases.
8
12
  * It skips calling `#to_s` when an argument is already a String.
9
- * Define `ERB::Escape.html_escape` as an alias to `ERB::Util.html_escape`
13
+ * Define `ERB::Escape.html_escape` as an alias to `ERB::Util.html_escape` [#38](https://github.com/ruby/erb/pull/38)
10
14
  * `ERB::Util.html_escape` is known to be monkey-patched by Rails.
11
15
  `ERB::Escape.html_escape` is useful when you want a non-monkey-patched version.
12
16
  * Drop deprecated `-S` option from `erb` command
data/Rakefile CHANGED
@@ -7,7 +7,10 @@ Rake::TestTask.new(:test) do |t|
7
7
  t.test_files = FileList['test/**/test_*.rb']
8
8
  end
9
9
 
10
- if RUBY_ENGINE != 'jruby'
10
+ case RUBY_ENGINE
11
+ when 'jruby', 'truffleruby'
12
+ # not using C extension
13
+ else
11
14
  require 'rake/extensiontask'
12
15
  Rake::ExtensionTask.new('erb/escape')
13
16
  task test: :compile
@@ -1,2 +1,7 @@
1
1
  require 'mkmf'
2
- create_makefile 'erb/escape'
2
+
3
+ if RUBY_ENGINE == 'truffleruby'
4
+ File.write('Makefile', dummy_makefile($srcdir).join)
5
+ else
6
+ create_makefile 'erb/escape'
7
+ end
data/lib/erb/util.rb CHANGED
@@ -4,10 +4,13 @@
4
4
  # A subset of ERB::Util. Unlike ERB::Util#html_escape, we expect/hope
5
5
  # Rails will not monkey-patch ERB::Escape#html_escape.
6
6
  begin
7
- require 'erb/escape'
8
- rescue LoadError # JRuby can't load .so
7
+ # We don't build the C extension for JRuby, TruffleRuby, and WASM
8
+ if $LOAD_PATH.resolve_feature_path('erb/escape')
9
+ require 'erb/escape'
10
+ end
11
+ rescue LoadError # resolve_feature_path raises LoadError on TruffleRuby 22.3.0
9
12
  end
10
- unless defined?(ERB::Escape) # JRuby
13
+ unless defined?(ERB::Escape)
11
14
  module ERB::Escape
12
15
  def html_escape(s)
13
16
  CGI.escapeHTML(s.to_s)
data/lib/erb/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  class ERB
3
- VERSION = '4.0.0'
3
+ VERSION = '4.0.1'
4
4
  private_constant :VERSION
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erb
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masatoshi SEKI
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: libexec
11
11
  cert_chain: []
12
- date: 2022-11-26 00:00:00.000000000 Z
12
+ date: 2022-11-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cgi