ruby-changes:47281
From: nagachika <ko1@a...>
Date: Sun, 23 Jul 2017 16:20:12 +0900 (JST)
Subject: [ruby-changes:47281] nagachika:r59396 (ruby_2_4): merge revision(s) 58552: [Backport #13531]
nagachika 2017-07-23 16:20:05 +0900 (Sun, 23 Jul 2017) New Revision: 59396 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59396 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_4/ Modified files: branches/ruby_2_4/lib/rss/rss.rb branches/ruby_2_4/test/rss/test_to_s.rb branches/ruby_2_4/version.h Index: ruby_2_4/test/rss/test_to_s.rb =================================================================== --- ruby_2_4/test/rss/test_to_s.rb (revision 59395) +++ ruby_2_4/test/rss/test_to_s.rb (revision 59396) @@ -109,6 +109,30 @@ module RSS https://github.com/ruby/ruby/blob/trunk/ruby_2_4/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_4/version.h =================================================================== --- ruby_2_4/version.h (revision 59395) +++ ruby_2_4/version.h (revision 59396) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #define RUBY_VERSION "2.4.2" #define RUBY_RELEASE_DATE "2017-07-23" -#define RUBY_PATCHLEVEL 147 +#define RUBY_PATCHLEVEL 148 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 7 Index: ruby_2_4/lib/rss/rss.rb =================================================================== --- ruby_2_4/lib/rss/rss.rb (revision 59395) +++ ruby_2_4/lib/rss/rss.rb (revision 59396) @@ -957,7 +957,7 @@ EOC https://github.com/ruby/ruby/blob/trunk/ruby_2_4/lib/rss/rss.rb#L957 children = child children.any? {|c| c.have_required_elements?} else - !child.to_s.empty? + not child.nil? end else true Index: ruby_2_4 =================================================================== --- ruby_2_4 (revision 59395) +++ ruby_2_4 (revision 59396) Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r58552 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/