artwork 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/artwork/model.rb +1 -1
- data/lib/artwork/version.rb +1 -1
- data/spec/artwork/model_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b0d7d992466ff46722a06047434dbf8a45f725a
|
4
|
+
data.tar.gz: 12762bbc853844aee095a497472cac66ee9fea3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7508e3ed8cb033ce3c481c92d04023ec5c8f6aa21291bd95bf6e48149249b895180dc0c7432520319214a12d133130220eed5ea45b356683e4b93379bfac6e3f
|
7
|
+
data.tar.gz: bd84075a0ce6eb000f3bd41377ce81db17304d89db3d69f6c1442a78f889a5b034217eed78278fe7c3d8a98436ac00ca80a90680ca4079e21435c22f51d59572
|
data/README.md
CHANGED
@@ -107,8 +107,8 @@ The following criteria are taken into account for picking up the appropriate
|
|
107
107
|
thumb name:
|
108
108
|
|
109
109
|
- The `default_resolution` specified in the Artwork configuration file.
|
110
|
-
- The current resolition, approximated to the nearest
|
111
|
-
|
110
|
+
- The current resolition, approximated to the nearest supported resolution
|
111
|
+
which is larger than the current user's one.
|
112
112
|
- Whether or not the screen is retina.
|
113
113
|
- The width of the requested thumb size (e.g. `400` for `400x300_crop`).
|
114
114
|
- The label of the requested thumb (e.g. `crop` for `400x300_crop`); the label
|
@@ -121,13 +121,13 @@ thumb name:
|
|
121
121
|
|
122
122
|
For a thumb to be returned as matching, all of the following must be true:
|
123
123
|
|
124
|
-
- It must
|
124
|
+
- It must be the smallest thumb which is still larger than the requested width,
|
125
125
|
scaled for the current resolution.
|
126
126
|
- If the requested thumb has a label (including a blank one, like in `400x_`),
|
127
127
|
the thumb must match the requested label.
|
128
128
|
- If the requested thumb specifies an aspect ratio, the matching thumb must
|
129
|
-
have the same aspect ratio,
|
130
|
-
|
129
|
+
have the same aspect ratio, within a delta of 0.1. If no aspect ratio is
|
130
|
+
specified in the request, aspect ratio checks will not be performed.
|
131
131
|
- If the current device is a retina device, a retina thumb will be preferred.
|
132
132
|
If no retuna thumb exists, a non-retina one will be selected.
|
133
133
|
|
data/lib/artwork/model.rb
CHANGED
@@ -41,7 +41,7 @@ module Artwork
|
|
41
41
|
matching_thumb_name.to_sym
|
42
42
|
end
|
43
43
|
|
44
|
-
def artwork_url(attachment_name, size, options =
|
44
|
+
def artwork_url(attachment_name, size, options = {})
|
45
45
|
thumb_name = artwork_thumb_for(attachment_name, size)
|
46
46
|
send(attachment_name).url(thumb_name, options)
|
47
47
|
end
|
data/lib/artwork/version.rb
CHANGED
data/spec/artwork/model_spec.rb
CHANGED
@@ -82,7 +82,7 @@ module Artwork
|
|
82
82
|
expect(instance).to receive(:artwork_thumb_for).with(:photo, :size).and_return(:computed_size)
|
83
83
|
|
84
84
|
attachment = double
|
85
|
-
expect(attachment).to receive(:url).with(:computed_size,
|
85
|
+
expect(attachment).to receive(:url).with(:computed_size, {}).and_return 'some/url'
|
86
86
|
expect(instance).to receive(:photo).and_return(attachment)
|
87
87
|
|
88
88
|
expect(instance.artwork_url(:photo, :size)).to eq 'some/url'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: artwork
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitar Dimitrov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|