Bug #15819
closedcannot read document of File::NULL with "ri File::NULL"
Updated by tad (Tadashi Saito) over 5 years ago
- Subject changed from cannot read document of File::NULL with ri File::NULL to cannot read document of File::NULL with "ri File::NULL"
- ruby -v set to ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
When I type ri File::NULL
, got
Nothing known about File::NULL
Did you mean? File::Stat
but
-
ruby -e 'p File::NULL'
prints"/dev/null"
succesfully - Documents are already written in #7365
- I could read it with
ri File::File::Constants
- Note that
File::
needs twice like https://docs.ruby-lang.org/en/trunk/File/File/Constants.html
- Note that
IHMO, it's too difficult to guess proper command.
I did not know if this was a markup mistake or a logic bug in RDoc, so I registered here for the time being.
Updated by shevegen (Robert A. Heiler) over 5 years ago
IHMO, it's too difficult to guess proper command.
Agree - File::NULL works in e. g. irb too and should work for ri. I found rdoc/ri
a bit cumbersome to use API-wise; in one project, that displays rdoc documentation
for methods (a bit similar as what pry does), I use code such as this:
hash = RDoc::RI::Driver.process_args(arguments)
rdoc_driver = RDoc::RI::Driver.new(hash)
To process stuff. if it were up to me I would try to enhance rdoc in general to be
more "friendly" (simpler) API-wise to use for downstream ruby users in general, but
I digress from your issue, sorry.
Updated by jeremyevans0 (Jeremy Evans) over 4 years ago
- Status changed from Open to Closed
ri
doesn't show documentation on all constants, only classes and modules. So it is expected that ri File::NULL
will not work, just as ri Date::ITALY
and ri Integer::GMP_VERSION
don't work.
There is a bug here, and that is that File::Constants
was documented under File::File::Constants
. I've traced this to a typo in rdoc, which I've submitted a pull request to fix: https://github.com/ruby/rdoc/pull/774