1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/rexml/text.rb (REXML::Text#<<): Support method chain use by "<<"

like other objects.
* test/rexml/test_text.rb (TextTester#test_shift_operator_chain):
  Add a test for the above case.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kou 2013-07-07 02:48:35 +00:00
parent afbc25c404
commit fbaec78eb3
2 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,10 @@
Sun Jul 7 11:43:13 2013 Kouhei Sutou <kou@cozmixng.org>
* lib/rexml/text.rb (REXML::Text#<<): Support method chain use by "<<"
like other objects.
* test/rexml/test_text.rb (TextTester#test_shift_operator_chain):
Add a test for the above case.
Sun Jul 7 11:34:18 2013 Kouhei Sutou <kou@cozmixng.org>
* lib/rexml/text.rb (REXML::Text#clear_cache): Extract common

View file

@ -186,8 +186,12 @@ module REXML
# Appends text to this text node. The text is appended in the +raw+ mode
# of this text node.
#
# +returns+ the text itself to enable method chain like
# 'text << "XXX" << "YYY"'.
def <<( to_append )
@string << to_append.gsub( /\r\n?/, "\n" )
self
end