ruby-changes:47121
From: usa <ko1@a...>
Date: Fri, 30 Jun 2017 21:48:32 +0900 (JST)
Subject: [ruby-changes:47121] usa:r59236 (ruby_2_3): merge revision(s) 58552: [Backport #13531]
usa 2017-06-30 21:48:27 +0900 (Fri, 30 Jun 2017) New Revision: 59236 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59236 Log: merge revision(s) 58552: [Backport #13531] rss: Accept empty text element as valid element Parser has been accepted it but XML serializer wasn't accepted. Reported by stefano frabetti. Thanks!!! [ruby-core:80965] [Bug #13531] Modified directories: branches/ruby_2_3/ Modified files: branches/ruby_2_3/ChangeLog branches/ruby_2_3/lib/rss/rss.rb branches/ruby_2_3/test/rss/test_to_s.rb branches/ruby_2_3/version.h Index: ruby_2_3/lib/rss/rss.rb =================================================================== --- ruby_2_3/lib/rss/rss.rb (revision 59235) +++ ruby_2_3/lib/rss/rss.rb (revision 59236) @@ -963,7 +963,7 @@ EOC https://github.com/ruby/ruby/blob/trunk/ruby_2_3/lib/rss/rss.rb#L963 children = child children.any? {|c| c.have_required_elements?} else - !child.to_s.empty? + not child.nil? end else true Index: ruby_2_3/version.h =================================================================== --- ruby_2_3/version.h (revision 59235) +++ ruby_2_3/version.h (revision 59236) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1 #define RUBY_VERSION "2.3.5" #define RUBY_RELEASE_DATE "2017-06-30" -#define RUBY_PATCHLEVEL 332 +#define RUBY_PATCHLEVEL 333 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 6 Index: ruby_2_3/ChangeLog =================================================================== --- ruby_2_3/ChangeLog (revision 59235) +++ ruby_2_3/ChangeLog (revision 59236) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1 +Fri Jun 30 21:46:50 2017 Kouhei Sutou <kou@c...> + + * lib/rss/rss.rb: Accept empty text element as valid element + Parser has been accepted it but XML serializer wasn't accepted. + Reported by stefano frabetti. Thanks!!! + [Bug #13531] + Fri Jun 30 21:40:42 2017 Kazuki Yamaguchi <k@r...> * ext/openssl/ossl_x509store.c: clear error queue after calling Index: ruby_2_3/test/rss/test_to_s.rb =================================================================== --- ruby_2_3/test/rss/test_to_s.rb (revision 59235) +++ ruby_2_3/test/rss/test_to_s.rb (revision 59236) @@ -109,6 +109,30 @@ module RSS https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/rss/test_to_s.rb#L109 '[ruby-core:70667] [Bug #11509]') end + def test_20_empty_text + title = "Blog entries" + link = "http://blog.example.com/" + description = "" + rss = RSS::Maker.make("2.0") do |maker| + maker.channel.title = title + maker.channel.link = link + maker.channel.description = description + end + + parsed_rss = RSS::Parser.parse(rss.to_s) + assert_equal({ + title: title, + link: link, + description: description, + }, + { + title: parsed_rss.channel.title, + link: parsed_rss.channel.link, + description: parsed_rss.channel.description, + }, + "[ruby-core:80965] [Bug #13531]") + end + private def setup_xml_declaration_info @version = "1.0" Index: ruby_2_3 =================================================================== --- ruby_2_3 (revision 59235) +++ ruby_2_3 (revision 59236) Property changes on: ruby_2_3 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r58552 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/