Sha256: fc43e959f8631721d3dac214dcbd88b9675820c12745abda3d151dbae7d3599c

Contents?: true

Size: 451 Bytes

Versions: 5

Compression:

Stored size: 451 Bytes

Contents

# Copyright (c) 2012, SoundCloud Ltd., Tobias Bielohlawek

require 'zlib'
require "massive_sitemap/writer/file"

# MassiveSitemap Writer GzipFile
# Extension to file writer for gzip support

module MassiveSitemap
  module Writer

    class GzipFile < File
      OPTS = File::OPTS

      protected
      def open_stream
        ::Zlib::GzipWriter.new(super)
      end

      private
      def filename
        super + ".gz"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
massive_sitemap-2.1.1 lib/massive_sitemap/writer/gzip_file.rb
massive_sitemap-2.1.0 lib/massive_sitemap/writer/gzip_file.rb
massive_sitemap-2.0.0 lib/massive_sitemap/writer/gzip_file.rb
massive_sitemap-2.0.0.rc8 lib/massive_sitemap/writer/gzip_file.rb
massive_sitemap-2.0.0.rc7 lib/massive_sitemap/writer/gzip_file.rb