aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erb.rb
Commit message (Collapse)AuthorAgeFilesLines
* erb.rb: fronzen-string-literal in comment [Fix GH-1229]nobu2016-01-291-12/+19
| | | | | | | * 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
* erb.rb: duplicated magic comments [Fix GH-1229]nobu2016-01-291-3/+2
| | | | | | | | * lib/erb.rb (ERB#def_method): insert def line just before the first non-comment and non-empty line, not to leave duplicated and stale magic comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* erb.rb: frozen-string-literal safenobu2016-01-291-3/+3
| | | | | | | | * 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
* Allow ERB subclass to add token easily. [Feature #11936]seki2016-01-021-54/+77
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb: revert r53123. It break compatibility like thor and rspec-rails.hsbt2015-12-201-5/+5
| | | | | | | | | We should try with Ruby 2.4 or 3.0. [Bug #11842][ruby-core:72374] * lib/rdoc/erb_partial.rb: ditto. * template/verconf.h.tmpl: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | 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
* * lib/erb.rb: Render erb with array buffer for function call optimization.hsbt2015-12-151-5/+5
| | | | | | | | [fix GH-1143] * lib/rdoc/erb_partial.rb: ditto. * template/verconf.h.tmpl: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb: Simplify regexp to optimize erb scanner.hsbt2015-12-151-2/+2
| | | | | | [fix GH-1144] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* erb: set variables from the command linenobu2014-12-121-2/+5
| | | | | | | * 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
* erb: lineno and location settersnobu2014-12-121-2/+12
| | | | | | | * 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
* * lib/drb/acl.rb: Removed meaningless #to_s methods in interpolation.hsbt2014-08-271-1/+1
| | | | | | | | | | | | [Feature #10174][ruby-core:64584] * lib/erb.rb: ditto. * lib/observer.rb: ditto. * lib/rake/invocation_chain.rb: ditto. * lib/rubygems/command_manager.rb: ditto. * lib/rubygems/config_file.rb: ditto. * lib/uri/common.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cgi/core.rb: remove unused variables.hsbt2014-07-271-1/+1
| | | | | | | | | | | | | | | | * lib/erb.rb: ditto. * lib/mkmf.rb: ditto. * lib/net/http/response.rb: ditto. * lib/optparse/version.rb: ditto. * lib/prime.rb: ditto. * lib/racc/parser.rb: ditto. * lib/rexml/document.rb: ditto. * lib/rexml/dtd/dtd.rb: ditto. * lib/rexml/element.rb: ditto. * lib/rexml/functions.rb: ditto. * lib/rexml/parsers/xpathparser.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix encoding specnobu2014-07-251-1/+1
| | | | | | "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
* erb.rb: ERB#result does not accept a proc.nobu2014-05-301-1/+1
| | | | | | | * lib/erb.rb (result): [DOC] no longer accepts a Proc, as Kernel.eval does not. [fix GH-619] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb: [DOC] fix broken link.hsbt2013-12-061-1/+2
| | | | | | Use rubygems.org and www.ruby-toolbox.com instead of RAA. [Bug #9197] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cgi.rb: [DOC] Capitalize "Ruby" in documentation [Fixes GH-341]zzak2013-07-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | Patch by Dave Worth https://github.com/ruby/ruby/pull/341 * lib/webrick.rb: ditto * lib/scanf.rb: ditto * lib/xmlrpc/config.rb: ditto * lib/resolv.rb: ditto * lib/e2mmap.rb: ditto * lib/fileutils.rb: ditto * lib/mkmf.rb: ditto * lib/cgi/session.rb: ditto * lib/yaml.rb: ditto * lib/erb.rb: ditto * lib/irb.rb: ditto * lib/tracer.rb: ditto * lib/net/http.rb: ditto * ext/syslog/lib/syslog/logger.rb: ditto * sample/pty/expect_sample.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb (ERB::Util#url_encode): Unuse regexp special globalxibbar2013-07-161-2/+2
| | | | | | variable. [Feature #8648] Thanks to fotos. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cgi/util.rb, lib/erb.rb: Use String#b [Feature #8394] by znzzzak2013-06-021-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_env_size): Restored documentation for ENV.sizedrbrain2013-01-261-2/+8
| | | | | | | | | | | * lib/drb/drb.rb: Documented DRb::DRb#run. * lib/erb.rb (class ERB): Improved documentation of ERb. * transcode.c: Documented Encoding::Converter constants. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb: typos for ERB::new linkzzak2012-12-231-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb: Document ERB::new trim_mode '-' for lines ending in -%>zzak2012-12-231-0/+1
| | | | | | | [ruby-core:51084] [Bug #7608] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.nobu2012-12-051-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb (make_compiler, add_put_cmd, add_insert_cmd): extractseki2012-12-041-16/+20
| | | | | | | | methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* erb.rb: safe concurrent usenobu2012-11-091-2/+9
| | | | | | | * 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
* * lib/erb.rb (ERB::Util.html_escape): fix r36687: call to_s beforenaruse2012-08-141-1/+1
| | | | | | passing it to CGI.escapeHTML. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb (ERB::Util.html_escape): use CGI.escape to escapeshugo2012-08-131-1/+3
| | | | | | single quotes. [ruby-core:47138] [Bug #6861] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb: Restore documentation for ERB::Util and ERB::DefMethoddrbrain2011-05-241-2/+2
| | | | | | | (oops). [Ruby 1.9 - Bug #4694] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb: Hide documentation for implementation details of ERB.drbrain2011-05-241-4/+5
| | | | | | | [Ruby 1.9 - Bug #4694] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib: revert r31635-r31638 and untabify with expand(1).nobu2011-05-191-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib: Convert tabs to spaces for ruby files perdrbrain2011-05-181-142/+142
| | | | | | | | | http://redmine.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#coding-style Patch by Steve Klabnik [Ruby 1.9 - Bug #4730] Patch by Jason Dew [Ruby 1.9 - Feature #4718] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.nobu2011-05-151-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb: Document ERB::Compiler. Patch by Simon Chiang.drbrain2011-05-141-6/+91
| | | | | | | [Ruby 1.9 - Bug #4694] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * {ext,lib,test}/**/*.rb: removed trailing spaces.nobu2009-03-061-64/+64
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove PercentScanner. fixed % after %> bug. [ruby-dev:37751] [Bug #997]seki2009-01-111-34/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merged r20850, r17881, r16811, r16763, r16748, r15829, r15794 and r15698 ↵seki2009-01-031-118/+187
| | | | | | from ruby_1_8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb (ERB): m17n of ERB. adds rdoc.yugui2008-12-291-6/+45
| | | | | | | | | | | | | | | | | | | | | | fixes #712. c.f. [ruby-dev:37516]. * lib/erb.rb (ERB::Compiler#compile): recognizes magic comments. returns a pair of compiled script and its script encoding. * lib/erb.rb (ERB#set_eoutvar): make generated scripts return a string in correct encoding. * lib/erb.rb (ERB#def_method): use Kernel#eval for encoding-awareness of the evaluated string. * bin/erb.rb (ERB::Main.run): adds -E and -U options. String is no longer Enumerable. * man/erb.1: new manapage. * test/erb/test_erb_m17n.rb: new test case for m17n features. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb: adjust line number for magic comment.kazu2008-06-271-3/+3
| | | | | | | * test/erb/test_erb.rb: add tests for def_method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb (ERB::Compiler:Buffer#new): push magic comment first.naruse2008-06-251-5/+4
| | | | | | * lib/erb.rb (ERB::Compiler#compile): fix for broken input. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb (ERB::Compiler#compile): magic comment needs LF.naruse2008-06-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb (ERB::Compiler#compile): output magic comment.naruse2008-06-251-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rdoc.rb: massive spelling correction patch from Evan Farrarmatz2008-06-041-1/+1
| | | | | | <evanfarrar at gmail.com> in [ruby-doc:1382] applied. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb (ERB::Compiler::TrimScanner#scan_line): Oops. Thisknu2008-06-021-6/+4
| | | | | | | change did not apply to trunk. Backed out. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb (ERB::Compiler::TrimScanner#scan_line): Fix a bugknu2008-06-021-4/+6
| | | | | | | | | | | where tokens are not yilelded one by one. * test/erb/test_erb.rb (TestERBCore#_test_01) (TestERBCore#test_02_safe_04): The expected value should come first for assert_equal(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [ruby-dev:34497] ERB::Util#url_encode bug fix. Reported by rubikitch.seki2008-04-301-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb (ERB::Revision): cut off locale dependent string in Dateakr2008-01-061-1/+1
| | | | | | | keyword. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb: String#each was removed, use #each_line instead.aamine2006-10-171-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* (ERB::Compiler): add instance variable @insert_cmd to change <%='s behavior.seki2006-01-101-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* make module_functionseki2005-02-121-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_read): move StringValue() check before GetOpenFile().matz2004-11-251-15/+364
| | | | | | | [ruby-dev:24959] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * MANIFEST: add test_erb.rbseki2004-02-281-1/+1
| | | | | | | | * lib/erb.rb, test/erb/test_erb.rb: don't forget filename, if both filename and safe_level given. [ruby-dev:23050] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e