summaryrefslogtreecommitdiff
path: root/test/erb
AgeCommit message (Collapse)Author
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-24[ruby/erb] Drop deprecated -S option from erb commandTakashi Kokubun
We attempted to remove things like this and reverted all of them, but I think nobody relies on this unlike the positional arguments of `ERB#initialize`. https://github.com/ruby/erb/commit/92fde7e403
2022-11-24[ruby/erb] Suppress warnings to fix ruby-head CITakashi Kokubun
(https://github.com/ruby/erb/pull/34) There seems to be no way to fix this. It doesn't happen in an installed directory, so it's likely a false positive and/or a bug in rubygems. | <internal:/home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85: warning: <internal:/home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85: warning: loading in progress, circular require considered harmful - /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/setup.rb | from /home/runner/work/erb/erb/libexec/erb:0:in `require' | from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/setup.rb:3:in `<top (required)>' | from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/setup.rb:3:in `require_relative' | from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/shared_helpers.rb:8:in `<top (required)>' | from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/shared_helpers.rb:8:in `require_relative' | from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/rubygems_integration.rb:3:in `<top (required)>' | from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/rubygems_integration.rb:3:in `require' | from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems.rb:1352:in `<top (required)>' | from <internal:/home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85:in `require' | from <internal:/home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85:in `require'
2022-11-04[ruby/erb] Copy CGI.escapeHTML to ERB::Util.html_escapeTakashi Kokubun
https://github.com/ruby/erb/commit/ac9b219fa9
2022-11-03[ruby/erb] Skip a test for JRubyTakashi Kokubun
https://github.com/ruby/erb/commit/48a75665ab
2022-11-03[ruby/erb] Skip tests for trufflerubyTakashi Kokubun
https://github.com/ruby/erb/commit/65a7c70a00
2022-01-17[ruby/erb] Revert "Remove safe_level and further positional arguments ↵Takashi Kokubun
(https://github.com/ruby/erb/pull/7)" This reverts commit https://github.com/ruby/erb/commit/5133efa06f0603ae79292f3b2b942957bc8a442e. While we already handled this deprecation in many libraries, we noticed that some (e.g. sprockets) relied on the format of `ERB.version` and https://github.com/ruby/erb/commit/2b4182eb108b9e42fa30bcfa41931896132f88b8 broke such handling. Given that the `ERB.version` change was released at 3.1 and it's obviously new, I'll skip this removal in 3.2 and postpone this to a future version.
2022-01-16[ruby/erb] Remove safe_level and further positional arguments ↵Takashi Kokubun
(https://github.com/ruby/erb/pull/7) [Feature #14256] https://github.com/ruby/erb/commit/5133efa06f
2021-01-21[ruby/erb] Warn safe_level and later args even without -wTakashi Kokubun
because, when Ruby 3.1 is released, Ruby 2.5, the last version with the old method signature, will have been EOL. Therefore we can safely warn the old interface from Ruby 3.1. https://github.com/ruby/erb/commit/c3a753f49f
2021-01-21[ruby/erb] Make sure erb.rb in this repository is testedTakashi Kokubun
https://github.com/ruby/erb/commit/012faba2e5
2021-01-20[ruby/erb] Prefer __dir__ to reduce ../Takashi Kokubun
https://github.com/ruby/erb/commit/cb59f11ec8
2021-01-20Pend erb command tests for Ruby 2.5 for nowTakashi Kokubun
2020-08-21Fixup 3292f4d965845d543733559fd1736b8c42fadab3Hiroshi SHIBATA
2020-08-21Fixed the executable path for erb commandHiroshi SHIBATA
2019-07-04Suppress uninitialized instance variable warningsNobuyoshi Nakada
2019-03-28erb.rb: prohibit marshaling [EXPERIMENTAL]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-29erb.rb: increase warn level only when non-zero safe_levelk0kubun
is given. This is merging Eric's patch in [Bug #15479] to Ruby 2.6's behavior in r66631. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-29Revert "erb.rb: print deprecation warning with warn level 1"k0kubun
This reverts commit b5569b9ab2ad5e0e4a997df7eb73e97ecbacc9dd. The deprecation is indefinitely postponed. [Bug #15478] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-25erb.rb: print deprecation warning with warn level 1k0kubun
This was planned to be removed in Ruby 2.7 at first, but I changed my mind to just keep warning it in Ruby 2.7. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-12erb.rb: warn invalid trim_mode [Misc #15294]k0kubun
From: Justin Collins <justin@presidentbeef.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13Rename test classes to allow stable test count when running test-all -jnobu
[Fix GH-1763] From: MSP-Greg <MSP-Greg@users.noreply.github.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-24lib/erb.rb: Add uplevel to warnkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-22erb.rb: deprecate safe_level of ERB.newk0kubun
Also, as it's in the middle of the list of 4 arguments, 3rd and 4th arguments (trim_mode, eoutvar) are changed to keyword arguments. Old ways to specify arguments are deprecated and warned now. bin/erb: deprecate -S option. We'll remove all of deprecated ones at Ruby 2.7+. enc/make_encmake.rb: stopped using deprecated interface ext/etc/mkconstants.rb: ditto ext/socket/mkconstants.rb: ditto sample/ripper/ruby2html.rb: ditto spec/ruby/library/erb/defmethod/def_erb_method_spec.rb: ditto spec/ruby/library/erb/new_spec.rb: ditto test/erb/test_erb.rb: ditto test/erb/test_erb_command.rb: ditto tool/generic_erb.rb: ditto tool/ruby_vm/helpers/dumper.rb: ditto tool/transcode-tblgen.rb: ditto lib/rdoc/erbio.rb: ditto lib/rdoc/generator/darkfish.rb: ditto [Feature #14256] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-27erb.rb: preserve the behavior for invalid syntaxk0kubun
comment. Fix regression at r58948. I even don't want to deprecate it because deprecation needs to lex all embedded Ruby script using Ripper and it would be slow. So Let me just keep this behavior of Ruby 2.4. No change is the best compatibility. This commit stopped using String#-@ because it's harmful for "ambiguous first argument" warning if we really want to maintain this behavior. [Bug #14243] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22erb.rb: shadow by keysnobu
* lib/erb.rb (ERB#new_toplevel): shadow already defined local variables by block local variabes, not to overwrite them. [ruby-core:84390] [Bug #14215] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-21fix test_erb.rb [GH-1763]nobu
* test/erb/test_erb.rb (test_run): require stringio. suppress an unused variable warning. From: MSP-Greg <MSP-Greg@users.noreply.github.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-10bin/erb: change template file encoding to UTF-8k0kubun
Unlike Ruby source file encoding (script encoding) whose default is changed to UTF-8 in Ruby 2.0 (Feature #6679), template's file encoding given to erb(1) has been ASCII-8BIT since ERB supports m17n at r21170. Like Ruby source file encoding, erb template file encoding should be UTF-8 in Ruby 2. [Bug #14095] [ruby-core:83708] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-26test_erb.rb: add test cases for uncovered methodsk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29test/erb/test_erb.rb: Fix unused variable warningk0kubun
ruby/test/erb/test_erb.rb:575: warning: assigned but unused variable - foo git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-25erb.rb: Add ERB#result_with_hashk0kubun
[ruby-core:55985] [Feature #8631] [fix GH-1623] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20erb.rb: Allow trimming CR in all trim_modesk0kubun
to unify a behavior with r58823 and r58825. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20erb.rb: Allow explicit trimming carriage returnk0kubun
when trim_mode is "-", for Windows environments. [ruby-core:39625] [Bug #5339] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20erb.rb: Allow trimming carriage returnk0kubun
when trim_mode is "<>", for Windows environments. [Bug #11464] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-17erb.rb: Don't encode tilde in #url_encodek0kubun
Based on patch by madeofcode (Mark Dodwell). [ruby-core:46168] [Bug #6696] [Fix GH-54] `~` is a unreserved character. https://tools.ietf.org/html/rfc3986#section-2.3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-29erb.rb: fronzen-string-literal in comment [Fix GH-1229]nobu
* lib/erb.rb (ERB::Compiler#detect_magic_comment): allow fronzen-string-literal in comment as well as encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-29test_erb.rb: improve assertionsnobu
* test/erb/test_erb.rb: improve failure messages with assert_respond_to and assert_not_respond_to. * test/erb/test_erb.rb: use assert_raise instead of assert(false). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-29erb.rb: frozen-string-literal safenobu
* lib/erb.rb (ERB#set_eoutvar): explicitly make mutable string as a buffer to make ERB work with --enable-frozen-string-literal. [ruby-core:73561] [Bug #12031] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-29test_erb.rb: escapenobu
* test/erb/test_erb.rb (test_token_extension): escape % in dedented heredoc for editors which do not support this syntax yet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-02Allow ERB subclass to add token easily. [Feature #11936]seki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-18* include/ruby/ruby.h: $SAFE=2 is now obsolete.hsbt
* dir.c, ext/fiddle/handle.c, ext/socket/basicsocket.c, file.c gc.c, io.c, process.c, safe.c, signal.c, win32/file.c: removed code for $SAFE=2 * test/erb/test_erb.rb, test/fiddle/test_handle.rb test/ruby/test_env.rb: removed tests for $SAFE=2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-17* include/ruby/ruby.h: $SAFE=3 is now obsolete.hsbt
* ext/socket/init.c, ext/socket/socket.c, ext/socket/tcpsocket.c ext/socket/udpsocket.c, gc.c, object.c, re.c, safe.c: removed code for $SAFE=3 * bootstraptest/test_method.rb, test/erb/test_erb.rb, test/ruby/test_dir.rb test/ruby/test_file.rb, test/ruby/test_method.rb, test/ruby/test_regexp.rb test/ruby/test_thread.rb: remove tests for $SAFE=3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-12erb: suppress warningsnobu
* bin/erb (ERB::Main#run): get rid of shadowing outer local variables. [ruby-core:65772] [Feature #10395] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-12erb: set variables from the command linenobu
* bin/erb (ARGV.switch, ERB::Main#run): allow variables to be set from the command line. [ruby-core:65772] [Feature #10395] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-12erb: lineno and location settersnobu
* lib/erb.rb (ERB#lineno): accessor for line number to eval. * lib/erb.rb (ERB#location=): setter of file name and line number. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-25fix encoding specnobu
"UTF-8" is invalid encoding name in Emacs, use "utf-8" instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo
when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-07test: remove or replace trailing spacesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-09erb.rb: safe concurrent usenobu
* lib/erb.rb (ERB#run, ERB#result): eval under isolated bindings for safe concurrent use. [ruby-core:47638] [Bug #7046] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-21* lib/cgi/util.rb (CGI.escapeHTML): use &#39;naruse
[ruby-core:47221] [Bug #6861] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e