lib/cache.rb
# Saves +data+ to the cache
Saves +data+ to the cache
Saves + data + to the cache
def save_new_revision(data, system_num)
      rev = latest_revision(system_num)
      new_revision = rev ? rev + 1 : 0
      path = pathname(system_num, new_revision)
      dir = File.dirname(path)
      FileUtils.mkdir_p(dir) unless File.exist?(dir)
      File.open(path, "w") { |f| f.write(data) }
      true
    end
def save_new_revision ( data , system_num ) rev = latest_revision ( system_num ) new_revision = rev ? rev + 1 : 0 path = pathname ( system_num , new_revision ) dir = File . dirname ( path ) FileUtils . mkdir_p ( dir ) unless File . exist? ( dir ) File . open ( path , "w" ) { | f | f . write ( data ) } true end
Saves +data+ to the cache
Saves + data + to the cache
data
system_num