method
load_cache
v2_4_6 -
Show latest stable
- Class:
RDoc::Store
load_cache()public
Loads cache file for this store
# File lib/rdoc/store.rb, line 539
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 different 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[:pages] ||= []
@cache[:main] ||= nil
@cache[:c_class_variables] ||= {}
@cache[:c_singleton_class_variables] ||= {}
@cache[:c_class_variables].each do |_, map|
map.each do |variable, name|
@c_enclosure_names[variable] = name
end
end
@cache
rescue Errno::ENOENT
end Related methods
- Instance methods
- add_c_enclosure
- add_c_variables
- add_file
- all_classes
- all_classes_and_modules
- all_files
- all_modules
- ancestors
- attributes
- cache_path
- class_file
- class_methods
- class_path
- classes_hash
- clean_cache_collection
- complete
- files_hash
- find_c_enclosure
- find_class_named
- find_class_named_from
- find_class_or_module
- find_file_named
- find_module_named
- find_text_page
- find_unique
- fix_basic_object_inheritance
- friendly_path
- inspect
- instance_methods
- load_all
- load_cache
- load_class
- load_class_data
- load_method
- load_page
- main
- main=
- make_variable_map
- method_file
- module_names
- modules_hash
- page
- page_file
- remove_nodoc
- save
- save_cache
- save_class
- save_method
- save_page
- source
- title
- title=
- unique_classes
- unique_classes_and_modules
- unique_modules
- Class methods
- new