lib/garcon/stash/journal.rb
# Compact the logfile to represent the in-memory state
#
Compact the logfile to represent the in-memory state
Compact the logfile to represent the in - memory state
def compact
        load
        with_tmpfile do |path, file|
          return self if @pos == file.write(dump(yield, @format.header))
          with_flock(File::LOCK_EX) do
            if @pos != nil
              file.write(read)
              file.close
              File.rename(path, @file)
            end
          end
        end
        open
        replay
      end
def compact load with_tmpfile do | path , file | return self if @pos == file . write ( dump ( yield , @format . header ) ) with_flock ( File :: LOCK_EX ) do if @pos != nil file . write ( read ) file . close File . rename ( path , @file ) end end end open replay end
Compact the logfile to represent the in-memory state
Compact the logfile to represent the in - memory state
# Compactified database has the same size -> return