Class: JekyllPagesApiSearch::Compressor
- Inherits:
-
Object
- Object
- JekyllPagesApiSearch::Compressor
- Defined in:
- lib/jekyll_pages_api_search/compressor.rb
Class Method Summary collapse
Class Method Details
.gzip_in_memory_content(file_to_content_hash) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/jekyll_pages_api_search/compressor.rb', line 6 def self.gzip_in_memory_content(file_to_content_hash) file_to_content_hash.each do |file, content| ::Zlib::GzipWriter.open("#{file}.gz", Zlib::BEST_COMPRESSION) do |gz| gz.write content end FileUtils.touch([file, "#{file}.gz"]) end end |