ruby-changes:62661
From: Burdette <ko1@a...>
Date: Fri, 21 Aug 2020 02:10:07 +0900 (JST)
Subject: [ruby-changes:62661] 51525557fd (master): Partial compliance with doc/method_documentation.rdoc in string.c (#3436)
https://git.ruby-lang.org/ruby.git/commit/?id=51525557fd From 51525557fd75ca97e6347e2913f2d7fa25e8f789 Mon Sep 17 00:00:00 2001 From: Burdette Lamar <BurdetteLamar@Y...> Date: Thu, 20 Aug 2020 12:09:49 -0500 Subject: Partial compliance with doc/method_documentation.rdoc in string.c (#3436) Removes references to *-convertible thingies. diff --git a/string.c b/string.c index df7e814..b9cc048 100644 --- a/string.c +++ b/string.c @@ -1559,18 +1559,12 @@ rb_str_resurrect(VALUE str) https://github.com/ruby/ruby/blob/trunk/string.c#L1559 * String.new(str='', encoding: enc) -> new_str * String.new(str='', capacity: size) -> new_str * - * Argument +str+, if given, it must be a - * {String-convertible object}[doc/implicit_conversion_rdoc.html#label-String-Convertible+Objects] - * (implements +to_str+). + * Argument +str+, if given, it must be a \String. * - * Argument +encoding+, if given, must be: - * - A {String-convertible object}[doc/implicit_conversion_rdoc.html#label-String-Convertible+Objects] - * (implements +to_str+). - * - The name of an encoding that is compatible with +str+. + * Argument +encoding+, if given, must be the \String name of an encoding + * that is compatible with +str+. * - * Argument +capacity+, if given, must be an - * {Integer-convertible object}[doc/implicit_conversion_rdoc.html#label-Integer-Convertible+Objects] - * (implements +to_int+). + * Argument +capacity+, if given, must be an \Integer. * * The +str+, +encoding+, and +capacity+ arguments may all be used together: * String.new('hello', encoding: 'UTF-8', capacity: 25) @@ -1621,15 +1615,6 @@ rb_str_resurrect(VALUE str) https://github.com/ruby/ruby/blob/trunk/string.c#L1615 * * --- * - * Raises an exception if +str+ is not \String-convertible: - * # Raises TypeError (no implicit conversion of Integer into String): - * String.new(0) - * - * Raises an exception if +encoding+ is not \String-convertible - * or an Encoding object: - * # Raises TypeError (no implicit conversion of Integer into String): - * String.new(encoding: 0) - * * Raises an exception if the given +encoding+ is not a valid encoding name: * # Raises ArgumentError (unknown encoding name - FOO) * String.new(encoding: 'FOO') @@ -1639,10 +1624,6 @@ rb_str_resurrect(VALUE str) https://github.com/ruby/ruby/blob/trunk/string.c#L1624 * ascii = "Que veut dire \u{e7}a?".force_encoding('ASCII') * # Raises Encoding::CompatibilityError (incompatible character encodings: UTF-8 and US-ASCII) * utf8.include? ascii - * - * Raises an exception if +capacity+ is not \Integer-convertible: - * # Raises TypeError (no implicit conversion of Symbol into Integer): - * String.new(capacity: :foo) */ static VALUE -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/