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

ruby-changes:39896

From: usa <ko1@a...>
Date: Tue, 29 Sep 2015 17:34:24 +0900 (JST)
Subject: [ruby-changes:39896] usa:r51977 (ruby_2_1): merge revision(s) 51766, 51767: [Backport #11509]

usa	2015-09-29 17:34:18 +0900 (Tue, 29 Sep 2015)

  New Revision: 51977

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

  Log:
    merge revision(s) 51766,51767: [Backport #11509]
    
    * lib/rss/rss.rb (Time#w3cdtf): fix zero-trimmed width of fraction
      digits.  [ruby-core:70667] [Bug #11509]

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/lib/rss/rss.rb
    branches/ruby_2_1/test/rss/test_to_s.rb
    branches/ruby_2_1/version.h
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 51976)
+++ ruby_2_1/ChangeLog	(revision 51977)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Tue Sep 29 17:33:13 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/rss/rss.rb (Time#w3cdtf): fix zero-trimmed width of fraction
+	  digits.  [ruby-core:70667] [Bug #11509]
+
 Tue Sep 29 17:25:14 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* re.c (rb_memsearch_wchar, rb_memsearch_qchar): test matching
Index: ruby_2_1/lib/rss/rss.rb
===================================================================
--- ruby_2_1/lib/rss/rss.rb	(revision 51976)
+++ ruby_2_1/lib/rss/rss.rb	(revision 51977)
@@ -53,7 +53,7 @@ class Time https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rss/rss.rb#L53
       if usec.zero?
         fraction_digits = 0
       else
-        fraction_digits = Math.log10(usec.to_s.sub(/0*$/, '').to_i).floor + 1
+        fraction_digits = strftime('%6N').index(/0*\z/)
       end
       xmlschema(fraction_digits)
     end
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 51976)
+++ ruby_2_1/version.h	(revision 51977)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.8"
 #define RUBY_RELEASE_DATE "2015-09-29"
-#define RUBY_PATCHLEVEL 403
+#define RUBY_PATCHLEVEL 404
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 9
Index: ruby_2_1/test/rss/test_to_s.rb
===================================================================
--- ruby_2_1/test/rss/test_to_s.rb	(revision 51976)
+++ ruby_2_1/test/rss/test_to_s.rb	(revision 51977)
@@ -102,6 +102,12 @@ module RSS https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/rss/test_to_s.rb#L102
       assert_textinput20(@textinput_info, rss.textinput)
     end
 
+    def test_time_w3cdtf
+      assert_equal("2015-09-05T01:25:48.0001Z",
+                   Time.utc(2015, 9, 5, 1, 25, 48, 100).w3cdtf,
+                   '[ruby-core:70667] [Bug #11509]')
+    end
+
     private
     def setup_xml_declaration_info
       @version = "1.0"

Property changes on: ruby_2_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r51766-51767


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

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