light_resizer 0.1.7 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +13 -1
  3. data/README.md +2 -12
  4. data/lib/light_resizer.rb +14 -2
  5. data/lib/light_resizer/carrierwave_resize.rb +5 -18
  6. data/lib/light_resizer/dimension_not_found.rb +6 -0
  7. data/lib/light_resizer/middleware.rb +10 -34
  8. data/lib/light_resizer/resizer.rb +72 -0
  9. data/lib/light_resizer/version.rb +2 -2
  10. data/light_resizer.gemspec +5 -8
  11. data/spec/dummy/.gitignore +17 -0
  12. data/spec/dummy/README.rdoc +28 -0
  13. data/spec/dummy/Rakefile +6 -0
  14. data/spec/dummy/app/assets/images/.keep +0 -0
  15. data/spec/dummy/app/assets/javascripts/application.js +16 -0
  16. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  17. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  18. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  19. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  20. data/spec/dummy/app/mailers/.keep +0 -0
  21. data/spec/dummy/app/models/.keep +0 -0
  22. data/spec/dummy/app/models/concerns/.keep +0 -0
  23. data/spec/dummy/app/uploaders/photo_uploader.rb +5 -0
  24. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  25. data/spec/dummy/bin/bundle +3 -0
  26. data/spec/dummy/bin/rails +4 -0
  27. data/spec/dummy/bin/rake +4 -0
  28. data/spec/dummy/bin/setup +29 -0
  29. data/spec/dummy/config.ru +4 -0
  30. data/spec/dummy/config/application.rb +19 -0
  31. data/spec/dummy/config/boot.rb +3 -0
  32. data/spec/dummy/config/environment.rb +5 -0
  33. data/spec/dummy/config/environments/development.rb +38 -0
  34. data/spec/dummy/config/environments/production.rb +74 -0
  35. data/spec/dummy/config/environments/test.rb +39 -0
  36. data/spec/dummy/config/initializers/assets.rb +11 -0
  37. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  38. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  39. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  40. data/spec/dummy/config/initializers/inflections.rb +16 -0
  41. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  42. data/spec/dummy/config/initializers/session_store.rb +3 -0
  43. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  44. data/spec/dummy/config/locales/en.yml +23 -0
  45. data/spec/dummy/config/routes.rb +56 -0
  46. data/spec/dummy/config/secrets.yml +22 -0
  47. data/spec/dummy/db/seeds.rb +7 -0
  48. data/spec/dummy/lib/assets/.keep +0 -0
  49. data/spec/dummy/lib/tasks/.keep +0 -0
  50. data/spec/dummy/public/404.html +67 -0
  51. data/spec/dummy/public/422.html +67 -0
  52. data/spec/dummy/public/500.html +66 -0
  53. data/spec/dummy/public/favicon.ico +0 -0
  54. data/spec/dummy/public/robots.txt +5 -0
  55. data/spec/dummy/public/uploads/test/.gitignore +1 -0
  56. data/spec/dummy/public/uploads/test/dragon.jpg +0 -0
  57. data/spec/features/carrier_wave_resize_spec.rb +20 -0
  58. data/spec/features/middleware_spec.rb +82 -0
  59. data/spec/spec_helper.rb +16 -5
  60. metadata +116 -79
  61. data/lib/light_resizer/image_loader.rb +0 -48
  62. data/lib/light_resizer/image_loader/original_image.rb +0 -39
  63. data/lib/light_resizer/image_loader/resize_image.rb +0 -51
  64. data/lib/light_resizer/middleware/path.rb +0 -71
  65. data/lib/light_resizer/middleware/resizer.rb +0 -45
  66. data/spec/fixtures/sample.jpg +0 -0
  67. data/spec/integration/middleware_spec.rb +0 -37
  68. data/spec/unit/image_loader_original_spec.rb +0 -29
  69. data/spec/unit/image_loader_resized_spec.rb +0 -45
  70. data/spec/unit/image_loader_spec.rb +0 -23
  71. data/spec/unit/middleware_path_spec.rb +0 -53
  72. data/spec/unit/middleware_resizer_spec.rb +0 -35
@@ -1,35 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe LightResizer::Middleware::Resizer do
4
-
5
- let(:resizer) { described_class.new }
6
- let(:image_path) { File.join(ROOT, 'fixtures', 'sample') }
7
- let(:resize_image_path) { File.join(ROOT, 'fixtures', 'light_resize', image_name) }
8
-
9
- context 'resize' do
10
-
11
- after do
12
- File.delete( resize_image_path + '.png' )
13
- end
14
-
15
- context 'without crop' do
16
- let(:image_name) { '50x50_sample' }
17
-
18
- it 'should create resized image file' do
19
- resizer.resize('50x50', image_path, resize_image_path, false, '.png', true)
20
- expect(File.exist?(resize_image_path+'.png')).to eq(true)
21
- end
22
- end
23
-
24
- context 'with crop' do
25
- let(:image_name) { '50x50_crop_convert_sample' }
26
-
27
- it 'should create resized image file' do
28
- resizer.resize('50x50', image_path, resize_image_path, true, '.png', true)
29
- expect(File.exist?(resize_image_path+'.png')).to eq(true)
30
- end
31
- end
32
-
33
- end
34
-
35
- end