[前][次][番号順一覧][スレッド一覧]

ruby-changes:61702

From: usa <ko1@a...>
Date: Sun, 14 Jun 2020 01:03:26 +0900 (JST)
Subject: [ruby-changes:61702] a7acd35380 (ruby_2_5): merge revision(s) 7e289cdf3fed588b2d5a6973e29f9ff95cb8d76c: [Backport #16949]

https://git.ruby-lang.org/ruby.git/commit/?id=a7acd35380

From a7acd35380ff97d030ac8f334562cb3ab05ec274 Mon Sep 17 00:00:00 2001
From: usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Sat, 13 Jun 2020 16:03:14 +0000
Subject: merge revision(s) 7e289cdf3fed588b2d5a6973e29f9ff95cb8d76c: [Backport
 #16949]

[ruby/psych] Fixing compatibility with libyaml 0.2.5

The main issue is that commas aren't allowed in local tags.  libyaml
was updated to follow the spec, and our tests were out of date.

See: https://github.com/yaml/libyaml/issues/196

https://github.com/ruby/psych/commit/3f5e520fd3

Note that this is not security fix, but need for release processs.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

diff --git a/test/psych/test_nil.rb b/test/psych/test_nil.rb
index 910a2e6..bcbbcb9 100644
--- a/test/psych/test_nil.rb
+++ b/test/psych/test_nil.rb
@@ -5,13 +5,13 @@ module Psych https://github.com/ruby/ruby/blob/trunk/test/psych/test_nil.rb#L5
   class TestNil < TestCase
     def test_nil
       yml = Psych.dump nil
-      assert_match(/--- \n(?:\.\.\.\n)?/, yml)
+      assert_match(/---[ ]?\n(?:\.\.\.\n)?/, yml)
       assert_nil Psych.load(yml)
     end
 
     def test_array_nil
       yml = Psych.dump [nil]
-      assert_equal "---\n- \n", yml
+      assert_match(/---\n-[ ]?\n/, yml)
       assert_equal [nil], Psych.load(yml)
     end
 
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb
index 2812fd1..9472d8e 100644
--- a/test/psych/test_psych.rb
+++ b/test/psych/test_psych.rb
@@ -121,17 +121,17 @@ class TestPsych < Psych::TestCase https://github.com/ruby/ruby/blob/trunk/test/psych/test_psych.rb#L121
 
   def test_domain_types
     got = nil
-    Psych.add_domain_type 'foo.bar,2002', 'foo' do |type, val|
+    Psych.add_domain_type 'foo.bar/2002', 'foo' do |type, val|
       got = val
     end
 
-    Psych.load('--- !foo.bar,2002/foo hello')
+    Psych.load('--- !foo.bar/2002:foo hello')
     assert_equal 'hello', got
 
-    Psych.load("--- !foo.bar,2002/foo\n- hello\n- world")
+    Psych.load("--- !foo.bar/2002:foo\n- hello\n- world")
     assert_equal %w{ hello world }, got
 
-    Psych.load("--- !foo.bar,2002/foo\nhello: world")
+    Psych.load("--- !foo.bar/2002:foo\nhello: world")
     assert_equal({ 'hello' => 'world' }, got)
   end
 
@@ -170,16 +170,13 @@ class TestPsych < Psych::TestCase https://github.com/ruby/ruby/blob/trunk/test/psych/test_psych.rb#L170
     types = []
     appender = lambda { |*args| types << args }
 
-    Psych.add_builtin_type('foo', &appender)
-    Psych.add_domain_type('example.com,2002', 'foo', &appender)
+    Psych.add_domain_type('example.com:2002', 'foo', &appender)
     Psych.load <<-eoyml
-- !tag:yaml.org,2002:foo bar
-- !tag:example.com,2002:foo bar
+- !tag:example.com:2002:foo bar
     eoyml
 
     assert_equal [
-      ["tag:yaml.org,2002:foo", "bar"],
-      ["tag:example.com,2002:foo", "bar"]
+      ["tag:example.com:2002:foo", "bar"]
     ], types
   end
 
diff --git a/test/psych/test_yaml.rb b/test/psych/test_yaml.rb
index 5fa759c..0dfd60f 100644
--- a/test/psych/test_yaml.rb
+++ b/test/psych/test_yaml.rb
@@ -617,11 +617,11 @@ EOY https://github.com/ruby/ruby/blob/trunk/test/psych/test_yaml.rb#L617
                 raise ArgumentError, "Not a Hash in domain.tld,2002/invoice: " + val.inspect
             end
         }
-        Psych.add_domain_type( "domain.tld,2002", 'invoice', &customer_proc )
-        Psych.add_domain_type( "domain.tld,2002", 'customer', &customer_proc )
+        Psych.add_domain_type( "domain.tld/2002", 'invoice', &customer_proc )
+        Psych.add_domain_type( "domain.tld/2002", 'customer', &customer_proc )
 		assert_parse_only( { "invoice"=> { "customers"=> [ { "given"=>"Chris", "type"=>"domain customer", "family"=>"Dumars" } ], "type"=>"domain invoice" } }, <<EOY
 # 'http://domain.tld,2002/invoice' is some type family.
-invoice: !domain.tld,2002/invoice
+invoice: !domain.tld/2002:invoice
   # 'seq' is shorthand for 'http://yaml.org/seq'.
   # This does not effect '^customer' below
   # because it is does not specify a prefix.
@@ -705,7 +705,7 @@ EOY https://github.com/ruby/ruby/blob/trunk/test/psych/test_yaml.rb#L705
 	end
 
 	def test_spec_explicit_families
-        Psych.add_domain_type( "somewhere.com,2002", 'type' ) { |type, val|
+        Psych.add_domain_type( "somewhere.com/2002", 'type' ) { |type, val|
             "SOMEWHERE: #{val}"
         }
 		assert_parse_only(
@@ -717,7 +717,7 @@ picture: !binary | https://github.com/ruby/ruby/blob/trunk/test/psych/test_yaml.rb#L717
  Pz7Y6OjuDg4J+fn5OTk6enp
  56enmleECcgggoBADs=
 
-hmm: !somewhere.com,2002/type |
+hmm: !somewhere.com/2002:type |
  family above is short for
  http://somewhere.com/type
 EOY
@@ -726,7 +726,7 @@ EOY https://github.com/ruby/ruby/blob/trunk/test/psych/test_yaml.rb#L726
 
 	def test_spec_application_family
 		# Testing the clarkevans.com graphs
-		Psych.add_domain_type( "clarkevans.com,2002", 'graph/shape' ) { |type, val|
+		Psych.add_domain_type( "clarkevans.com/2002", 'graph/shape' ) { |type, val|
 			if Array === val
 				val << "Shape Container"
 				val
@@ -743,13 +743,13 @@ EOY https://github.com/ruby/ruby/blob/trunk/test/psych/test_yaml.rb#L743
 				raise ArgumentError, "Invalid graph of type #{val.class}: " + val.inspect
 			end
 		}
-		Psych.add_domain_type( "clarkevans.com,2002", 'graph/circle', &one_shape_proc )
-		Psych.add_domain_type( "clarkevans.com,2002", 'graph/line', &one_shape_proc )
-		Psych.add_domain_type( "clarkevans.com,2002", 'graph/text', &one_shape_proc )
+		Psych.add_domain_type( "clarkevans.com/2002", 'graph/circle', &one_shape_proc )
+		Psych.add_domain_type( "clarkevans.com/2002", 'graph/line', &one_shape_proc )
+		Psych.add_domain_type( "clarkevans.com/2002", 'graph/text', &one_shape_proc )
         # MODIFIED to remove invalid Psych
 		assert_parse_only(
 			[[{"radius"=>7, "center"=>{"x"=>73, "y"=>129}, "TYPE"=>"Shape: graph/circle"}, {"finish"=>{"x"=>89, "y"=>102}, "TYPE"=>"Shape: graph/line", "start"=>{"x"=>73, "y"=>129}}, {"TYPE"=>"Shape: graph/text", "value"=>"Pretty vector drawing.", "start"=>{"x"=>73, "y"=>129}, "color"=>16772795}, "Shape Container"]], <<EOY
-- !clarkevans.com,2002/graph/shape
+- !clarkevans.com/2002:graph/shape
   - !/graph/circle
     center: &ORIGIN {x: 73, y: 129}
     radius: 7
@@ -771,8 +771,8 @@ EOY https://github.com/ruby/ruby/blob/trunk/test/psych/test_yaml.rb#L771
 # have the same type and value.
 - 10.0
 - !float 10
-- !yaml.org,2002/float '10'
-- !yaml.org,2002/float "\\
+- !yaml.org/2002/float '10'
+- !yaml.org/2002/float "\\
   1\\
   0"
 EOY
diff --git a/version.h b/version.h
index 4bae205..3c645a8 100644
--- a/version.h
+++ b/version.h
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L1
-#define RUBY_VERSION "2.5.8"
-#define RUBY_RELEASE_DATE "2020-03-31"
-#define RUBY_PATCHLEVEL 224
+#define RUBY_VERSION "2.5.9"
+#define RUBY_RELEASE_DATE "2020-06-14"
+#define RUBY_PATCHLEVEL 225
 
 #define RUBY_RELEASE_YEAR 2020
-#define RUBY_RELEASE_MONTH 3
-#define RUBY_RELEASE_DAY 31
+#define RUBY_RELEASE_MONTH 6
+#define RUBY_RELEASE_DAY 14
 
 #include "ruby/version.h"
 
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]