Bug #2546
REXMLでString::eachを使用しているため1.9でNo Method Error
| Status: | Closed | Start date: | 01/02/2010 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 100% |
|
| Category: | lib | |||
| Target version: | 2.0.0 | |||
| ruby -v: | ruby 1.9.2dev (2010-01-02 trunk 26229) |
Description
takkanm です。
RubySpecを動かしていて気付いたのですが、1.9に添付されているREXMLにてString::eachを使用していて1.9で動かない箇所(lib/rexml/text.rb)があります。
ソースを見ると以下のようにeach_lineに変更すれば問題ないようですが、いかがでしょうか?
--- a/lib/rexml/text.rb
+++ b/lib/rexml/text.rb
@@ -274,7 +274,7 @@ module REXML
def indent_text(string, level=1, style="\t", indentfirstline=true)
return string if level < 0
new_string = ''
- string.each { |line|
+ string.each_line { |line|
indent_string = style * level
new_line = (indent_string + line).sub(/[\s]+$/,'')
new_string << new_line
以上、よろしくお願いします。
Associated revisions
* lib/rexml/text.rb: String no longer has #each.
Patch by Mitsutaka Mimura (takkanm). [ruby-dev:39949].
History
Updated by yugui (Yuki Sonoda) over 2 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r26234. 三村, thank you for reporting this issue. Your contribution to Ruby is greatly appreciated. May Ruby be with you.