GitXplorerGitXplorer
p

cloud-files-asset-sync

public
10 stars
3 forks
0 issues

Commits

List of commits on branch master.
Unverified
5e419110a17d15c6955285df19ef31190adc4caa

run that locall instead

committed 15 years ago
Unverified
593ab23908c9a78ece331b41f8f202093d84c58a

sync assets with app server, not web

committed 15 years ago
Unverified
4fdac05f9fe0aa00c1dd75628d82bfe859c5fcb3

comment for thought

committed 15 years ago
Unverified
69b96af763efb4314fe1fc0d9e740d2effac1ead

Comment for future thinking, echo deleting files

committed 15 years ago
Unverified
7cc84e15333f8d33483fb08c86b2a3c1d8444e99

document patch for cloudfiles gem

committed 15 years ago
Unverified
f8f534d19bb376062aa7d0649520c2dcf039710e

Changed to only upload new and modified files

committed 15 years ago

README

The README file for this repository.

CloudfileAssetSync

This plugin is intended to allow for easy movement of assets (rails public folder) to Rackspace's cloud files.

Dependencies

Requires rackspace cloudfiles gem http://github.com/rackspace/ruby-cloudfiles/tree

For the present, requires this patch to be ran on the gem diff --git a/lib/cloudfiles/container.rb b/lib/cloudfiles/container.rb index 650658b..e3827e1 100644 --- a/lib/cloudfiles/container.rb +++ b/lib/cloudfiles/container.rb @@ -167,7 +167,7 @@ module CloudFiles doc = REXML::Document.new(response.body) detailhash = {} doc.elements.each("container/object") { |o| - detailhash[o.elements["name"].text] = { :bytes => o.elements["bytes"].text, :hash => o.elements["hash"].text, :content_type => o.elements["content_type"].text, :last_modified => Time.parse(o.elements["last_modified"].text) } + detailhash[o.elements["name"].text] = { :bytes => o.elements["bytes"].text, :hash => o.elements["hash"].text, :content_type => o.elements["content_type"].text, :last_modified => DateTime.parse(o.elements["last_modified"].text) } } doc = nil return detailhash

Usage:

In your RAILS_ROOT/config folder, create a cloud_files.yml . The config file is compatible with Minter's paperclip fork for cloud files http://github.com/minter/paperclip

cloud_files.yml:

development:
  username: -- username --
  api_key: -- api_key --
  container: -- container -- # for paperclip
production:
  username: -- username --
  api_key: -- api_key --
  container: -- container -- # for paperclip
  assets_container: -- container name of where your public assets will go --

Usage: rake cf_asset_host

TODO:

  • Capistrano Recipie
  • Delete files that no longer exist
  • Gem Time vs DateTime work around without patch

Copyright (c) 2009 phillc, released under the MIT license