pothoven-attachment_fu 3.2.9 → 3.2.10

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ * Aug 22, 2013 *
2
+ * Added cache-control header option and Ruby 1.9 fix for S3 from tricycle
3
+
1
4
  * Aug 21, 2013 *
2
5
  * Added S3 :encrypted_storage option support from cschulte22
3
6
 
@@ -98,6 +98,7 @@ module Technoweenie # :nodoc:
98
98
  options[:s3_access] ||= :public_read
99
99
  options[:cloudfront] ||= false
100
100
  options[:content_type] = [options[:content_type]].flatten.collect! { |t| t == :image ? ::Technoweenie::AttachmentFu.content_types : t }.flatten unless options[:content_type].nil?
101
+ options[:cache_control] ||= "max-age=315360000" # 10 years
101
102
 
102
103
  unless options[:thumbnails].is_a?(Hash)
103
104
  raise ArgumentError, ":thumbnails option should be a hash: e.g. :thumbnails => { :foo => '50x50' }"
@@ -291,9 +291,9 @@ module Technoweenie # :nodoc:
291
291
 
292
292
  def public_filename(*args)
293
293
  if attachment_options[:cloudfront]
294
- cloudfront_url(args)
294
+ cloudfront_url(*args)
295
295
  else
296
- s3_url(args)
296
+ s3_url(*args)
297
297
  end
298
298
  end
299
299
 
@@ -386,6 +386,7 @@ module Technoweenie # :nodoc:
386
386
  (temp_path ? File.open(temp_path) : temp_data),
387
387
  bucket_name,
388
388
  :content_type => content_type,
389
+ :cache_control => attachment_options[:cache_control],
389
390
  :access => attachment_options[:s3_access],
390
391
  'x-amz-server-side-encryption' => 'AES256',
391
392
  'Content-Disposition' => "attachment; filename=\"#{filename}\""
@@ -396,6 +397,7 @@ module Technoweenie # :nodoc:
396
397
  (temp_path ? File.open(temp_path) : temp_data),
397
398
  bucket_name,
398
399
  :content_type => content_type,
400
+ :cache_control => attachment_options[:cache_control],
399
401
  :access => attachment_options[:s3_access]
400
402
  )
401
403
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pothoven-attachment_fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.9
4
+ version: 3.2.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-08-21 00:00:00.000000000 Z
13
+ date: 2013-08-22 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: This is a fork of Rick Olson's attachment_fu adding Ruby 1.9 and Rails
16
16
  3.2 support as well as some other enhancements.