erb 6.0.4-java → 6.0.5-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.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +6 -1
  3. data/NEWS.md +17 -1
  4. data/lib/erb/version.rb +1 -1
  5. data/lib/erb.rb +11 -3
  6. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20c0647f3c42b33fcc85c6db69720a9b042f1ad5273c2a38b7ea8260016359eb
4
- data.tar.gz: b9d6d76adca7f3ea81654ef41a43ed27523c382e671e5019ced076c5c148e1b8
3
+ metadata.gz: e1fdd0c922896e9fe7333bcdefec35a6485344f0b577157f21a27e9e0ca56455
4
+ data.tar.gz: d0dbe48be9caa4bd235c9cb2b6bf2da03eeb23a527a6a75f1f6e333f6204fc58
5
5
  SHA512:
6
- metadata.gz: 9378aa65ed0a61329056073905ace16709524c448c642edcd0fd8a1ea52f71156e668dd98aea0b4f3c45f9beebc0d6edc2ed74e1127fcf00b0213697949b9ff0
7
- data.tar.gz: 38f01de19eead39446765c257095ba7616162d2f48c155134cc7dcdb6171ba3f23477dd32b8d12493c5c9050e92033c34c9ffd1fccb7c40aa4d0d0e2e4020cc9
6
+ metadata.gz: 3cfadb5d42a2592d786718f4c5bf1a9ca912188dec002de1cb5474fabf0ad471e88eb37cd777fd343289872708aaccc383e1640a893d9b5f3e7a44025985528d
7
+ data.tar.gz: 439e139bcbd315dccd701d543c984593e166f2c99004c2c9f0b8571c392856275cd20feb5fd11dc17a847231e4b07b22b878c1b12a491d806444ebfa84466bb3
data/Gemfile CHANGED
@@ -5,7 +5,12 @@ gemspec
5
5
  group :development do
6
6
  gem 'rake'
7
7
  gem 'rake-compiler'
8
- gem 'rdoc'
8
+ if RUBY_ENGINE == 'jruby'
9
+ # RDoc 8 pulls in RBS 4, which attempts to build a native extension on JRuby.
10
+ gem 'rdoc', '< 8'
11
+ else
12
+ gem 'rdoc'
13
+ end
9
14
  gem 'test-unit'
10
15
  gem "test-unit-ruby-core"
11
16
  end
data/NEWS.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.0.5
4
+
5
+ * Avoid overridable method dispatch in the initialization guard
6
+
3
7
  ## 6.0.4
4
8
 
5
9
  * Prohibit `def_method` on marshal-loaded ERB instances
@@ -12,6 +16,10 @@
12
16
 
13
17
  * Freeze `src` in `ERB#initialize` for Ractor compatibility https://github.com/ruby/erb/pull/105
14
18
 
19
+ ## 6.0.1.1
20
+
21
+ * Prohibit `def_method` on marshal-loaded ERB instances
22
+
15
23
  ## 6.0.1
16
24
 
17
25
  * Freeze `ERB::Compiler::TrimScanner::ERB_STAG` for Ractor compatibility
@@ -55,9 +63,17 @@
55
63
  * Drop `cgi` from runtime dependencies [#59](https://github.com/ruby/erb/pull/59)
56
64
  * Make `ERB::VERSION` public
57
65
 
66
+ ## 4.0.4.1
67
+
68
+ * Prohibit `def_method` on marshal-loaded ERB instances
69
+
58
70
  ## 4.0.4
59
71
 
60
- * Skip building the C extension for JRuby [#52](https://github.com/ruby/erb/pull/52)
72
+ * Skip building the C extension for JRuby
73
+
74
+ ## 4.0.3.1
75
+
76
+ * Prohibit `def_method` on marshal-loaded ERB instances
61
77
 
62
78
  ## 4.0.3
63
79
 
data/lib/erb/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  class ERB
3
3
  # The string \ERB version.
4
- VERSION = '6.0.4'
4
+ VERSION = '6.0.5'
5
5
  end
data/lib/erb.rb CHANGED
@@ -778,6 +778,9 @@ require 'erb/util'
778
778
  # [template processor]: https://en.wikipedia.org/wiki/Template_processor
779
779
  #
780
780
  class ERB
781
+ IDENTITY_METHOD = BasicObject.instance_method(:equal?) # :nodoc:
782
+ private_constant :IDENTITY_METHOD
783
+
781
784
  # :markup: markdown
782
785
  #
783
786
  # :call-seq:
@@ -889,7 +892,7 @@ class ERB
889
892
  #
890
893
  # ```
891
894
  # erb = ERB.new(template, eoutvar: '_foo')
892
- # puts template.src.split('; ')
895
+ # puts erb.src.split('; ')
893
896
  # #coding:UTF-8
894
897
  # _foo = +''
895
898
  # _foo.<< "The time is ".freeze
@@ -1007,7 +1010,7 @@ class ERB
1007
1010
  # [local binding]: rdoc-ref:ERB@Local+Binding
1008
1011
  #
1009
1012
  def result(b=new_toplevel)
1010
- unless @_init.equal?(self.class.singleton_class)
1013
+ unless initialized_by_new?
1011
1014
  raise ArgumentError, "not initialized"
1012
1015
  end
1013
1016
  eval(@src, b, (@filename || '(erb)'), @lineno)
@@ -1061,6 +1064,11 @@ class ERB
1061
1064
  end
1062
1065
  private :new_toplevel
1063
1066
 
1067
+ def initialized_by_new? # :nodoc:
1068
+ IDENTITY_METHOD.bind_call(@_init, self.class.singleton_class)
1069
+ end
1070
+ private :initialized_by_new?
1071
+
1064
1072
  # :markup: markdown
1065
1073
  #
1066
1074
  # :call-seq:
@@ -1087,7 +1095,7 @@ class ERB
1087
1095
  # ```
1088
1096
  #
1089
1097
  def def_method(mod, methodname, fname='(ERB)')
1090
- unless @_init.equal?(self.class.singleton_class)
1098
+ unless initialized_by_new?
1091
1099
  raise ArgumentError, "not initialized"
1092
1100
  end
1093
1101
  src = self.src.sub(/^(?!#|$)/) {"def #{methodname}\n"} << "\nend\n"
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: 6.0.4
4
+ version: 6.0.5
5
5
  platform: java
6
6
  authors:
7
7
  - Masatoshi SEKI
@@ -49,7 +49,7 @@ licenses:
49
49
  metadata:
50
50
  homepage_uri: https://github.com/ruby/erb
51
51
  source_code_uri: https://github.com/ruby/erb
52
- changelog_uri: https://github.com/ruby/erb/blob/v6.0.4/NEWS.md
52
+ changelog_uri: https://github.com/ruby/erb/blob/v6.0.5/NEWS.md
53
53
  rdoc_options: []
54
54
  require_paths:
55
55
  - lib