[前][次][番号順一覧][スレッド一覧]

ruby-changes:10264

From: seki <ko1@a...>
Date: Wed, 28 Jan 2009 01:18:35 +0900 (JST)
Subject: [ruby-changes:10264] Ruby:r21808 (ruby_1_8): pass the trim_mode [Feature #1032] [Bug #1062]

seki	2009-01-28 01:18:23 +0900 (Wed, 28 Jan 2009)

  New Revision: 21808

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21808

  Log:
    pass the trim_mode  [Feature #1032] [Bug #1062]

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/lib/erb.rb

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 21807)
+++ ruby_1_8/ChangeLog	(revision 21808)
@@ -1,3 +1,8 @@
+Wed Jan 28 01:16:50 2009  Masatoshi SEKI  <m_seki@m...>
+
+	* lib/erb.rb (def_erb_method): pass the trim_mode  [Feature #1032]
+	  [Bug #1062]
+
 Tue Jan 27 20:25:09 2009  Tanaka Akira  <akr@f...>
 
 	* lib/pathname.rb (Pathname#world_readable?): define only if
Index: ruby_1_8/lib/erb.rb
===================================================================
--- ruby_1_8/lib/erb.rb	(revision 21807)
+++ ruby_1_8/lib/erb.rb	(revision 21808)
@@ -847,10 +847,10 @@
   module DefMethod
     public
   # define _methodname_ as instance method of current module, using ERB object or eRuby file
-    def def_erb_method(methodname, erb_or_fname)
+    def def_erb_method(methodname, erb_or_fname, trim_mode=nil)
       if erb_or_fname.kind_of? String
         fname = erb_or_fname
-        erb = ERB.new(File.read(fname))
+        erb = ERB.new(File.read(fname), nil, trim_mode)
         erb.def_method(self, methodname, fname)
       else
         erb = erb_or_fname

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]