s3_browser_uploads 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -0
- data/README.md +14 -1
- data/Rakefile +5 -0
- data/lib/s3_browser_uploads/form_definition.rb +1 -1
- data/lib/s3_browser_uploads/version.rb +1 -1
- data/s3_browser_uploads.gemspec +3 -1
- data/spec/form_definition_spec.rb +9 -1
- data/spec/spec_helper.rb +2 -0
- metadata +31 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd6a7301d75a6caac36f9145a424d0a9b9b58fd9
|
4
|
+
data.tar.gz: 8abafd9064e7eb4c3a1c6e4b94e83a044ccb50ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4550b4919295cf25604c59571f1a9e909944aa22c018c656b399d0cc7d0a57e3161d7ad20f441efd5d417ab5439f2cc9f5c1ca1e3224e926237767d9621cf80
|
7
|
+
data.tar.gz: 1e057f5788d50110374f98a5f26d6c5326e0a30a7e1981a4609afc9eda4cbdffd7b60dcb73800efef5fd89aa71c44f51e9722ab53ac60911435cde0c04a8235a
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
# S3BrowserUploads
|
2
|
+
[![Build Status](https://travis-ci.org/fcheung/s3_browser_uploads.png)](https://travis-ci.org/fcheung/s3_browser_uploads)
|
2
3
|
|
3
|
-
Easy straight-to-s3 uploads from your browser for rails. Takes care of policy documents and all that jazz
|
4
|
+
Easy straight-to-s3 uploads from your browser for rails. Takes care of policy documents and all that jazz. More details [http://www.spacevatican.org/2013/7/7/direct-to-s3-browser-uploads](here)
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add
|
9
|
+
|
10
|
+
gem 's3_browser_uploads'
|
11
|
+
|
12
|
+
to your gemfile
|
4
13
|
|
5
14
|
## Example Usage
|
6
15
|
|
@@ -30,3 +39,7 @@ Call `add_field` to add a hidden field both to the form and to the policy docume
|
|
30
39
|
|
31
40
|
This adds `acl` to the policy document and states that it can take any value. Then you'd need to add an input to the form that would allow the user to choose the acl.
|
32
41
|
|
42
|
+
|
43
|
+
You can restrict the allowable size of the upload to 1MB with
|
44
|
+
|
45
|
+
@form_definition.restrict_content_length 0..1024*1024
|
data/Rakefile
CHANGED
data/s3_browser_uploads.gemspec
CHANGED
@@ -22,6 +22,8 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency "rake"
|
23
23
|
spec.add_development_dependency "rspec", "~> 2.13.0"
|
24
24
|
spec.add_development_dependency "rspec-rails", "~> 2.13.0"
|
25
|
-
spec.add_development_dependency "
|
25
|
+
spec.add_development_dependency "actionpack", "~> 3.2.13"
|
26
|
+
spec.add_development_dependency "tzinfo"
|
26
27
|
spec.add_development_dependency "capybara", "~> 2.1.0"
|
28
|
+
spec.add_development_dependency "nokogiri", "~> 1.5.10"
|
27
29
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
-
|
3
2
|
describe S3BrowserUploads::FormDefinition do
|
4
3
|
|
5
4
|
let(:expires_at) {Time.now + 1800}
|
@@ -59,6 +58,15 @@ describe S3BrowserUploads::FormDefinition do
|
|
59
58
|
form.policy_document['expiration'].should == expires_at.xmlschema
|
60
59
|
end
|
61
60
|
|
61
|
+
context 'the expires an ActiveSupport::TimeZone' do
|
62
|
+
let(:expires_at) do
|
63
|
+
ActiveSupport::TimeZone['America/New_York' ].now
|
64
|
+
end
|
65
|
+
it 'should convert to gmt' do
|
66
|
+
form.policy_document['expiration'].should == expires_at.utc.xmlschema
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
62
70
|
context 'with no conditions added' do
|
63
71
|
it 'should have a condition on the bucket' do
|
64
72
|
form.policy_document['conditions'].should == [{'bucket' => 'some-bucket'}]
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s3_browser_uploads
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frederick Cheung
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 2.13.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: actionpack
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ~>
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 3.2.13
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: tzinfo
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: capybara
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,6 +108,20 @@ dependencies:
|
|
94
108
|
- - ~>
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: 2.1.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: nokogiri
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 1.5.10
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ~>
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.5.10
|
97
125
|
description: Easy straight-to-s3 uploads from your browser
|
98
126
|
email:
|
99
127
|
- frederick.cheung@gmail.com
|
@@ -102,6 +130,7 @@ extensions: []
|
|
102
130
|
extra_rdoc_files: []
|
103
131
|
files:
|
104
132
|
- .gitignore
|
133
|
+
- .travis.yml
|
105
134
|
- Gemfile
|
106
135
|
- LICENSE.txt
|
107
136
|
- README.md
|