Class: Kafo::ParserCacheWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/kafo/parser_cache_writer.rb

Class Method Summary collapse

Class Method Details

.write(modules) ⇒ Object



5
6
7
8
9
10
# File 'lib/kafo/parser_cache_writer.rb', line 5

def self.write(modules)
  {
    :version => PARSER_CACHE_VERSION,
    :files => Hash[modules.sort.map { |m| write_module(m) }]
  }
end

.write_module(mod) ⇒ Object



12
13
14
# File 'lib/kafo/parser_cache_writer.rb', line 12

def self.write_module(mod)
  [mod.identifier, {:data => mod.raw_data, :mtime => File.mtime(mod.manifest_path).to_i}]
end