From: <nul...@cl...> - 2010-11-14 13:25:03
|
SHIBATA Hiroshi 2010-11-14 13:16:13 +0000 (Sun, 14 Nov 2010) New Revision: 3225d50a8a692f1bc018f230c985004f7400218f Log: use Enumerable for String#to_a Modified files: ChangeLog misc/lib/compatible.rb tdiary.rb Modified: ChangeLog (+4 -0) =================================================================== --- ChangeLog 2010-11-14 05:47:49 +0000 (fcb2424) +++ ChangeLog 2010-11-14 13:16:13 +0000 (223cad3) @@ -1,3 +1,7 @@ +2010-11-14 SHIBATA Hiroshi <shi...@gm...> + + * misc/lib/compatible.rb: use Enumerable for String#each and String#to_a in Ruby 1.9. + 2010-10-26 SHIBATA Hiroshi <shi...@gm...> * tdiary/dispatcher.rb: fixed header error on commented. Modified: misc/lib/compatible.rb (+1 -9) =================================================================== --- misc/lib/compatible.rb 2010-11-14 05:47:49 +0000 (a6274f7) +++ misc/lib/compatible.rb 2010-11-14 13:16:13 +0000 (0c5510f) @@ -20,15 +20,7 @@ Thread.start { end }.join -unless "".respond_to?('to_a') - class String - def to_a - [ self ] - end - end -end - -unless "".respond_to?('each') +unless "".respond_to?('to_a') && "".respond_to?('each') class String alias each each_line include Enumerable Modified: tdiary.rb (+1 -1) =================================================================== --- tdiary.rb 2010-11-14 05:47:49 +0000 (bd30ce1) +++ tdiary.rb 2010-11-14 13:16:13 +0000 (9aca376) @@ -7,7 +7,7 @@ Copyright (C) 2001-2010, TADA Tadashi <t...@td...> You can redistribute it and/or modify it under GPL2. =end -TDIARY_VERSION = '3.0.1.20101026' +TDIARY_VERSION = '3.0.1.20101114' $:.insert( 1, File::dirname( __FILE__ ).untaint + '/misc/lib' ) |