carrierwave-bombshelter 0.1.1.5 → 0.1.1.6

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: 72e85d0feddee1372b0ee3c12c71ce88b7134e33
4
- data.tar.gz: 201f96f9f1bf71111c9ca98db15a83939481e756
3
+ metadata.gz: ddc7a42dec427229cd79adddd0c03ad8bf33e41c
4
+ data.tar.gz: 9693a53421f74da194e5462723a8ccedb9bec55f
5
5
  SHA512:
6
- metadata.gz: 221139b8826d8489764900dcacfce9e337610f7fe0e2d6c77757c256525c1295347321c6ad8cf88936305660089daa23cb5aa6ad8c47e1e487c2e36e26927d40
7
- data.tar.gz: e5c20a67b6d9872cf5adf2853a549343d2b5da415733aafdb2f08656e760280d8de8314d8699885d39993ca9d5e135d742917138855cc5cf8c99de574169c265
6
+ metadata.gz: c5f9d4ac7e4746b93da1b9468d7af7d96d69abced9dbb2c75ebf6e28e9636f28dce9cdff020f8601191c0a382b0cf2a90a12a6d17ac1206f0db5dd6afea5e52d
7
+ data.tar.gz: 2352d890f35459d9e952a364ea38952a54ffb3d84ced7d71c1420d6b1e7f775a46e991f9c0a79119f65305829cf2901e8019d6afa1289159ecc58d3825536f7b
@@ -17,8 +17,9 @@ module CarrierWave
17
17
  # `before` puts callback in the end of queue, but we need to run this
18
18
  # callback first.
19
19
  # before :cache, :protect_from_image_bomb!
20
- self._before_callbacks = _before_callbacks
21
- .merge(cache: [:protect_from_image_bomb!] + _before_callbacks[:cache])
20
+ self._before_callbacks = _before_callbacks.merge(
21
+ cache: [:protect_from_image_bomb!] + _before_callbacks[:cache]
22
+ )
22
23
  end
23
24
 
24
25
  def max_pixel_dimensions
@@ -35,19 +36,22 @@ module CarrierWave
35
36
 
36
37
  def check_image_type!(image)
37
38
  return if image.type
38
- fail CarrierWave::IntegrityError,
39
- I18n.translate(:'errors.messages.not_image')
39
+ raise CarrierWave::IntegrityError,
40
+ I18n.translate(:'errors.messages.not_image')
40
41
  end
41
42
 
42
43
  def check_pixel_dimensions!(image)
43
44
  max_sizes = max_pixel_dimensions
44
- return if image.size[0] <= max_sizes[0] && image.size[1] <= max_sizes[1]
45
45
 
46
- fail CarrierWave::IntegrityError,
47
- I18n.translate(
48
- :'errors.messages.pixel_dimensions_error',
49
- x_size: max_sizes[0], y_size: max_sizes[1]
50
- )
46
+ return if image.size &&
47
+ image.size[0] <= max_sizes[0] &&
48
+ image.size[1] <= max_sizes[1]
49
+
50
+ raise CarrierWave::IntegrityError,
51
+ I18n.translate(
52
+ :'errors.messages.pixel_dimensions_error',
53
+ x_size: max_sizes[0], y_size: max_sizes[1]
54
+ )
51
55
  end
52
56
 
53
57
  def get_real_file(file)
@@ -1,5 +1,5 @@
1
1
  module CarrierWave
2
2
  module BombShelter
3
- VERSION = '0.1.1.5'
3
+ VERSION = '0.1.1.6'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave-bombshelter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.5
4
+ version: 0.1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - DarthSim
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-14 00:00:00.000000000 Z
11
+ date: 2016-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler