Permalink
Browse files

Rdoc again

  • Loading branch information...
1 parent c0786b7 commit 31ef7a6366dc02cf5d3cfb78510a2e7706b07668 Guillaume Montard committed Apr 20, 2012
Showing with 16 additions and 13 deletions.
  1. +16 −13 README.rdoc
View
@@ -10,27 +10,30 @@ Add to your gemfile :
Create a config file to /app/config/azure.yml to hold your Azure credentials
development:
- account_name: NAME
- access_key: KEY
+ account_name: NAME
+ access_key: KEY
staging:
- account_name: NAME
- access_key: KEY
+ account_name: NAME
+ access_key: KEY
production:
- account_name: NAME
- access_key: KEY
+ account_name: NAME
+ access_key: KEY
=== Usage
+
+Code example :
+
azure = WazSync.new()
["images", "javascripts", "stylesheets"].each{|folder|
- container = azure.find_or_create_container(folder)
- Dir.glob("#{Rails.root.to_s}/public/#{folder}/**/*").each do |file|
- if File.file?(file)
- filename = file.gsub("/public/#{folder}/", "").gsub("#{Rails.root.to_s}", "")
- azure.send_or_update(container, file, filename)
- end
- end
+ container = azure.find_or_create_container(folder)
+ Dir.glob("#{Rails.root.to_s}/public/#{folder}/**/*").each do |file|
+ if File.file?(file)
+ filename = file.gsub("/public/#{folder}/", "").gsub("#{Rails.root.to_s}", "")
+ azure.send_or_update(container, file, filename)
+ end
+ end
}
This simple code will sync all your assets unders "images", "javascripts" and "stylesheets" to Windows Azure CDN

0 comments on commit 31ef7a6

Please sign in to comment.