Bug in ri - cannot convert nil into Array

Discussion in 'Ruby' started by John Carter, Jan 17, 2005.

  1. John Carter

    John Carter Guest

    There seems to be a Bug in "ri" in the CVS-Latest (17-Jan-2005) version of
    Ruby.

    ri Set | cat
    /usr/local/lib/ruby/1.9/rdoc/ri/ri_descriptions.rb:99:in `concat': cannot
    convert nil into Array (TypeError)
    from /usr/local/lib/ruby/1.9/rdoc/ri/ri_descriptions.rb:99:in
    `merge_in'
    from /usr/local/lib/ruby/1.9/rdoc/ri/ri_reader.rb:56:in
    `get_class'
    from /usr/local/lib/ruby/1.9/rdoc/ri/ri_reader.rb:52:in `each'
    from /usr/local/lib/ruby/1.9/rdoc/ri/ri_reader.rb:52:in
    `get_class'
    from /usr/local/lib/ruby/1.9/rdoc/ri/ri_reader.rb:31:in
    `find_class_by_name'
    from /usr/local/lib/ruby/1.9/rdoc/ri/ri_display.rb:97:in
    `display_class_info'
    from /usr/local/lib/ruby/1.9/rdoc/ri/ri_display.rb:96:in `each'
    from /usr/local/lib/ruby/1.9/rdoc/ri/ri_display.rb:96:in
    `display_class_info'
    from /usr/local/lib/ruby/1.9/rdoc/ri/ri_display.rb:77:in `page'
    from /usr/local/lib/ruby/1.9/rdoc/ri/ri_display.rb:77:in
    `display_class_info'
    from /usr/local/lib/ruby/1.9/rdoc/ri/ri_driver.rb:71:in
    `report_class_stuff'
    from /usr/local/lib/ruby/1.9/rdoc/ri/ri_driver.rb:106:in
    `get_info_for'
    from /usr/local/lib/ruby/1.9/rdoc/ri/ri_driver.rb:135:in
    `process_args'
    from /usr/local/lib/ruby/1.9/rdoc/ri/ri_driver.rb:134:in `each'
    from /usr/local/lib/ruby/1.9/rdoc/ri/ri_driver.rb:134:in
    `process_args'
    from /usr/local/bin/ri:48
    ------------------------------------------------------------- Class: Set
    Set implements a collection of unordered values with no duplicates.
    This is a hybrid of Array's intuitive inter-operation facilities
    and Hash's fast lookup.

    Several methods accept any Enumerable object (implementing +each+)
    for greater flexibility: new, replace, merge, subtract, |, &, -, ^.

    The equality of each couple of elements is determined according to
    Object#eql? and Object#hash, since Set uses Hash as storage.

    Finally, if you are using class Set, you can also use
    Enumerable#to_set for convenience.


    Example
    -------
    require 'set'
    s1 = Set.new [1, 2] # -> #<Set: {1, 2}>
    s2 = [1, 2].to_set # -> #<Set: {1, 2}>
    s1 == s2 # -> true
    s1.add("foo") # -> #<Set: {1, 2, "foo"}>
    s1.merge([2, 6]) # -> #<Set: {6, 1, 2, "foo"}>
    s1.subset? s2 # -> false
    s2.subset? s1 # -> true

    ------------------------------------------------------------------------


    Includes:
    ---------

    ====================================================================

    If I have a look at
    /usr/local/lib/ruby/1.9/rdoc/ri/ri_descriptions.rb:99, I see...
    # merge in another class desscription into this one
    def merge_in(old)
    merge(@class_methods, old.class_methods)
    merge(@instance_methods, old.instance_methods)
    merge(@attributes, old.attributes)
    merge(@constants, old.constants)
    merge(@includes, old.includes)
    if @comment.nil? || @comment.empty?
    @comment = old.comment
    else
    @comment << SM::Flow::RULE.new
    @comment.concat old.comment
    end
    end

    Where line 99 is...
    @comment.concat old.comment

    I take it then "old.comment" is nil

    Give me a yell if you want me to doing any testing / instrumenting of this
    for you.



    John Carter Phone : (64)(3) 358 6639
    Tait Electronics Fax : (64)(3) 359 4632
    PO Box 1645 Christchurch Email :
    New Zealand

    "The notes I handle no better than many pianists. But the pauses
    between the notes -
    ah, that is where the art resides!' - Artur Schnabel
     
    John Carter, Jan 17, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Candler

    puts nil generates "nil\n"

    Brian Candler, Nov 6, 2004, in forum: Ruby
    Replies:
    1
    Views:
    120
  2. John Carter
    Replies:
    64
    Views:
    676
    Klaus Stein
    May 19, 2005
  3. Christoffer Sawicki
    Replies:
    5
    Views:
    273
    Christoffer Sawicki
    Sep 2, 2006
  4. Arie Kusuma Atmaja
    Replies:
    6
    Views:
    146
    Arie Kusuma Atmaja
    Apr 11, 2008
  5. Replies:
    1
    Views:
    146
    Peña, Botp
    May 27, 2008
Loading...

Share This Page