You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Parser should be less strict about attribute arguments #1790
The prism parser (the only parser since v8.0.0) is strict about arguments to attr_reader, attr_writer, attr_accessor, and attr. It only parses as an attribute when all arguments are symbols.
As an example, the rdoc for Net::IMAP::Config intentionally took advantage of the looser parsing done by rdoc 7.2. That class redefines attr_reader, attr_writer and attr_accessor to add keyword arguments for type validation/coercion and defaults:
# Seconds to wait until a connection is opened.## Applied separately for establishing TCP connection and starting a TLS# connection.## If the IMAP object cannot open a connection within this time,# it raises a Net::OpenTimeout exception.## See Net::IMAP.new and Net::IMAP#starttls.## The default value is +30+ seconds.attr_accessor:open_timeout,type: Integer,default: 30
rdoc 7.2 simply ignores the unknown keyword args, and parses this no differently from attr_accessor :open_timeout.
In my opinion, this is a bug in rdoc 8.0 which should be fixed.
Activity
📚️ Fix Config attributes docs broken by rdoc 8.0
📚️ Fix Config attributes docs broken by rdoc 8.0
Allow less strict attribute argument parsing
Allow less strict attribute argument parsing
Allow less strict attribute argument parsing
Allow less strict attribute argument parsing
Allow less strict attribute argument parsing (ruby#1793)