From 67e544cbe15abb852742236f9de1b3b9a9add676 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada 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 --- ext/date/date_core.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/ext/date/date_core.c b/ext/date/date_core.c index 666f278a9b..ed7bff04db 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) * 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) * 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) * 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 v1.2.3