[#101179] Spectre Mitigations — Amel <amel.smajic@...>
Hi there!
5 messages
2020/12/01
[#101694] Ruby 3.0.0 Released — "NARUSE, Yui" <naruse@...>
V2UgYXJlIHBsZWFzZWQgdG8gYW5ub3VuY2UgdGhlIHJlbGVhc2Ugb2YgUnVieSAzLjAuMC4gRnJv
4 messages
2020/12/25
[ruby-core:101244] Re: [Ruby master Feature#17055] Allow suppressing uninitialized instance variable and method redefined verbose mode warnings
From:
Austin Ziegler <halostatue@...>
Date:
2020-12-04 17:34:00 UTC
List:
ruby-core #101244
Thanks. It=E2=80=99s only partially unrelated, because while it would be gr= eat for RDoc to do the right thing (always treat `foo/foo=3D` method pairs as if th= ey were attribute writers), the `undef` was done *specifically* to avoid the =E2=80=9Credefining a method=E2=80=9D warning. -a On Thu, Dec 3, 2020 at 6:05 PM Jeremy Evans <[email protected]> wrote: > On 12/03 05:44, Austin Ziegler wrote: > > What does this mean? > > > > > Considering that you can alias a method to itself to avoid the warnin= g, > > and therefore do not need to remove the method first (which would cause= a > > race condition), I am dropping my request to add > > `expected_redefined_method?(method_name)`. > > As shown by Urabe-san: > > ```ruby > def foo > end > > # This avoids the redefinition warning > alias foo foo > > # This would normally result in a redefinition warning in verbose mode, > # if not for the alias above. > def foo > end > ``` > > > I have code that I???ve written to get around some rdoc silliness that > does: > > > > # rdoc documentation for foo. > > attr_writer :foo > > undef :foo=3D > > def foo=3D(x) #:nodoc: > > # specialized foo assignment code > > end > > > > If I didn???t do this, RDoc documents both the attribute and the `foo= =3D` > > method (or it did the last time I checked) even though all I want > > documented is the attribute for readability. How would I make it so tha= t > I > > don???t need to do `undef :foo=3D` here, as that has been one thing tha= t > has > > failed this code (_hard_) with both type analyzers for Ruby. > > This seems to be an unrelated issue. I would avoid the attr_writer and > the undef. If you just want RDoc to mark this as an attribute method > instead of general method, then you may want to submit a pull request to > rdoc to add markup syntax to be able to flag a regular method as an > attribute method. > > Thanks, > Jeremy > > Unsubscribe: <mailto:[email protected]?subject=3Dunsubscrib= e> > <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core> > --=20 Austin Ziegler =E2=80=A2 [email protected] =E2=80=A2 [email protected]= a http://www.halostatue.ca/ =E2=80=A2 http://twitter.com/halostatue Unsubscribe: <mailto:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>