Class: Yomikomu::FlatFileGZStorage

Inherits:
FlatFileStorage show all
Defined in:
lib/yomikomu.rb

Instance Method Summary collapse

Methods inherited from FlatFileStorage

#remove_compiled_iseq

Methods inherited from BasicStorage

#compile_and_store_iseq, #extra_data, #load_iseq

Constructor Details

#initializeFlatFileGZStorage

Returns a new instance of FlatFileGZStorage.



345
346
347
348
# File 'lib/yomikomu.rb', line 345

def initialize
  super
  require 'zlib'
end

Instance Method Details

#data_pathObject



341
342
343
# File 'lib/yomikomu.rb', line 341

def data_path
  super + '_gz'
end

#index_pathObject



337
338
339
# File 'lib/yomikomu.rb', line 337

def index_path
  super + '_gz'
end

#read_compiled_iseq(fname, iseq_key) ⇒ Object



350
351
352
353
# File 'lib/yomikomu.rb', line 350

def read_compiled_iseq fname, iseq_key
  binary = super
  Zlib::Inflate.inflate(binary)
end

#write_compiled_iseq(fname, iseq_key, binary) ⇒ Object



355
356
357
358
# File 'lib/yomikomu.rb', line 355

def write_compiled_iseq fname, iseq_key, binary
  binary = Zlib::Deflate.deflate(binary)
  super(fname, iseq_key, binary)
end