lib/httpx/plugins/compression/deflate.rb in httpx-0.9.0 vs lib/httpx/plugins/compression/deflate.rb in httpx-0.10.0
- old
+ new
@@ -2,20 +2,21 @@
module HTTPX
module Plugins
module Compression
module Deflate
- def self.load_dependencies(*)
+ def self.load_dependencies(klass)
require "stringio"
require "zlib"
+ klass.plugin(:"compression/gzip")
end
def self.configure(*)
Compression.register "deflate", self
end
- module Encoder
+ module Deflater
module_function
def deflate(raw, buffer, chunk_size:)
deflater = Zlib::Deflate.new(Zlib::BEST_COMPRESSION,
Zlib::MAX_WBITS,
@@ -34,15 +35,15 @@
end
end
module_function
- def encoder
- Encoder
+ def deflater
+ Deflater
end
- def decoder
- Decoder.new(Zlib::Inflate.new(32 + Zlib::MAX_WBITS))
+ def inflater(bytesize)
+ GZIP::Inflater.new(bytesize)
end
end
end
register_plugin :"compression/deflate", Compression::Deflate
end