Bug 528787

Summary: ri doesn't search manuals installed by gem
Product: [Fedora] Fedora Reporter: Mamoru TASAKA <mtasaka>
Component: rubyAssignee: Jeroen van Meeuwen <vanmeeuwen+fedora>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 12CC: jeremy, mtasaka, tagoh, vanmeeuwen+fedora
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-11-16 08:30:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mamoru TASAKA 2009-10-13 17:56:57 UTC
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 19:38:24 UTC
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 22:40:29 UTC
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 12:38:21 UTC
Mamoru, could you please let us know whether you have resolved this? Thanks!

Comment 4 Mamoru TASAKA 2009-10-25 14:05:03 UTC
(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 18:46:59 UTC
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 07:31:08 UTC
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 13:37:33 UTC
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