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

ruby-changes:51934

From: usa <ko1@a...>
Date: Tue, 31 Jul 2018 23:12:14 +0900 (JST)
Subject: [ruby-changes:51934] usa:r64148 (ruby_2_4): merge revision(s) 63512, 63514: [Backport #14790]

usa	2018-07-31 23:12:08 +0900 (Tue, 31 Jul 2018)

  New Revision: 64148

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64148

  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_4/
  Modified files:
    branches/ruby_2_4/lib/time.rb
    branches/ruby_2_4/test/test_time.rb
    branches/ruby_2_4/version.h
Index: ruby_2_4/lib/time.rb
===================================================================
--- ruby_2_4/lib/time.rb	(revision 64147)
+++ ruby_2_4/lib/time.rb	(revision 64148)
@@ -575,7 +575,7 @@ class Time https://github.com/ruby/ruby/blob/trunk/ruby_2_4/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_4/test/test_time.rb
===================================================================
--- ruby_2_4/test/test_time.rb	(revision 64147)
+++ ruby_2_4/test/test_time.rb	(revision 64148)
@@ -105,6 +105,8 @@ class TestTimeExtension < Test::Unit::Te https://github.com/ruby/ruby/blob/trunk/ruby_2_4/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_4/version.h
===================================================================
--- ruby_2_4/version.h	(revision 64147)
+++ ruby_2_4/version.h	(revision 64148)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1
 #define RUBY_VERSION "2.4.5"
 #define RUBY_RELEASE_DATE "2018-07-31"
-#define RUBY_PATCHLEVEL 313
+#define RUBY_PATCHLEVEL 314
 
 #define RUBY_RELEASE_YEAR 2018
 #define RUBY_RELEASE_MONTH 7
Index: ruby_2_4
===================================================================
--- ruby_2_4	(revision 64147)
+++ ruby_2_4	(revision 64148)

Property changes on: ruby_2_4
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r63512,63514

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

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