directlytos3 0.1.4 → 0.1.5
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 +3 -1
- 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
|
+
- status: If you need to specify the success_action_status
|
38
39
|
|
39
40
|
## TODO
|
40
41
|
|
@@ -19,6 +19,7 @@ module Directlytos3
|
|
19
19
|
options[:expiration_date] ||= 10.hours.from_now.utc.xmlschema
|
20
20
|
options[:max_filesize] ||= 1.megabyte
|
21
21
|
options[:randomize] ||= false
|
22
|
+
options[:status] ||= 200
|
22
23
|
raise Directlytos3::Exceptions::NoBucketSpecified if !options[:bucket]
|
23
24
|
raise Directlytos3::Exceptions::MissingAccessKey, "secret" if !options[:secret_key]
|
24
25
|
raise Directlytos3::Exceptions::MissingAccessKey, "public" if !options[:access_key]
|
@@ -70,10 +71,11 @@ module Directlytos3
|
|
70
71
|
concat hidden_field_tag('AWSAccessKeyId', "#{options[:access_key]}")
|
71
72
|
concat hidden_field_tag('acl', "#{options[:acl]}")
|
72
73
|
concat hidden_field_tag('success_action_redirect', "#{options[:redirect]}")
|
74
|
+
concat hidden_field_tag('success_action_status', "#{options[:status]}")
|
73
75
|
concat hidden_field_tag('policy', "#{policy}")
|
74
76
|
concat hidden_field_tag('signature', "#{signature}")
|
75
77
|
concat hidden_field_tag('Content-Type', "#{options[:content_type]}")
|
76
|
-
options.except!(:key, :access_key, :acl, :redirect, :content_type, :secret_key, :randomize, :expiration_date, :max_filesize)
|
78
|
+
options.except!(:key, :access_key, :acl, :redirect, :content_type, :secret_key, :randomize, :expiration_date, :max_filesize, :path, :status)
|
77
79
|
end
|
78
80
|
|
79
81
|
end
|
data/lib/directlytos3/s3.rb
CHANGED
@@ -19,6 +19,7 @@ module Directlytos3::S3
|
|
19
19
|
["starts-with", "$key", options[:key]],
|
20
20
|
{"acl" => options[:acl]},
|
21
21
|
{"success_action_redirect" => options[:redirect]},
|
22
|
+
{"success_action_status" => options[:status]},
|
22
23
|
["starts-with", "$Content-Type", ''],
|
23
24
|
["content-length-range", 0, options[:max_filesize]]
|
24
25
|
]
|
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.5
|
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-
|
12
|
+
date: 2011-12-06 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
16
|
-
requirement: &
|
16
|
+
requirement: &70319987119740 !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: *70319987119740
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: actionpack
|
27
|
-
requirement: &
|
27
|
+
requirement: &70319987119240 !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: *70319987119240
|
36
36
|
description: A rails helper to create an S3 upload form
|
37
37
|
email:
|
38
38
|
- scott@tesoriere.com
|