Permalink
Browse files

Renamed config property cloud_dist_id to cloudfront_dist_id for

consistency with other vars
  • Loading branch information...
1 parent c9c5ab4 commit 4bcf0d1bf44fa7c272fccccba9a36aa8062a729c Kliment Mamykin committed Apr 17, 2011
Showing with 5 additions and 5 deletions.
  1. +2 −2 README.md
  2. +3 −3 lib/jammit/s3_uploader.rb
View
4 README.md
@@ -85,10 +85,10 @@ For this to work you need to make sure you have the CloudFront enabled via you A
To use CloudFront, simply add the following settings to config/assets.yml:
use_cloudfront: on
- cloud_dist_id: XXXXXXXXXXXXXX
+ cloudfront_dist_id: XXXXXXXXXXXXXX
cloudfront_domain: xyzxyxyz.cloudfront.net
-Please note that cloud_dist_id is not the same as the CloudFront domain
+Please note that cloudfront_dist_id is not the same as the CloudFront domain
name. Inside CloudFront management console select the
distribution, and you will see Distribution ID and Domain Name values.
View
6 lib/jammit/s3_uploader.rb
@@ -21,7 +21,7 @@ def initialize(options = {})
@bucket = find_or_create_bucket
if Jammit.configuration[:use_cloudfront]
@changed_files = []
- @cloud_dist_id = options[:cloud_dist_id] || Jammit.configuration[:cloud_dist_id]
+ @cloudfront_dist_id = options[:cloudfront_dist_id] || Jammit.configuration[:cloudfront_dist_id]
end
end
end
@@ -127,14 +127,14 @@ def invalidate_cache(files)
end
digest = HMAC::SHA1.new(@secret_access_key)
digest << date = Time.now.utc.strftime("%a, %d %b %Y %H:%M:%S %Z")
- uri = URI.parse("https://cloudfront.amazonaws.com/2010-11-01/distribution/#{@cloud_dist_id}/invalidation")
+ uri = URI.parse("https://cloudfront.amazonaws.com/2010-11-01/distribution/#{@cloudfront_dist_id}/invalidation")
req = Net::HTTP::Post.new(uri.path)
req.initialize_http_header({
'x-amz-date' => date,
'Content-Type' => 'text/xml',
'Authorization' => "AWS %s:%s" % [@access_key_id, Base64.encode64(digest.digest).gsub("\n", '')]
})
- req.body = "<InvalidationBatch>#{paths}<CallerReference>#{@cloud_dist_id}_#{Time.now.utc.to_i}</CallerReference></InvalidationBatch>"
+ req.body = "<InvalidationBatch>#{paths}<CallerReference>#{@cloudfront_dist_id}_#{Time.now.utc.to_i}</CallerReference></InvalidationBatch>"
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

0 comments on commit 4bcf0d1

Please sign in to comment.