erb 4.0.0 → 4.0.2

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: 7b2863be9c08d529339d060f45fe14a92ddc56e5107c4e96d96f62c5bb3891ef
4
- data.tar.gz: 5bedf59f948afda25ce5a9b34ffeba0ec9c8d69cce09ee20a00f63ab0f468363
3
+ metadata.gz: 675c468f525ff93b95dce4365f40d238bed3c247a2f46d116312f32933e88070
4
+ data.tar.gz: '0909f701d87673867c5ba63e5d74d5cdc09538ca821af6a9f46943169e9b2ada'
5
5
  SHA512:
6
- metadata.gz: f3c5db15f023dd2cca0c76a9fad16746f98d44adc41284308c6baad9eebb75ac3aa54a7a89f3457f9e82ddc62cf7c42ddf1050cd5aef7811b74ab7513822a92f
7
- data.tar.gz: dfb6828690e0e3ea9572692534f676d07a952d2db47726f7c3de7da38ca8a970ed4d26525698b56de04bc4956bbd032bf7b2f15515a9f649cc3c0c4dbb02a067
6
+ metadata.gz: f96aa045940fdd84702ff12ce46eb243fa95f0e6e912bb3f32873e3513588b8c7db94d83873f8ce8b19187b1187ac27bea00c38d9ccc479d92e222c304a8305f
7
+ data.tar.gz: ef97afccd0201e81ad6660e643b1c7e2d3449e75069bae06e595099cbe1f9c913710c9a7553234b40ee5834932d9d0bbf8d679a76416cc39e28df30138a8b97e
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: 'github-actions'
4
+ directory: '/'
5
+ schedule:
6
+ interval: 'weekly'
@@ -26,7 +26,7 @@ jobs:
26
26
  fail-fast: false
27
27
  runs-on: ${{ matrix.os }}
28
28
  steps:
29
- - uses: actions/checkout@v2
29
+ - uses: actions/checkout@v3
30
30
  - name: Set up Ruby
31
31
  uses: ruby/setup-ruby@v1
32
32
  with:
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/compiler.rb CHANGED
@@ -384,7 +384,7 @@ class ERB::Compiler # :nodoc:
384
384
  when '<%='
385
385
  add_insert_cmd(out, content)
386
386
  when '<%#'
387
- # commented out
387
+ out.push("\n" * content.count("\n")) # only adjust lineno
388
388
  end
389
389
  end
390
390
 
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.2'
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.2
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-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cgi
@@ -35,6 +35,7 @@ extensions:
35
35
  - ext/erb/escape/extconf.rb
36
36
  extra_rdoc_files: []
37
37
  files:
38
+ - ".github/dependabot.yml"
38
39
  - ".github/workflows/test.yml"
39
40
  - ".gitignore"
40
41
  - Gemfile
@@ -75,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
76
  - !ruby/object:Gem::Version
76
77
  version: '0'
77
78
  requirements: []
78
- rubygems_version: 3.3.7
79
+ rubygems_version: 3.4.0.dev
79
80
  signing_key:
80
81
  specification_version: 4
81
82
  summary: An easy to use but powerful templating system for Ruby.