global
def load(cache_file = nil)
file does not exist, if the file cannot be loaded, or if the data in
the environment variable +RUBY_MIME_TYPES_CACHE+. Returns +nil+ if the
Attempts to load the cache from the file provided as a parameter or in
def load(cache_file = nil) cache_file ||= ENV["RUBY_MIME_TYPES_CACHE"] return nil unless cache_file && File.exist?(cache_file) cache = Marshal.load(File.binread(cache_file)) if cache.version == MIME::Types::Data::VERSION Marshal.load(cache.data) else MIME::Types.logger.error <<-WARNING.chomp.strip Could not load MIME::Types cache: invalid version WARNING nil end rescue => e MIME::Types.logger.error <<-WARNING.chomp.strip Could not load MIME::Types cache: #{e} WARNING nil end