Added in AwsAdapert, uploads the sitemap to an s3 using the aws-sdk gem #76

wants to merge 1 commit into


None yet
2 participants

I am working on a project that uses paperclip and aws-sdk, so I didn't want to install carrierwave. I saw that you had made a rake task that does this, but I thought for ease of use I might as well create an adapter.

aws-sdk gem
Requires an config/s3.yml file. Set up the same way paperclip does.

The config is just about the same

SitemapGenerator::Sitemap.default_host = ""
SitemapGenerator::Sitemap.sitemaps_host = ""
SitemapGenerator::Sitemap.public_path = 'tmp/'
SitemapGenerator::Sitemap.sitemaps_path = 'sitemaps/'
SitemapGenerator::Sitemap.adapter =
SitemapGenerator::Sitemap.create do
  #your set up here

I hope this helps!


kjvarga commented Jul 12, 2012

Hi, thanks for contributing your code. I would like to include it, but there are a couple issues that prevent me from doing so.

It's very Rails-centric by the way it manually parses the s3.yml file and uses Rails.root. I have as a generic way to get the application root directory, but then the yml file still uses the Rails environment to pick which config options to use, so that's not very nice for people trying to use it outside of Rails. I would rather use environment variables or something which is framework agnostic and have the code that reads the configuration file kept outside of the adapter.

Secondly it should get the sitemaps_path from the location object passed to write() rather than via SitemapGenerator::Sitemap.sitemaps_path.

Very cool thanks for your feed back. I just got buried under a pile of work, but when I get a chance in the next few weeks I will try again using your suggestions.

kjvarga closed this May 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment