directlytos3 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -0
- data/lib/directlytos3/form_helpers.rb +2 -0
- data/lib/directlytos3/s3.rb +1 -0
- data/lib/directlytos3/version.rb +1 -1
- metadata +6 -6
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
|
|
data/lib/directlytos3/s3.rb
CHANGED
data/lib/directlytos3/version.rb
CHANGED
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.
|
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:
|
12
|
+
date: 2012-01-12 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
16
|
-
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: *
|
24
|
+
version_requirements: *70146913198420
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: actionpack
|
27
|
-
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: *
|
35
|
+
version_requirements: *70146913197740
|
36
36
|
description: A rails helper to create an S3 upload form
|
37
37
|
email:
|
38
38
|
- scott@tesoriere.com
|