alchemy-json_api 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 369f587874aab63134861d26c9b1babfc0d0ba7d25a981bd2a977bf00d847b48
|
|
4
|
+
data.tar.gz: 3e3e10d5862df03767a538fe785b17d67d88a1e02151fa0a6b67b45370876960
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7f7b3074e7c9e446e22c12f8f8fffe64a2548ede87af8a22515efe53edc9060e2446d8cf9e2bd4511941158920e55e9cce5478b876fe4e9438d2d63d60df8cb6
|
|
7
|
+
data.tar.gz: c68a930b025975095291d0cf53d8f7cbba2a65e309ac4a0d24ef2db5966b4bc157cc35f199c2f69c3c2e8503de20517f19594a6ef3afac12f82eb124373ee170
|
|
@@ -18,7 +18,19 @@ module Alchemy
|
|
|
18
18
|
|
|
19
19
|
with_options if: proc { |essence| essence.picture.present? } do
|
|
20
20
|
attribute :image_dimensions do |essence|
|
|
21
|
-
essence.
|
|
21
|
+
sizes = essence.content.settings[:size]&.split("x", 2)&.map(&:to_i) || [
|
|
22
|
+
essence.image_file_width,
|
|
23
|
+
essence.image_file_height,
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
ratio = essence.image_file_width.to_f / essence.image_file_height
|
|
27
|
+
width = sizes[0].zero? ? sizes[1] * ratio : sizes[0]
|
|
28
|
+
height = sizes[1].zero? ? sizes[0] / ratio : sizes[1]
|
|
29
|
+
|
|
30
|
+
{
|
|
31
|
+
width: width,
|
|
32
|
+
height: height,
|
|
33
|
+
}
|
|
22
34
|
end
|
|
23
35
|
|
|
24
36
|
attribute :image_name do |essence|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: alchemy-json_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.15.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Martin Meyerhoff
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-05-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: alchemy_cms
|
|
@@ -156,7 +156,7 @@ homepage: https://github.com/AlchemyCMS/alchemy-json_api
|
|
|
156
156
|
licenses:
|
|
157
157
|
- MIT
|
|
158
158
|
metadata: {}
|
|
159
|
-
post_install_message:
|
|
159
|
+
post_install_message:
|
|
160
160
|
rdoc_options: []
|
|
161
161
|
require_paths:
|
|
162
162
|
- lib
|
|
@@ -171,8 +171,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
171
171
|
- !ruby/object:Gem::Version
|
|
172
172
|
version: '0'
|
|
173
173
|
requirements: []
|
|
174
|
-
rubygems_version: 3.1.
|
|
175
|
-
signing_key:
|
|
174
|
+
rubygems_version: 3.1.4
|
|
175
|
+
signing_key:
|
|
176
176
|
specification_version: 4
|
|
177
177
|
summary: A JSONAPI compliant API for AlchemyCMS
|
|
178
178
|
test_files: []
|