mongoid-direct-s3-upload 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +250 -0
  4. data/Rakefile +31 -0
  5. data/app/assets/javascripts/s3_relay.coffee +118 -0
  6. data/app/assets/stylesheets/s3_relay.css +31 -0
  7. data/app/controllers/s3_relay/uploads_controller.rb +71 -0
  8. data/app/helpers/s3_relay/uploads_helper.rb +24 -0
  9. data/app/models/s3_relay/upload.rb +73 -0
  10. data/config/routes.rb +5 -0
  11. data/lib/s3_relay.rb +4 -0
  12. data/lib/s3_relay/base.rb +35 -0
  13. data/lib/s3_relay/engine.rb +16 -0
  14. data/lib/s3_relay/model.rb +51 -0
  15. data/lib/s3_relay/private_url.rb +37 -0
  16. data/lib/s3_relay/s3_relay.rb +4 -0
  17. data/lib/s3_relay/upload_presigner.rb +61 -0
  18. data/lib/s3_relay/version.rb +3 -0
  19. data/test/controllers/s3_relay/uploads_controller_test.rb +144 -0
  20. data/test/dummy/README.md +24 -0
  21. data/test/dummy/Rakefile +6 -0
  22. data/test/dummy/app/assets/config/manifest.js +3 -0
  23. data/test/dummy/app/assets/javascripts/application.js +15 -0
  24. data/test/dummy/app/assets/javascripts/cable.js +13 -0
  25. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  26. data/test/dummy/app/channels/application_cable/channel.rb +4 -0
  27. data/test/dummy/app/channels/application_cable/connection.rb +4 -0
  28. data/test/dummy/app/controllers/application_controller.rb +3 -0
  29. data/test/dummy/app/helpers/application_helper.rb +2 -0
  30. data/test/dummy/app/jobs/application_job.rb +2 -0
  31. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  32. data/test/dummy/app/models/application_record.rb +3 -0
  33. data/test/dummy/app/models/product.rb +6 -0
  34. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  35. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  36. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  37. data/test/dummy/bin/bundle +3 -0
  38. data/test/dummy/bin/rails +9 -0
  39. data/test/dummy/bin/rake +9 -0
  40. data/test/dummy/bin/setup +38 -0
  41. data/test/dummy/bin/spring +17 -0
  42. data/test/dummy/bin/update +29 -0
  43. data/test/dummy/bin/yarn +11 -0
  44. data/test/dummy/config.ru +5 -0
  45. data/test/dummy/config/application.rb +19 -0
  46. data/test/dummy/config/boot.rb +3 -0
  47. data/test/dummy/config/cable.yml +10 -0
  48. data/test/dummy/config/database.yml +22 -0
  49. data/test/dummy/config/environment.rb +5 -0
  50. data/test/dummy/config/environments/development.rb +54 -0
  51. data/test/dummy/config/environments/production.rb +91 -0
  52. data/test/dummy/config/environments/test.rb +42 -0
  53. data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
  54. data/test/dummy/config/initializers/assets.rb +14 -0
  55. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  56. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  57. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  58. data/test/dummy/config/initializers/inflections.rb +16 -0
  59. data/test/dummy/config/initializers/mime_types.rb +4 -0
  60. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  61. data/test/dummy/config/locales/en.yml +33 -0
  62. data/test/dummy/config/puma.rb +56 -0
  63. data/test/dummy/config/routes.rb +7 -0
  64. data/test/dummy/config/secrets.yml +32 -0
  65. data/test/dummy/config/spring.rb +6 -0
  66. data/test/dummy/db/migrate/20141021002149_create_products.rb +9 -0
  67. data/test/dummy/db/schema.rb +41 -0
  68. data/test/dummy/db/seeds.rb +7 -0
  69. data/test/dummy/package.json +5 -0
  70. data/test/dummy/public/404.html +67 -0
  71. data/test/dummy/public/422.html +67 -0
  72. data/test/dummy/public/500.html +66 -0
  73. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  74. data/test/dummy/public/apple-touch-icon.png +0 -0
  75. data/test/dummy/public/favicon.ico +0 -0
  76. data/test/dummy/public/robots.txt +1 -0
  77. data/test/dummy/test/application_system_test_case.rb +5 -0
  78. data/test/dummy/test/test_helper.rb +9 -0
  79. data/test/factories/products.rb +5 -0
  80. data/test/factories/uploads.rb +23 -0
  81. data/test/helpers/s3_relay/uploads_helper_test.rb +29 -0
  82. data/test/lib/s3_relay/model_test.rb +66 -0
  83. data/test/lib/s3_relay/private_url_test.rb +28 -0
  84. data/test/lib/s3_relay/upload_presigner_test.rb +38 -0
  85. data/test/models/s3_relay/upload_test.rb +142 -0
  86. data/test/support/database_cleaner.rb +14 -0
  87. data/test/test_helper.rb +29 -0
  88. metadata +356 -0
@@ -0,0 +1,29 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+
3
+ IS_RAKE_TASK = (!! ($0 =~ /rake/))
4
+
5
+ if IS_RAKE_TASK
6
+ require "simplecov"
7
+ SimpleCov.start "rails" do
8
+ add_filter "db"
9
+ add_filter "test"
10
+ add_filter "config"
11
+
12
+ add_group "Services", "app/services"
13
+ add_group "Uploaders", "app/services"
14
+ end
15
+ end
16
+
17
+ ENV["RAILS_ENV"] = "test"
18
+ require File.expand_path("../dummy/config/environment", __FILE__)
19
+
20
+ Dir[File.join("./test/factories/*.rb")].sort.each { |f| require f }
21
+
22
+ require "minitest/autorun"
23
+ require "rails/generators"
24
+ require "rails/test_help"
25
+ require "minitest/rails"
26
+ require "minitest/pride"
27
+ require "mocha/mini_test"
28
+
29
+ Dir[File.join("./test/support/*.rb")].sort.each { |f| require f }
metadata ADDED
@@ -0,0 +1,356 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mongoid-direct-s3-upload
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - hartator
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-06-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: coffee-rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '5.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '5.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: addressable
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 2.3.8
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 2.3.8
55
+ - !ruby/object:Gem::Dependency
56
+ name: guard-minitest
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.4'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 2.4.6
65
+ type: :development
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '2.4'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 2.4.6
75
+ - !ruby/object:Gem::Dependency
76
+ name: minitest-rails
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: 3.0.0
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: 3.0.0
85
+ type: :development
86
+ prerelease: false
87
+ version_requirements: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: 3.0.0
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: 3.0.0
95
+ - !ruby/object:Gem::Dependency
96
+ name: mocha
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - "~>"
100
+ - !ruby/object:Gem::Version
101
+ version: '1.2'
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: 1.2.1
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '1.2'
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: 1.2.1
115
+ - !ruby/object:Gem::Dependency
116
+ name: pg
117
+ requirement: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - "~>"
120
+ - !ruby/object:Gem::Version
121
+ version: '0.21'
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: 0.21.0
125
+ type: :development
126
+ prerelease: false
127
+ version_requirements: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.21'
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: 0.21.0
135
+ - !ruby/object:Gem::Dependency
136
+ name: simplecov
137
+ requirement: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - "~>"
140
+ - !ruby/object:Gem::Version
141
+ version: '0.14'
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: 0.14.1
145
+ type: :development
146
+ prerelease: false
147
+ version_requirements: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '0.14'
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ version: 0.14.1
155
+ - !ruby/object:Gem::Dependency
156
+ name: thor
157
+ requirement: !ruby/object:Gem::Requirement
158
+ requirements:
159
+ - - ">="
160
+ - !ruby/object:Gem::Version
161
+ version: '0'
162
+ type: :development
163
+ prerelease: false
164
+ version_requirements: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - ">="
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
169
+ description: Rails and Mongoid simplest helpers possible to directly upload file to
170
+ S3 without hitting the server. Support concurrent uploads, progress bars, and more.
171
+ email: hartator@gmail.com
172
+ executables: []
173
+ extensions: []
174
+ extra_rdoc_files: []
175
+ files:
176
+ - MIT-LICENSE
177
+ - README.md
178
+ - Rakefile
179
+ - app/assets/javascripts/s3_relay.coffee
180
+ - app/assets/stylesheets/s3_relay.css
181
+ - app/controllers/s3_relay/uploads_controller.rb
182
+ - app/helpers/s3_relay/uploads_helper.rb
183
+ - app/models/s3_relay/upload.rb
184
+ - config/routes.rb
185
+ - lib/s3_relay.rb
186
+ - lib/s3_relay/base.rb
187
+ - lib/s3_relay/engine.rb
188
+ - lib/s3_relay/model.rb
189
+ - lib/s3_relay/private_url.rb
190
+ - lib/s3_relay/s3_relay.rb
191
+ - lib/s3_relay/upload_presigner.rb
192
+ - lib/s3_relay/version.rb
193
+ - test/controllers/s3_relay/uploads_controller_test.rb
194
+ - test/dummy/README.md
195
+ - test/dummy/Rakefile
196
+ - test/dummy/app/assets/config/manifest.js
197
+ - test/dummy/app/assets/javascripts/application.js
198
+ - test/dummy/app/assets/javascripts/cable.js
199
+ - test/dummy/app/assets/stylesheets/application.css
200
+ - test/dummy/app/channels/application_cable/channel.rb
201
+ - test/dummy/app/channels/application_cable/connection.rb
202
+ - test/dummy/app/controllers/application_controller.rb
203
+ - test/dummy/app/helpers/application_helper.rb
204
+ - test/dummy/app/jobs/application_job.rb
205
+ - test/dummy/app/mailers/application_mailer.rb
206
+ - test/dummy/app/models/application_record.rb
207
+ - test/dummy/app/models/product.rb
208
+ - test/dummy/app/views/layouts/application.html.erb
209
+ - test/dummy/app/views/layouts/mailer.html.erb
210
+ - test/dummy/app/views/layouts/mailer.text.erb
211
+ - test/dummy/bin/bundle
212
+ - test/dummy/bin/rails
213
+ - test/dummy/bin/rake
214
+ - test/dummy/bin/setup
215
+ - test/dummy/bin/spring
216
+ - test/dummy/bin/update
217
+ - test/dummy/bin/yarn
218
+ - test/dummy/config.ru
219
+ - test/dummy/config/application.rb
220
+ - test/dummy/config/boot.rb
221
+ - test/dummy/config/cable.yml
222
+ - test/dummy/config/database.yml
223
+ - test/dummy/config/environment.rb
224
+ - test/dummy/config/environments/development.rb
225
+ - test/dummy/config/environments/production.rb
226
+ - test/dummy/config/environments/test.rb
227
+ - test/dummy/config/initializers/application_controller_renderer.rb
228
+ - test/dummy/config/initializers/assets.rb
229
+ - test/dummy/config/initializers/backtrace_silencers.rb
230
+ - test/dummy/config/initializers/cookies_serializer.rb
231
+ - test/dummy/config/initializers/filter_parameter_logging.rb
232
+ - test/dummy/config/initializers/inflections.rb
233
+ - test/dummy/config/initializers/mime_types.rb
234
+ - test/dummy/config/initializers/wrap_parameters.rb
235
+ - test/dummy/config/locales/en.yml
236
+ - test/dummy/config/puma.rb
237
+ - test/dummy/config/routes.rb
238
+ - test/dummy/config/secrets.yml
239
+ - test/dummy/config/spring.rb
240
+ - test/dummy/db/migrate/20141021002149_create_products.rb
241
+ - test/dummy/db/schema.rb
242
+ - test/dummy/db/seeds.rb
243
+ - test/dummy/package.json
244
+ - test/dummy/public/404.html
245
+ - test/dummy/public/422.html
246
+ - test/dummy/public/500.html
247
+ - test/dummy/public/apple-touch-icon-precomposed.png
248
+ - test/dummy/public/apple-touch-icon.png
249
+ - test/dummy/public/favicon.ico
250
+ - test/dummy/public/robots.txt
251
+ - test/dummy/test/application_system_test_case.rb
252
+ - test/dummy/test/test_helper.rb
253
+ - test/factories/products.rb
254
+ - test/factories/uploads.rb
255
+ - test/helpers/s3_relay/uploads_helper_test.rb
256
+ - test/lib/s3_relay/model_test.rb
257
+ - test/lib/s3_relay/private_url_test.rb
258
+ - test/lib/s3_relay/upload_presigner_test.rb
259
+ - test/models/s3_relay/upload_test.rb
260
+ - test/support/database_cleaner.rb
261
+ - test/test_helper.rb
262
+ homepage: http://github.com/hartator/mongoid-direct-s3-upload
263
+ licenses:
264
+ - MIT
265
+ metadata: {}
266
+ post_install_message:
267
+ rdoc_options: []
268
+ require_paths:
269
+ - lib
270
+ required_ruby_version: !ruby/object:Gem::Requirement
271
+ requirements:
272
+ - - ">="
273
+ - !ruby/object:Gem::Version
274
+ version: '0'
275
+ required_rubygems_version: !ruby/object:Gem::Requirement
276
+ requirements:
277
+ - - ">="
278
+ - !ruby/object:Gem::Version
279
+ version: '0'
280
+ requirements: []
281
+ rubyforge_project:
282
+ rubygems_version: 2.5.2
283
+ signing_key:
284
+ specification_version: 4
285
+ summary: Rails and Mongoid simplest helpers possible to directly upload file to S3
286
+ without hitting the server.
287
+ test_files:
288
+ - test/controllers/s3_relay/uploads_controller_test.rb
289
+ - test/dummy/app/assets/config/manifest.js
290
+ - test/dummy/app/assets/javascripts/application.js
291
+ - test/dummy/app/assets/javascripts/cable.js
292
+ - test/dummy/app/assets/stylesheets/application.css
293
+ - test/dummy/app/channels/application_cable/channel.rb
294
+ - test/dummy/app/channels/application_cable/connection.rb
295
+ - test/dummy/app/controllers/application_controller.rb
296
+ - test/dummy/app/helpers/application_helper.rb
297
+ - test/dummy/app/jobs/application_job.rb
298
+ - test/dummy/app/mailers/application_mailer.rb
299
+ - test/dummy/app/models/application_record.rb
300
+ - test/dummy/app/models/product.rb
301
+ - test/dummy/app/views/layouts/application.html.erb
302
+ - test/dummy/app/views/layouts/mailer.html.erb
303
+ - test/dummy/app/views/layouts/mailer.text.erb
304
+ - test/dummy/bin/bundle
305
+ - test/dummy/bin/rails
306
+ - test/dummy/bin/rake
307
+ - test/dummy/bin/setup
308
+ - test/dummy/bin/spring
309
+ - test/dummy/bin/update
310
+ - test/dummy/bin/yarn
311
+ - test/dummy/config/application.rb
312
+ - test/dummy/config/boot.rb
313
+ - test/dummy/config/cable.yml
314
+ - test/dummy/config/database.yml
315
+ - test/dummy/config/environment.rb
316
+ - test/dummy/config/environments/development.rb
317
+ - test/dummy/config/environments/production.rb
318
+ - test/dummy/config/environments/test.rb
319
+ - test/dummy/config/initializers/application_controller_renderer.rb
320
+ - test/dummy/config/initializers/assets.rb
321
+ - test/dummy/config/initializers/backtrace_silencers.rb
322
+ - test/dummy/config/initializers/cookies_serializer.rb
323
+ - test/dummy/config/initializers/filter_parameter_logging.rb
324
+ - test/dummy/config/initializers/inflections.rb
325
+ - test/dummy/config/initializers/mime_types.rb
326
+ - test/dummy/config/initializers/wrap_parameters.rb
327
+ - test/dummy/config/locales/en.yml
328
+ - test/dummy/config/puma.rb
329
+ - test/dummy/config/routes.rb
330
+ - test/dummy/config/secrets.yml
331
+ - test/dummy/config/spring.rb
332
+ - test/dummy/config.ru
333
+ - test/dummy/db/migrate/20141021002149_create_products.rb
334
+ - test/dummy/db/schema.rb
335
+ - test/dummy/db/seeds.rb
336
+ - test/dummy/package.json
337
+ - test/dummy/public/404.html
338
+ - test/dummy/public/422.html
339
+ - test/dummy/public/500.html
340
+ - test/dummy/public/apple-touch-icon-precomposed.png
341
+ - test/dummy/public/apple-touch-icon.png
342
+ - test/dummy/public/favicon.ico
343
+ - test/dummy/public/robots.txt
344
+ - test/dummy/Rakefile
345
+ - test/dummy/README.md
346
+ - test/dummy/test/application_system_test_case.rb
347
+ - test/dummy/test/test_helper.rb
348
+ - test/factories/products.rb
349
+ - test/factories/uploads.rb
350
+ - test/helpers/s3_relay/uploads_helper_test.rb
351
+ - test/lib/s3_relay/model_test.rb
352
+ - test/lib/s3_relay/private_url_test.rb
353
+ - test/lib/s3_relay/upload_presigner_test.rb
354
+ - test/models/s3_relay/upload_test.rb
355
+ - test/support/database_cleaner.rb
356
+ - test/test_helper.rb