lib/io_streams/gzip/writer.rb in iostreams-0.8.2 vs lib/io_streams/gzip/writer.rb in iostreams-0.9.0

- old
+ new

@@ -1,11 +1,11 @@ module IOStreams module Gzip class Writer # Write to a file / stream, compressing with GZip def self.open(file_name_or_io, _=nil, &block) - unless file_name_or_io.respond_to?(:write) + unless IOStreams.writer_stream?(file_name_or_io) Zlib::GzipWriter.open(file_name_or_io, &block) else begin io = Zlib::GzipWriter.new(file_name_or_io) block.call(io) @@ -15,6 +15,6 @@ end end end end -end \ No newline at end of file +end