Bug 528787 - ri doesn't search manuals installed by gem
ri doesn't search manuals installed by gem
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: ruby (Show other bugs)
12
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeroen van Meeuwen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-13 13:56 EDT by Mamoru TASAKA
Modified: 2009-11-16 08:37 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-11-16 03:30:16 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Mamoru TASAKA 2009-10-13 13:56:57 EDT
Description of problem:
Even with ri document files are installed via gem (based Fedora
rpm package), ri does not correctly detect and show such
ri manual pages.

Version-Release number of selected component (if applicable):
ruby-ri-1.8.6.369-3.fc12

How reproducible:
100%

Steps to Reproduce:
1. yum install ruby-ri rubygem-mocha
2. ri mocha
3.
  
Actual results:
mock-chroot> ri mocha
Nothing known about mocha

Expected results:
ri mocha should show like below:

More than one method matched your request. You can refine
your search by asking for information on one of:

     Mocha::ObjectMethods#mocha_inspect,
     Mocha::InStateOrderingConstraint#mocha_inspect,
     Mocha::DefaultName#mocha_inspect,
     Mocha::MethodMatcher#mocha_inspect, Mocha::Mockery#mocha_inspect,
     Mocha::TimeMethods#mocha_inspect, Mocha::Cardinality#mocha_inspect,

Additional info:
ri --help shows:
--------------------------------------------------------
By default ri searches for documentation in the following
directories:

    /usr/share/ri/1.8/system
    /usr/share/ri/1.8/site
    /builddir/.rdoc
    /builddir/.gem/ruby/1.8/usr/lib/ruby/gems/1.8/doc/*/ri
....
....
         --gems   Include documentation from Rubygems:
                    /builddir/.gem/ruby/1.8/usr/lib/ruby/gems/1.8/doc/*/ri
--------------------------------------------------------
This is not right.
Looking at lib/rdoc/ri/ri_options.rb, lib/rdoc/ri/ri_paths.rb,
for example ri_path.rb contains:
--------------------------------------------------------
    45      begin
    46        require 'rubygems'
    47        GEMDIRS = Dir["#{Gem.path}/doc/*/ri"]
    48        GEMDIRS.each { |path| RI::Paths::PATH << path }
    49      rescue LoadError
    50        GEMDIRS = nil
    51      end
--------------------------------------------------------
However as far as I checked F-11/12/13 rubygems returns:
--------------------------------------------------------
$ ruby -e 'require "rubygems" ; p Gem.path'
["/home/tasaka1/.gem/ruby/1.8", "/usr/lib/ruby/gems/1.8"]
--------------------------------------------------------
So Gem.path is not a string but an array and the above
code cannot handle this correctly.
Comment 1 Fedora Update System 2009-10-13 15:38:24 EDT
ruby-1.8.6.369-2.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/ruby-1.8.6.369-2.fc11
Comment 2 Fedora Update System 2009-10-15 18:40:29 EDT
ruby-1.8.6.369-3.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update ruby'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-10537
Comment 3 Jeroen van Meeuwen 2009-10-25 08:38:21 EDT
Mamoru, could you please let us know whether you have resolved this? Thanks!
Comment 4 Mamoru TASAKA 2009-10-25 10:05:03 EDT
(In reply to comment #3)
> Mamoru, could you please let us know whether you have resolved this? Thanks!  

I wrote the original patch and Tagoh-san posted much better idea
for this. (i.e. the patch is not taken from the upstream)
The idea for the patch is written in my comment 0.
i.e. for example 
GEMDIRS = Dir["#{Gem.path}/doc/*/ri"]
is wrong as Gem.path is an array and the patch is trying to treat
this correctly.
Comment 5 Fedora Update System 2009-10-29 14:46:59 EDT
ruby-1.8.6.383-4.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/ruby-1.8.6.383-4.fc11
Comment 6 Fedora Update System 2009-11-16 02:31:08 EST
ruby-1.8.6.383-4.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 7 Bug Zapper 2009-11-16 08:37:33 EST
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Note You need to log in before you can comment on or make changes to this bug.