method

load_cache_for

ruby latest stable - Class: RDoc::RI::Driver

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1_9_1_378) is shown here.

load_cache_for(klassname)
public

No documentation available.

# File lib/rdoc/ri/driver.rb, line 449
  def load_cache_for(klassname)
    path = cache_file_for klassname

    cache = nil

    if File.exist? path and
       File.mtime(path) >= File.mtime(class_cache_file_path) and
       @use_cache then
      open path, 'rb' do |fp|
        begin
          cache = Marshal.load fp.read
        rescue
          #
          # The cache somehow is bad.  Recreate the cache.
          #
          $stderr.puts "Error reading the cache for #{klassname}; recreating the cache!"
          cache = create_cache_for klassname, path
        end
      end
    else
      cache = create_cache_for klassname, path
    end

    cache
  end