artwork 0.7.1 → 0.7.2

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: fc971fdfa3ebbcae98bc4a62e9c83c9cbb7d1a40
4
- data.tar.gz: 87e9c6714e3b40a73c1c9d648ec6dc20b7c957d3
3
+ metadata.gz: 706406a5c99a2c2c08fbf910749cc250725a88b7
4
+ data.tar.gz: 3b555e730a0aaad2708b0c75f1d78780fcacf3ea
5
5
  SHA512:
6
- metadata.gz: 3a760a29d15260f3606569b748d1718e2527d91453a6e045d0514683b8d919a98a358d07b49c7779af66b589a81ec026de905f5efe10ad96fe34ae759ed5b0f3
7
- data.tar.gz: 3f5850ba63d80d743293cde5f1b488d793f056a331eac8be013a6ca0f909a4c121fe8ec8870c919779c18caff27549f86f439d24de821c884a55f26b57d0dcb6
6
+ metadata.gz: 8cc3e0a95a39eb4c175d4572603a7371d63d3e6ae7fce2a547683d88a4d7718d477a0335e618e01e37ac6567b3088d7250d90ef47964dd13ba9b46ff09864c80
7
+ data.tar.gz: 7070f597ab0d885c94e9249ad56e3867b2b97df0fb4c444b33f978684f9bc9ded1eb34acc53996a8dcac1554b61faf554f84cf224e0092ab26da0e91f0aff98b
@@ -1,3 +1,10 @@
1
+ ## v0.7.2
2
+
3
+ - Use `Artwork.current_resolution` instead of `Artwork.actual_resolution` in
4
+ `artwork_thumb_for` when evaluating the alternative sizes. This is to allow
5
+ page and fragment caching where `Artwork.current_resolution` is in the cache
6
+ key.
7
+
1
8
  ## v0.7.1
2
9
 
3
10
  - Hotfix for the new alternative sizes when additional non-numeric option keys
@@ -65,7 +65,7 @@ module Artwork
65
65
  new_size_definition = alternative_sizes \
66
66
  .select { |key, value| key.is_a? Numeric } \
67
67
  .sort_by { |max_resolution, size| max_resolution } \
68
- .find { |max_resolution, size| Artwork.actual_resolution <= max_resolution }
68
+ .find { |max_resolution, size| Artwork.current_resolution <= max_resolution }
69
69
 
70
70
  new_size_definition.last if new_size_definition
71
71
  end
@@ -1,3 +1,3 @@
1
1
  module Artwork
2
- VERSION = '0.7.1'
2
+ VERSION = '0.7.2'
3
3
  end
@@ -207,42 +207,36 @@ module Artwork
207
207
  context 'with an alternative sizes definition' do
208
208
  it 'ignores alternative sizes if current resolution is above all the max resolutions given' do
209
209
  Artwork.current_resolution = 1000
210
- Artwork.actual_resolution = 1000
211
210
 
212
211
  expect_thumb ['320x', {700 => '100x@100'}], :'320x'
213
212
  end
214
213
 
215
214
  it 'picks the first alternative size if current resolution is smaller than all max resolutions' do
216
215
  Artwork.current_resolution = 799
217
- Artwork.actual_resolution = 799
218
216
 
219
217
  expect_thumb ['320x', {1280 => '500x', 800 => '1000x'}], :'1280x'
220
218
  end
221
219
 
222
220
  it 'picks the first alternative size if current resolution is smaller than all max resolutions and supports custom base resolutions' do
223
221
  Artwork.current_resolution = 799
224
- Artwork.actual_resolution = 799
225
222
 
226
223
  expect_thumb ['320x', {1280 => '50x@100', 800 => '100x@100'}], :'1280x'
227
224
  end
228
225
 
229
226
  it 'compares resolutions with <=' do
230
227
  Artwork.current_resolution = 800
231
- Artwork.actual_resolution = 800
232
228
 
233
229
  expect_thumb ['320x', {1280 => '50x@100', 800 => '100x@100'}], :'1280x'
234
230
  end
235
231
 
236
232
  it 'picks the largest alternative size if current resolution is smaller only than the max resolution given' do
237
233
  Artwork.current_resolution = 1200
238
- Artwork.actual_resolution = 1200
239
234
 
240
235
  expect_thumb ['320x', {1280 => '50x@100', 800 => '100x@100'}], :'640x'
241
236
  end
242
237
 
243
238
  it 'ignores non-numeric keys' do
244
239
  Artwork.current_resolution = 1200
245
- Artwork.actual_resolution = 1200
246
240
 
247
241
  expect_thumb ['320x', {1280 => '50x@100', 800 => '100x@100', :foo => 'bar'}], :'640x'
248
242
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: artwork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitar Dimitrov