method
load_cache
v1_9_3_125 -
Show latest stable
- Class:
RDoc::RI::Store
load_cache()public
Loads cache file for this store
# File lib/rdoc/ri/store.rb, line 165
def load_cache
#orig_enc = @encoding
open cache_path, 'rb' do |io|
@cache = Marshal.load io.read
end
load_enc = @cache[:encoding]
# TODO this feature will be time-consuming to add:
# a) Encodings may be incompatible but transcodeable
# b) Need to warn in the appropriate spots, wherever they may be
# c) Need to handle cross-cache differences in encodings
# d) Need to warn when generating into a cache with diffent encodings
#
#if orig_enc and load_enc != orig_enc then
# warn "Cached encoding #{load_enc} is incompatible with #{orig_enc}\n" \
# "from #{path}/cache.ri" unless
# Encoding.compatible? orig_enc, load_enc
#end
@encoding = load_enc unless @encoding
@cache
rescue Errno::ENOENT
end