directlytos3 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -35,6 +35,7 @@ A full list of options that can be passed to the helpers are listed below
35
35
  - max_filesize: The maximum file size
36
36
  - randomize: Add a leading random string to avoid collisions
37
37
  - path: If you need to proxy the request using ajax
38
+ - cache_control: in seconds
38
39
 
39
40
  ## TODO
40
41
 
@@ -16,6 +16,7 @@ module Directlytos3
16
16
  options[:content_type] ||= MIME::Types.type_for("${filename}").to_s
17
17
  options[:redirect] ||= nil
18
18
  options[:acl] ||= 'public-read'
19
+ options[:cache_control] ||= '2592000'
19
20
  options[:expiration_date] ||= 10.hours.from_now.utc.xmlschema
20
21
  options[:max_filesize] ||= 1.megabyte
21
22
  options[:randomize] ||= false
@@ -75,6 +76,7 @@ module Directlytos3
75
76
  concat hidden_field_tag('policy', "#{policy}")
76
77
  concat hidden_field_tag('signature', "#{signature}")
77
78
  concat hidden_field_tag('Content-Type', "#{options[:content_type]}")
79
+ concat hidden_field_tag('Cache-Control', "public,max-age=#{options[:cache_control]}") if options[:cache_control]
78
80
  options.except!(:key, :access_key, :acl, :redirect, :content_type, :secret_key, :randomize, :expiration_date, :max_filesize, :path, :status)
79
81
  end
80
82
 
@@ -19,6 +19,7 @@ module Directlytos3::S3
19
19
  ["starts-with", "$key", options[:key]],
20
20
  {"acl" => options[:acl]},
21
21
  ["starts-with", "$Content-Type", ''],
22
+ ["starts-with", "$Cache-Control", ""],
22
23
  ["content-length-range", 0, options[:max_filesize]]
23
24
  ]
24
25
  }
@@ -1,3 +1,3 @@
1
1
  module Directlytos3
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: directlytos3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-06 00:00:00.000000000Z
12
+ date: 2012-01-12 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
16
- requirement: &70171899550120 !ruby/object:Gem::Requirement
16
+ requirement: &70146913198420 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70171899550120
24
+ version_requirements: *70146913198420
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: actionpack
27
- requirement: &70171899549620 !ruby/object:Gem::Requirement
27
+ requirement: &70146913197740 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '3'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70171899549620
35
+ version_requirements: *70146913197740
36
36
  description: A rails helper to create an S3 upload form
37
37
  email:
38
38
  - scott@tesoriere.com