refile 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +56 -0
  3. data/.travis.yml +11 -0
  4. data/Gemfile +1 -1
  5. data/History.md +15 -0
  6. data/README.md +41 -5
  7. data/Rakefile +4 -1
  8. data/config/locales/en.yml +2 -0
  9. data/config/routes.rb +4 -2
  10. data/lib/refile/app.rb +96 -71
  11. data/lib/refile/attacher.rb +115 -0
  12. data/lib/refile/attachment/active_record.rb +5 -5
  13. data/lib/refile/attachment.rb +50 -117
  14. data/lib/refile/backend/file_system.rb +3 -3
  15. data/lib/refile/backend/s3.rb +7 -12
  16. data/lib/refile/file.rb +1 -3
  17. data/lib/refile/image_processing.rb +6 -3
  18. data/lib/refile/rails/attachment_helper.rb +18 -21
  19. data/lib/refile/rails.rb +2 -1
  20. data/lib/refile/random_hasher.rb +9 -8
  21. data/lib/refile/signature.rb +16 -0
  22. data/lib/refile/version.rb +1 -1
  23. data/lib/refile.rb +59 -1
  24. data/refile.gemspec +10 -6
  25. data/spec/refile/app_spec.rb +28 -4
  26. data/spec/refile/attachment_spec.rb +134 -33
  27. data/spec/refile/backend_examples.rb +7 -11
  28. data/spec/refile/features/direct_upload_spec.rb +0 -1
  29. data/spec/refile/features/normal_upload_spec.rb +21 -0
  30. data/spec/refile/features/presigned_upload_spec.rb +0 -1
  31. data/spec/refile/rails/attachment_helper_spec.rb +61 -0
  32. data/spec/refile/spec_helper.rb +26 -20
  33. data/spec/refile/test_app/app/controllers/normal_posts_controller.rb +10 -1
  34. data/spec/refile/test_app/app/controllers/presigned_posts_controller.rb +1 -0
  35. data/spec/refile/test_app/app/models/post.rb +1 -1
  36. data/spec/refile/test_app/app/views/normal_posts/index.html +5 -0
  37. data/spec/refile/test_app/app/views/normal_posts/show.html.erb +2 -0
  38. data/spec/refile/test_app/config/routes.rb +1 -1
  39. data/spec/refile/test_app.rb +13 -6
  40. data/spec/refile_spec.rb +39 -0
  41. metadata +51 -2
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Nicklas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-14 00:00:00.000000000 Z
11
+ date: 2014-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -24,6 +24,34 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.7.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: sinatra
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.4.5
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.4.5
41
+ - !ruby/object:Gem::Dependency
42
+ name: mime-types
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: webmock
29
57
  requirement: !ruby/object:Gem::Requirement
@@ -220,6 +248,20 @@ dependencies:
220
248
  - - ">="
221
249
  - !ruby/object:Gem::Version
222
250
  version: '0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: rubocop
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
223
265
  description:
224
266
  email:
225
267
  - jonas.nicklas@gmail.com
@@ -229,6 +271,7 @@ extra_rdoc_files: []
229
271
  files:
230
272
  - ".gitignore"
231
273
  - ".rspec"
274
+ - ".rubocop.yml"
232
275
  - ".travis.yml"
233
276
  - Gemfile
234
277
  - History.md
@@ -241,6 +284,7 @@ files:
241
284
  - config/routes.rb
242
285
  - lib/refile.rb
243
286
  - lib/refile/app.rb
287
+ - lib/refile/attacher.rb
244
288
  - lib/refile/attachment.rb
245
289
  - lib/refile/attachment/active_record.rb
246
290
  - lib/refile/backend/file_system.rb
@@ -250,6 +294,7 @@ files:
250
294
  - lib/refile/rails.rb
251
295
  - lib/refile/rails/attachment_helper.rb
252
296
  - lib/refile/random_hasher.rb
297
+ - lib/refile/signature.rb
253
298
  - lib/refile/version.rb
254
299
  - refile.gemspec
255
300
  - spec/refile/app_spec.rb
@@ -262,6 +307,7 @@ files:
262
307
  - spec/refile/features/presigned_upload_spec.rb
263
308
  - spec/refile/fixtures/hello.txt
264
309
  - spec/refile/fixtures/large.txt
310
+ - spec/refile/rails/attachment_helper_spec.rb
265
311
  - spec/refile/spec_helper.rb
266
312
  - spec/refile/test_app.rb
267
313
  - spec/refile/test_app/app/assets/javascripts/application.js
@@ -276,6 +322,7 @@ files:
276
322
  - spec/refile/test_app/app/views/layouts/application.html.erb
277
323
  - spec/refile/test_app/app/views/normal_posts/_form.html.erb
278
324
  - spec/refile/test_app/app/views/normal_posts/edit.html.erb
325
+ - spec/refile/test_app/app/views/normal_posts/index.html
279
326
  - spec/refile/test_app/app/views/normal_posts/new.html.erb
280
327
  - spec/refile/test_app/app/views/normal_posts/show.html.erb
281
328
  - spec/refile/test_app/app/views/presigned_posts/new.html.erb
@@ -319,6 +366,7 @@ test_files:
319
366
  - spec/refile/features/presigned_upload_spec.rb
320
367
  - spec/refile/fixtures/hello.txt
321
368
  - spec/refile/fixtures/large.txt
369
+ - spec/refile/rails/attachment_helper_spec.rb
322
370
  - spec/refile/spec_helper.rb
323
371
  - spec/refile/test_app.rb
324
372
  - spec/refile/test_app/app/assets/javascripts/application.js
@@ -333,6 +381,7 @@ test_files:
333
381
  - spec/refile/test_app/app/views/layouts/application.html.erb
334
382
  - spec/refile/test_app/app/views/normal_posts/_form.html.erb
335
383
  - spec/refile/test_app/app/views/normal_posts/edit.html.erb
384
+ - spec/refile/test_app/app/views/normal_posts/index.html
336
385
  - spec/refile/test_app/app/views/normal_posts/new.html.erb
337
386
  - spec/refile/test_app/app/views/normal_posts/show.html.erb
338
387
  - spec/refile/test_app/app/views/presigned_posts/new.html.erb