89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
# File 'lib/docks/cache.rb', line 89
def dump
Process.process(@pattern_library)
File.open(self.class.pattern_library_cache_file, "wb") do |file|
file.write Marshal::dump(@pattern_library)
end
File.open(self.class.meta_file, "wb") do |file|
file.write Marshal::dump(@metadata)
end
@patterns_needing_caches.each do |pattern|
File.open(Docks.config.cache_location + pattern, "wb") do |file|
file.write Marshal::dump(@pattern_library[pattern])
end
end
@old_pattern_library.patterns.each do |name, pattern|
FileUtils.rm_rf(Docks.config.cache_location + name) unless @pattern_library.has_pattern?(name)
end
end
|