ruby-changes:54319
From: stomar <ko1@a...>
Date: Tue, 25 Dec 2018 05:41:21 +0900 (JST)
Subject: [ruby-changes:54319] stomar:r66528 (trunk): complex.c, object.c: [DOC] improve "exception: false" docs
stomar 2018-12-25 05:41:15 +0900 (Tue, 25 Dec 2018) New Revision: 66528 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66528 Log: complex.c, object.c: [DOC] improve "exception: false" docs Modified files: trunk/complex.c trunk/object.c Index: object.c =================================================================== --- object.c (revision 66527) +++ object.c (revision 66528) @@ -3234,10 +3234,10 @@ opts_exception_p(VALUE opts) https://github.com/ruby/ruby/blob/trunk/object.c#L3234 * <code>String#to_i</code>. Non string values will be converted by first * trying <code>to_int</code>, then <code>to_i</code>. * - * Passing <code>nil</code> raises a TypeError, while passing String that + * Passing <code>nil</code> raises a TypeError, while passing a String that * does not conform with numeric representation raises an ArgumentError. * This behavior can be altered by passing <code>exception: false</code>, - * in this case not convertible value will return <code>nil</code>. + * in this case a not convertible value will return <code>nil</code>. * * Integer(123.999) #=> 123 * Integer("0x1a") #=> 26 @@ -3589,7 +3589,7 @@ rb_Float(VALUE val) https://github.com/ruby/ruby/blob/trunk/object.c#L3589 * directly, and with exception to string and nil the rest are converted using <i>arg</i>.to_f. * Converting a <code>string</code> with invalid characters will result in a <code>ArgumentError</code>. * Converting <code>nil</code> generates a <code>TypeError</code>. - * Exceptions could be suppressed by passing <code>exception: false</code>. + * Exceptions can be suppressed by passing <code>exception: false</code>. * * Float(1) #=> 1.0 * Float("123.456") #=> 123.456 Index: complex.c =================================================================== --- complex.c (revision 66527) +++ complex.c (revision 66528) @@ -403,8 +403,8 @@ static VALUE nucomp_s_convert(int argc, https://github.com/ruby/ruby/blob/trunk/complex.c#L403 * Complex(nil) #=> TypeError * Complex(1, nil) #=> TypeError * - * Complex(1, nil, exception: false) # => nil - * Complex('1+2', exception: false) # => nil + * Complex(1, nil, exception: false) #=> nil + * Complex('1+2', exception: false) #=> nil * * Syntax of string form: * -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/