summaryrefslogtreecommitdiff
path: root/lib/erb
AgeCommit message (Collapse)Author
2025-12-15[ruby/erb] Version 6.0.1Takashi Kokubun
https://github.com/ruby/erb/commit/bbde68fcd5
2025-12-15[ruby/erb] Freeze ERB::Compiler::TrimScanner::ERB_STAGDaisuke Aritomo
(https://github.com/ruby/erb/pull/100) For Ractor compatibility. https://github.com/ruby/erb/commit/43f0876595
2025-12-09Fixed by `misspell -w -error -source=text`Hiroshi SHIBATA
2025-11-12[ruby/erb] Version 6.0.0Takashi Kokubun
https://github.com/ruby/erb/commit/bbaaf1f51b
2025-11-11[ruby/erb] Replace Ruby 3.5 with Ruby 4.0Yasuo Honda
(https://github.com/ruby/erb/pull/94) This commit updates the Ruby version to follow the commit in Ruby master branch. https://github.com/ruby/ruby/commit/6d81969b475262aba251e99b518181bdf7c5a523 https://github.com/ruby/erb/commit/a5d42484e4
2025-11-10[ruby/erb] [DOC] Suppress documentation for internalsNobuyoshi Nakada
https://github.com/ruby/erb/commit/332e200060
2025-10-28[ruby/erb] Version 5.1.3Takashi Kokubun
https://github.com/ruby/erb/commit/e8d382a83e
2025-10-28[ruby/erb] Version 5.1.2Takashi Kokubun
https://github.com/ruby/erb/commit/daa0e8712f
2025-10-14[ruby/erb] Add `changelog_uri` to spec metadataJason Garber
(https://github.com/ruby/erb/pull/89) This project's `NEWS.md` file appears to be the closest thing to a changelog file that I could find. The change here links to the file in the released version's branch. RubyGems.org will use this metadata to display a link to this file on the gem's release pages. https://github.com/ruby/erb/commit/85a4f10332
2025-10-12[ruby/erb] Version 5.1.1Takashi Kokubun
https://github.com/ruby/erb/commit/3dc0bb09bf
2025-10-11[ruby/erb] Version 5.1.0Takashi Kokubun
https://github.com/ruby/erb/commit/25fdde41d6
2025-10-06[ruby/erb] Version 5.0.3Takashi Kokubun
https://github.com/ruby/erb/commit/ddfc1ba57e
2025-09-18[ruby/erb] [DOC] Doc for constant VERSIONBurdetteLamar
https://github.com/ruby/erb/commit/9b16b2d553
2025-09-18[ruby/erb] [DOC] `ERB::Version`Nobuyoshi Nakada
https://github.com/ruby/erb/commit/7fed01c4de
2025-09-18[ruby/erb] [DOC] Fix the location of `url_encode` docNobuyoshi Nakada
The documentation must be just before the definition. https://github.com/ruby/erb/commit/62282e32d9
2025-07-15[ruby/erb] Version 5.0.2Takashi Kokubun
https://github.com/ruby/erb/commit/e8f3e64581
2025-07-01Fixed inconsistency gemspec locationHiroshi SHIBATA
foo.gemspec should be located under the `lib/foo` directory.
2025-05-14[ruby/erb] Version 5.0.1Takashi Kokubun
https://github.com/ruby/erb/commit/42f389dc45
2025-05-13[ruby/erb] Give up on using resolve_feature_pathTakashi Kokubun
Apparently `$LOAD_PATH.resolve_feature_path('erb/escape')` returns true for miniruby but `require 'erb/escape'` fails on it. I still don't want to check it and rescue LoadError at the same time because the code looks too complicated. Let me just rescue LoadError for platforms that don't build native extensions. https://github.com/ruby/erb/commit/3081c6b20f
2025-05-13[ruby/erb] Reapply "Refactor the logic of require 'erb/escape'Takashi Kokubun
(https://github.com/ruby/erb/pull/61)" This reverts commit https://github.com/ruby/erb/commit/1c9200aab071. Now that we've bumped BASERUBY, we shouldn't need to rescue the LoadError. https://github.com/ruby/erb/commit/846b20fe0e
2025-05-13[ruby/erb] Update the reason why we need to rescue LoadErrorTakashi Kokubun
https://github.com/ruby/erb/commit/c2d1f82817
2025-05-13[ruby/erb] Revert "Refactor the logic of require 'erb/escape'Takashi Kokubun
(https://github.com/ruby/erb/pull/61)" This reverts commit https://github.com/ruby/erb/commit/1c393aa738f3. https://github.com/ruby/erb/commit/1c9200aab0
2025-05-13[ruby/erb] Version 5.0.0Takashi Kokubun
https://github.com/ruby/erb/commit/08b544cdb8
2025-05-13[ruby/erb] Publish constant ERB::VERSIONTakashi Kokubun
Even cgi.gem publicly defines CGI::VERSION today. It's just weird that ERB::VERSION is kept private at this point. https://github.com/ruby/erb/commit/46801cbd47
2025-05-13[ruby/erb] Refactor the logic of require 'erb/escape'Takashi Kokubun
(https://github.com/ruby/erb/pull/61) https://github.com/ruby/erb/commit/1c393aa738
2025-05-13[ruby/erb] Support all cgi.gem versionsTakashi Kokubun
(https://github.com/ruby/erb/pull/60) https://github.com/ruby/erb/commit/de9bb8c3cc
2025-05-12[ruby/erb] [DOC] Make documentation 100%Nobuyoshi Nakada
https://github.com/ruby/erb/commit/9152ce8db4
2025-04-25Inline Class#new.Aaron Patterson
This commit inlines instructions for Class#new. To make this work, we added a new YARV instructions, `opt_new`. `opt_new` checks whether or not the `new` method is the default allocator method. If it is, it allocates the object, and pushes the instance on the stack. If not, the instruction jumps to the "slow path" method call instructions. Old instructions: ``` > ruby --dump=insns -e'Object.new' == disasm: #<ISeq:<main>@-e:1 (1,0)-(1,10)> 0000 opt_getconstant_path <ic:0 Object> ( 1)[Li] 0002 opt_send_without_block <calldata!mid:new, argc:0, ARGS_SIMPLE> 0004 leave ``` New instructions: ``` > ./miniruby --dump=insns -e'Object.new' == disasm: #<ISeq:<main>@-e:1 (1,0)-(1,10)> 0000 opt_getconstant_path <ic:0 Object> ( 1)[Li] 0002 putnil 0003 swap 0004 opt_new <calldata!mid:new, argc:0, ARGS_SIMPLE>, 11 0007 opt_send_without_block <calldata!mid:initialize, argc:0, FCALL|ARGS_SIMPLE> 0009 jump 14 0011 opt_send_without_block <calldata!mid:new, argc:0, ARGS_SIMPLE> 0013 swap 0014 pop 0015 leave ``` This commit speeds up basic object allocation (`Foo.new`) by 60%, but classes that take keyword parameters see an even bigger benefit because no hash is allocated when instantiating the object (3x to 6x faster). Here is an example that uses `Hash.new(capacity: 0)`: ``` > hyperfine "ruby --disable-gems -e'i = 0; while i < 10_000_000; Hash.new(capacity: 0); i += 1; end'" "./ruby --disable-gems -e'i = 0; while i < 10_000_000; Hash.new(capacity: 0); i += 1; end'" Benchmark 1: ruby --disable-gems -e'i = 0; while i < 10_000_000; Hash.new(capacity: 0); i += 1; end' Time (mean ± σ): 1.082 s ± 0.004 s [User: 1.074 s, System: 0.008 s] Range (min … max): 1.076 s … 1.088 s 10 runs Benchmark 2: ./ruby --disable-gems -e'i = 0; while i < 10_000_000; Hash.new(capacity: 0); i += 1; end' Time (mean ± σ): 627.9 ms ± 3.5 ms [User: 622.7 ms, System: 4.8 ms] Range (min … max): 622.7 ms … 633.2 ms 10 runs Summary ./ruby --disable-gems -e'i = 0; while i < 10_000_000; Hash.new(capacity: 0); i += 1; end' ran 1.72 ± 0.01 times faster than ruby --disable-gems -e'i = 0; while i < 10_000_000; Hash.new(capacity: 0); i += 1; end' ``` This commit changes the backtrace for `initialize`: ``` aaron@tc ~/g/ruby (inline-new)> cat test.rb class Foo def initialize puts caller end end def hello Foo.new end hello aaron@tc ~/g/ruby (inline-new)> ruby -v test.rb ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [arm64-darwin24] test.rb:8:in 'Class#new' test.rb:8:in 'Object#hello' test.rb:11:in '<main>' aaron@tc ~/g/ruby (inline-new)> ./miniruby -v test.rb ruby 3.5.0dev (2025-03-28T23:59:40Z inline-new c4157884e4) +PRISM [arm64-darwin24] test.rb:8:in 'Object#hello' test.rb:11:in '<main>' ``` It also increases memory usage for calls to `new` by 122 bytes: ``` aaron@tc ~/g/ruby (inline-new)> cat test.rb require "objspace" class Foo def initialize puts caller end end def hello Foo.new end puts ObjectSpace.memsize_of(RubyVM::InstructionSequence.of(method(:hello))) aaron@tc ~/g/ruby (inline-new)> make runruby RUBY_ON_BUG='gdb -x ./.gdbinit -p' ./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems ./test.rb 656 aaron@tc ~/g/ruby (inline-new)> ruby -v test.rb ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [arm64-darwin24] 544 ``` Thanks to @ko1 for coming up with this idea! Co-Authored-By: John Hawthorn <john@hawthorn.email>
2025-01-15[ruby/erb] Make `@scanner_map` of `ERB::Compiler::Scanner` ractor-shareablewanabe
- Freeze on assignment - Recreate Hash on registration https://github.com/ruby/erb/commit/12d69fc2b3
2024-01-04[ruby/erb] Version 4.0.4Takashi Kokubun
https://github.com/ruby/erb/commit/b68bfed6a8
2023-08-21[ruby/erb] Version 4.0.3Takashi Kokubun
https://github.com/ruby/erb/commit/c594f2fb86
2023-08-22[ruby/erb] Enable frozen_string_literal in all filesJosh Nichols
(https://github.com/ruby/erb/pull/49) I was surprised to see erb show up when I was using memory_profiler on my app. ERB::Compiler#compile has a blank string literal, and it ended up allocating some 41532 blank strings for a relatively small surface area. https://github.com/ruby/erb/commit/b7e45c2bdc
2022-11-29[ruby/erb] Version 4.0.2Takashi Kokubun
https://github.com/ruby/erb/commit/8c8ff1551b
2022-11-29[ruby/erb] Fix line numbers after multi-line <%#Takashi Kokubun
(https://github.com/ruby/erb/pull/42) https://github.com/ruby/erb/commit/526885923e
2022-11-27[ruby/erb] Version 4.0.1Takashi Kokubun
https://github.com/ruby/erb/commit/3bb67009dd
2022-11-27[ruby/erb] Skip using the extension for truffleruby as wellTakashi Kokubun
(https://github.com/ruby/erb/pull/39) * Skip using the extension for truffleruby as well * Just skip building the C extension for TruffleRuby * Skip rake compile for truffleruby * Use resolve_feature_path * Revert "Use resolve_feature_path" This reverts commit https://github.com/ruby/erb/commit/acc1e0c0ffaf. * Use resolve_feature_path with LoadError guard https://github.com/ruby/erb/commit/85dcb08439
2022-11-26[ruby/erb] Version 4.0.0Takashi Kokubun
https://github.com/ruby/erb/commit/2809a54d88
2022-11-26[ruby/erb] Define ERB::Escape moduleTakashi Kokubun
(https://github.com/ruby/erb/pull/38) Close #32
2022-11-25[ruby/erb] Keep ERB::Util#html_escape privateTakashi Kokubun
ERB::Util.html_escape has been public, but ERB::Util#html_escape had been private. https://github.com/ruby/erb/commit/e62210bf56
2022-11-24[ruby/erb] Allow requiring erb/escape.so aloneTakashi Kokubun
(https://github.com/ruby/erb/pull/37) Prior to this commit, requiring erb/escape first and then requiring erb did not work as expected.
2022-11-24[ruby/erb] Split erb.rb into files for each module under ERBTakashi Kokubun
(https://github.com/ruby/erb/pull/36) https://github.com/ruby/erb/commit/f74833cc07
2022-10-25[ruby/erb] Version 3.0.0 Takashi Kokubun
2021-03-26[ruby/erb] Version 2.2.3Takashi Kokubun
https://github.com/ruby/erb/commit/03bc4a8274
2021-01-21[ruby/erb] Version 2.2.2Takashi Kokubun
https://github.com/ruby/erb/commit/3d84ea83bc
2021-01-21[ruby/erb] Version 2.2.1Takashi Kokubun
https://github.com/ruby/erb/commit/c8aa019c26
2021-01-20[ruby/erb] Unify ERB version definitionsTakashi Kokubun
https://github.com/ruby/erb/commit/5df06b8473