From f366981ac847973137dbd1d4f9cf7b3480f9e3e9 Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Tue, 4 Oct 2011 16:48:42 -0300 Subject: [PATCH] Don' show any output when file not changed. --- lib/jammit/s3_uploader.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/jammit/s3_uploader.rb b/lib/jammit/s3_uploader.rb index e258c55..3f369fd 100644 --- a/lib/jammit/s3_uploader.rb +++ b/lib/jammit/s3_uploader.rb @@ -71,7 +71,7 @@ def upload_from_glob(glob) use_gzip = true remote_path = remote_path.gsub(/\.gz$/, "") end - + # check if the file already exists on s3 begin obj = @bucket.objects.find_first(remote_path) @@ -79,7 +79,7 @@ def upload_from_glob(glob) obj = nil end - # if the object does not exist, or if the MD5 Hash / etag of the + # if the object does not exist, or if the MD5 Hash / etag of the # file has changed, upload it if !obj || (obj.etag != Digest::MD5.hexdigest(File.read(local_path))) @@ -97,8 +97,6 @@ def upload_from_glob(glob) log "File changed and will be invalidated in cloudfront: #{remote_path}" @changed_files << remote_path end - else - log "file has not changed: #{remote_path}" end end end @@ -118,7 +116,7 @@ def find_or_create_bucket bucket end end - + def invalidate_cache(files) paths = "" files.each do |key|