ruby-changes:52223
From: nagachika <ko1@a...>
Date: Sat, 18 Aug 2018 12:07:20 +0900 (JST)
Subject: [ruby-changes:52223] nagachika:r64431 (ruby_2_5): merge revision(s) 63512, 63514: [Backport #14790]
nagachika 2018-08-18 12:07:15 +0900 (Sat, 18 Aug 2018) New Revision: 64431 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64431 Log: merge revision(s) 63512,63514: [Backport #14790] time.rb: fix parsing time zone in iso8601 * lib/time.rb (Time.xmlschema): a colon in time zone designator can be omitted. [ruby-core:87277] [Bug #14790] time.rb: fix parsing time zone in iso8601 * lib/time.rb (Time.xmlschema): the minute in time zone designator can be omitted together with the preceding colon. [ruby-core:87277] [Bug #14790] Modified directories: branches/ruby_2_5/ Modified files: branches/ruby_2_5/lib/time.rb branches/ruby_2_5/test/test_time.rb branches/ruby_2_5/version.h Index: ruby_2_5/version.h =================================================================== --- ruby_2_5/version.h (revision 64430) +++ ruby_2_5/version.h (revision 64431) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_5/version.h#L1 #define RUBY_VERSION "2.5.2" #define RUBY_RELEASE_DATE "2018-08-18" -#define RUBY_PATCHLEVEL 74 +#define RUBY_PATCHLEVEL 75 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 8 Index: ruby_2_5/test/test_time.rb =================================================================== --- ruby_2_5/test/test_time.rb (revision 64430) +++ ruby_2_5/test/test_time.rb (revision 64431) @@ -105,6 +105,8 @@ class TestTimeExtension < Test::Unit::Te https://github.com/ruby/ruby/blob/trunk/ruby_2_5/test/test_time.rb#L105 t = Time.utc(1996, 12, 20, 0, 39, 57) s = "1996-12-19T16:39:57-08:00" assert_equal(t, Time.__send__(method, s)) + assert_equal(t, Time.__send__(method, s.sub(/:(?=00\z)/, ''))) + assert_equal(t, Time.__send__(method, s.sub(/:00\z/, ''))) # There is no way to generate time string with arbitrary timezone. s = "1996-12-20T00:39:57Z" assert_equal(t, Time.__send__(method, s)) Index: ruby_2_5/lib/time.rb =================================================================== --- ruby_2_5/lib/time.rb (revision 64430) +++ ruby_2_5/lib/time.rb (revision 64431) @@ -575,7 +575,7 @@ class Time https://github.com/ruby/ruby/blob/trunk/ruby_2_5/lib/time.rb#L575 T (\d\d):(\d\d):(\d\d) (\.\d+)? - (Z|[+-]\d\d:\d\d)? + (Z|[+-]\d\d(?::?\d\d)?)? \s*\z/ix =~ date year = $1.to_i mon = $2.to_i Index: ruby_2_5 =================================================================== --- ruby_2_5 (revision 64430) +++ ruby_2_5 (revision 64431) Property changes on: ruby_2_5 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r63512,63514 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/