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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d11949c33c4d40cd6f60105ab513b4a86e3a0174
4
- data.tar.gz: ebc1978bc5ce720a5f935ce489d19c0359ac2502
3
+ metadata.gz: bd6a7301d75a6caac36f9145a424d0a9b9b58fd9
4
+ data.tar.gz: 8abafd9064e7eb4c3a1c6e4b94e83a044ccb50ea
5
5
  SHA512:
6
- metadata.gz: f28057c0ddec32a220adfbf448240a816ea1fc85c240d1a34b997cb2fc27f1255f12ebe119d3e0381bc6c4521e53c0b5ba67692fdd89737de37fefb8eb7ea598
7
- data.tar.gz: 8ca98453654043da7aec1c5d0ff6bfde99ab6ae35012955a5fd76d51578c58b8cbf704d681347f7dc3438e320ddf4f62283b43ab225f9269214c16bf7c408976
6
+ metadata.gz: b4550b4919295cf25604c59571f1a9e909944aa22c018c656b399d0cc7d0a57e3161d7ad20f441efd5d417ab5439f2cc9f5c1ca1e3224e926237767d9621cf80
7
+ data.tar.gz: 1e057f5788d50110374f98a5f26d6c5326e0a30a7e1981a4609afc9eda4cbdffd7b60dcb73800efef5fd89aa71c44f51e9722ab53ac60911435cde0c04a8235a
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
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
@@ -1 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+ RSpec::Core::RakeTask.new(:spec) do |t|
4
+ end
5
+
6
+ task :default => :spec
@@ -76,7 +76,7 @@ module S3BrowserUploads
76
76
 
77
77
  def policy_document
78
78
  {
79
- 'expiration' => expires.xmlschema,
79
+ 'expiration' => expires.utc.xmlschema,
80
80
  'conditions' => @conditions.values
81
81
  }
82
82
  end
@@ -1,3 +1,3 @@
1
1
  module S3BrowserUploads
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -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 "rails", "~> 3.2.13"
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
@@ -1,6 +1,8 @@
1
1
  require 'bundler/setup'
2
2
  require 's3_browser_uploads'
3
3
  require 'action_controller'
4
+ require 'active_support/time_with_zone'
5
+ require 'tzinfo'
4
6
  module Rails
5
7
  module VERSION
6
8
  STRING = '3.2.13'
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.0
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: rails
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