[Hiki-cvs 1421] [968] * hiki/util.rb (unified_diff): use String#split(/^/) instead of

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 8月 15日 (土) 15:42:39 JST


Revision: 968
          http://sourceforge.jp/projects/hiki/svn/view?view=rev&revision=968
Author:   fdiary
Date:     2009-08-15 15:42:39 +0900 (Sat, 15 Aug 2009)

Log Message:
-----------
	* hiki/util.rb (unified_diff): use String#split(/^/) instead of
	String#to_a, that works on both (old) Ruby-1.8 and Ruby-1.9.

Modified Paths:
--------------
    hiki/trunk/ChangeLog
    hiki/trunk/hiki/util.rb

Modified: hiki/trunk/ChangeLog
===================================================================
--- hiki/trunk/ChangeLog	2009-08-15 06:14:06 UTC (rev 967)
+++ hiki/trunk/ChangeLog	2009-08-15 06:42:39 UTC (rev 968)
@@ -1,4 +1,7 @@
 2009-08-15  Kazuhiko  <kazuh****@fdiar*****>
+	* hiki/util.rb (unified_diff): use String#split(/^/) instead of
+	String#to_a, that works on both (old) Ruby-1.8 and Ruby-1.9.
+
 	* style/default/parser.rb (parse): use HikiDoc.to_html instead of
 	HikiDoc#to_html.
 

Modified: hiki/trunk/hiki/util.rb
===================================================================
--- hiki/trunk/hiki/util.rb	2009-08-15 06:14:06 UTC (rev 967)
+++ hiki/trunk/hiki/util.rb	2009-08-15 06:42:39 UTC (rev 968)
@@ -132,7 +132,7 @@
     end
 
     def unified_diff( src, dst, context_lines = 3 )
-      return Diff.new(src.to_a, dst.to_a).ses.unidiff( '', context_lines )
+      return Diff.new(src.split(/^/), dst.split(/^/)).ses.unidiff( '', context_lines )
     end
 
     def redirect(cgi, url, cookies = nil)




Hiki-cvs メーリングリストの案内
Back to archive index