Method: RDoc::RI::Driver#run

Defined in:
lib/rdoc/ri/driver.rb

#runObject



359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/rdoc/ri/driver.rb', line 359

def run
  if @names.empty? then
    @display.list_known_classes class_cache.keys.sort
  else
    @names.each do |name|
      case name
      when /::|\#|\./ then
        if class_cache.key? name then
          display_class name
        else
          meth = nil

          parts = name.split(/::|\#|\./)
          meth = parts.pop unless parts.last =~ /^[A-Z]/
          klass = parts.join '::'

          cache = load_cache_for klass
          # HACK Does not support F.n
          abort "Nothing known about #{name}" unless cache
          method = cache[name.gsub(/\./, '#')]
          abort "Nothing known about #{name}" unless method
          @display.display_method_info method
        end
      else
        if class_cache.key? name then
          display_class name
        else
          methods = select_methods(/^#{name}/)
          if methods.size == 0
            abort "Nothing known about #{name}"
          elsif methods.size == 1
            @display.display_method_info methods.first
          else
            @display.display_method_list methods
          end
        end
      end
    end
  end
end