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

ruby-changes:10179

From: seki <ko1@a...>
Date: Thu, 22 Jan 2009 05:23:28 +0900 (JST)
Subject: [ruby-changes:10179] Ruby:r21723 (ruby_1_8): pass the trim_mode [Feature #1032]

seki	2009-01-22 05:22:29 +0900 (Thu, 22 Jan 2009)

  New Revision: 21723

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

  Log:
    pass the trim_mode  [Feature #1032]

  Added files:
    branches/ruby_1_8/test/erb/trim_hello.erb
  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/test/erb/test_erb.rb

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 21722)
+++ ruby_1_8/ChangeLog	(revision 21723)
@@ -1,3 +1,11 @@
+Thu Jan 22 05:17:06 2009  Masatoshi SEKI  <m_seki@m...>
+
+	* lib/erb.rb (def_erb_method): pass the trim_mode  [Feature #1032]
+
+	* test/erb/trim_hello.erb: ditto
+
+	* test/erb/test_erb.rb: ditto
+
 Wed Jan 21 17:25:41 2009  Yukihiro Matsumoto  <matz@r...>
 
 	* array.c (ary_double_capa): a new function to expand array more
Index: ruby_1_8/test/erb/trim_hello.erb
===================================================================
--- ruby_1_8/test/erb/trim_hello.erb	(revision 0)
+++ ruby_1_8/test/erb/trim_hello.erb	(revision 21723)
@@ -0,0 +1,4 @@
+= hello
+<%- 3.times do |n| -%>
+* <%= n %>
+<%- end -%>
Index: ruby_1_8/test/erb/test_erb.rb
===================================================================
--- ruby_1_8/test/erb/test_erb.rb	(revision 21722)
+++ ruby_1_8/test/erb/test_erb.rb	(revision 21723)
@@ -234,7 +234,19 @@
     klass.module_eval do
       def_erb_method('hello_world', erb)
     end
-    assert(klass.new.respond_to?('hello_world'))    
+    assert(klass.new.respond_to?('hello_world'))
+
+    klass.module_eval do
+      def_erb_method('trim_hello', File.join(File.dirname(File.expand_path(__FILE__)), 'trim_hello.erb'), '-')
+    end
+    assert(klass.new.respond_to?('trim_hello'))
+    ans = <<EOS
+= hello
+* 0
+* 1
+* 2
+EOS
+    assert_equal(ans, klass.new.trim_hello)
   end
 
   def test_escape

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

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