Sha256: 70ddbdf4633076e601332cfb5153322831bbf2b24ffb771021b324c705d97e08
Contents?: true
Size: 769 Bytes
Versions: 14
Compression:
Stored size: 769 Bytes
Contents
begin require 'fog' rescue LoadError raise LoadError.new("Missing required 'fog'. Please 'gem install fog' and require it in your application.") end module SitemapGenerator class FogAdapter def initialize(opts = {}) @fog_credentials = opts[:fog_credentials] @fog_directory = opts[:fog_directory] end # Call with a SitemapLocation and string data def write(location, raw_data) SitemapGenerator::FileAdapter.new.write(location, raw_data) storage = Fog::Storage.new(@fog_credentials) directory = storage.directories.new(:key => @fog_directory) directory.files.create( :key => location.path_in_public, :body => File.open(location.path), :public => true ) end end end
Version data entries
14 entries across 14 versions & 4 rubygems