Sha256: 87f12a24687deb92c2e3fc0bd4e9e9c3e66219ef84ff18c05dafc276e7416e10
Contents?: true
Size: 495 Bytes
Versions: 28
Compression:
Stored size: 495 Bytes
Contents
module SitemapGenerator class FileAdapter def write(location, raw_data) # Ensure that the directory exists dir = location.directory if !File.exists?(dir) FileUtils.mkdir_p(dir) elsif !File.directory?(dir) raise SitemapError.new("#{dir} should be a directory!") end gzip(open(location.path, 'wb'), raw_data) end def gzip(stream, data) gz = Zlib::GzipWriter.new(stream) gz.write data gz.close end end end
Version data entries
28 entries across 28 versions & 1 rubygems