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

ruby-changes:61877

From: Nobuyoshi <ko1@a...>
Date: Sun, 21 Jun 2020 16:19:25 +0900 (JST)
Subject: [ruby-changes:61877] 67e544cbe1 (master): [ruby/date] [DOC] Emphasized that `parse` methods are not validators

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

From 67e544cbe15abb852742236f9de1b3b9a9add676 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 20 Jun 2020 18:26:12 +0900
Subject: [ruby/date] [DOC] Emphasized that `parse` methods are not validators

https://github.com/ruby/date/commit/81a057db11

diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index 666f278..ed7bff0 100644
--- a/ext/date/date_core.c
+++ b/ext/date/date_core.c
@@ -4345,8 +4345,11 @@ date_s__parse_internal(int argc, VALUE *argv, VALUE klass) https://github.com/ruby/ruby/blob/trunk/ext/date/date_core.c#L4345
  *    Date._parse(string[, comp=true])  ->  hash
  *
  * Parses the given representation of date and time, and returns a
- * hash of parsed elements.  This method does not function as a
- * validator.
+ * hash of parsed elements.
+ *
+ * This method **does not** function as a validator.  If the input
+ * string does not match valid formats strictly, you may get a cryptic
+ * result.
  *
  * If the optional second argument is true and the detected year is in
  * the range "00" to "99", considers the year a 2-digit form and makes
@@ -4365,7 +4368,11 @@ date_s__parse(int argc, VALUE *argv, VALUE klass) https://github.com/ruby/ruby/blob/trunk/ext/date/date_core.c#L4368
  *    Date.parse(string='-4712-01-01'[, comp=true[, start=Date::ITALY]])  ->  date
  *
  * Parses the given representation of date and time, and creates a
- * date object.  This method does not function as a validator.
+ * date object.
+ *
+ * This method **does not** function as a validator.  If the input
+ * string does not match valid formats strictly, you may get a cryptic
+ * result.
  *
  * If the optional second argument is true and the detected year is in
  * the range "00" to "99", considers the year a 2-digit form and makes
@@ -8001,7 +8008,11 @@ datetime_s_strptime(int argc, VALUE *argv, VALUE klass) https://github.com/ruby/ruby/blob/trunk/ext/date/date_core.c#L8008
  *    DateTime.parse(string='-4712-01-01T00:00:00+00:00'[, comp=true[, start=Date::ITALY]])  ->  datetime
  *
  * Parses the given representation of date and time, and creates a
- * DateTime object.  This method does not function as a validator.
+ * DateTime object.
+ *
+ * This method **does not** function as a validator.  If the input
+ * string does not match valid formats strictly, you may get a cryptic
+ * result.
  *
  * If the optional second argument is true and the detected year is in
  * the range "00" to "99", makes it full.
-- 
cgit v0.10.2


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

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