app_rail-steps 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/app_rail/steps/core/stack.rb +18 -8
- data/lib/app_rail/steps/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ac3df232c2bfd0cd864c8ab1491b6d1191906fa1e0397fc91b184342150c7d6
|
4
|
+
data.tar.gz: c0152ca0568590771013c85efa8d625240ca417b68c6bde0214e8e6a05fbe5f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2389db830f322a8beb9367eee628ebcc5b2b69594c743ed846e9ad592e2731c953e0bd9c9f723ca906c1faa4de8065d57f69b0cdf86f7f588165e5e5fad20328
|
7
|
+
data.tar.gz: e45e8cf553d0ab2e31d95ad9e022fdb2ab7336f117b79a47cb9dc44b5ad744de69956d4d05f9c0e17a75842b472fba8873c4d9b4004df0b23eba4a6aad1d5eaa
|
data/Gemfile.lock
CHANGED
@@ -5,16 +5,23 @@ module AppRail
|
|
5
5
|
module Core
|
6
6
|
module Stack
|
7
7
|
CONTENT_MODE_OPTIONS = %i[scale_aspect_fill scale_aspect_fit].freeze
|
8
|
+
IMAGE_STYLE_OPTIONS = %i[full_width profile].freeze
|
8
9
|
|
9
10
|
def ar_core_stack_text(text:, label: nil)
|
10
11
|
{ type: :text, label: label, text: text.to_s }.compact
|
11
12
|
end
|
12
13
|
|
13
|
-
def ar_core_stack_image(preview_url:, attachment_url:, content_mode: :scale_aspect_fill)
|
14
|
+
def ar_core_stack_image(preview_url:, attachment_url:, image_style: :full_width, content_mode: :scale_aspect_fill)
|
14
15
|
validate_content_mode!(content_mode)
|
15
|
-
|
16
|
-
|
17
|
-
|
16
|
+
validate_image_style!(image_style)
|
17
|
+
|
18
|
+
{
|
19
|
+
type: :image,
|
20
|
+
contentMode: camelcase_converter(content_mode.to_s, first_letter: :lower),
|
21
|
+
previewURL: preview_url,
|
22
|
+
url: attachment_url,
|
23
|
+
imageStyle: camelcase_converter(image_style.to_s, first_letter: :lower)
|
24
|
+
}
|
18
25
|
end
|
19
26
|
|
20
27
|
def ar_core_stack_unsplash_image(image_url)
|
@@ -22,8 +29,7 @@ module AppRail
|
|
22
29
|
unsplash_id = image_url.split("/").last
|
23
30
|
image_url = "https://source.unsplash.com/#{unsplash_id}/800x600"
|
24
31
|
end
|
25
|
-
|
26
|
-
{ type: :image, previewURL: image_url, url: image_url }.compact
|
32
|
+
ar_core_stack_image(preview_url: image_url, attachment_url: image_url)
|
27
33
|
end
|
28
34
|
|
29
35
|
def ar_core_stack_video(preview_url:, attachment_url:)
|
@@ -84,8 +90,12 @@ module AppRail
|
|
84
90
|
|
85
91
|
private
|
86
92
|
|
87
|
-
def validate_content_mode!(
|
88
|
-
raise "Unknown content_mode" unless CONTENT_MODE_OPTIONS.include?(
|
93
|
+
def validate_content_mode!(content_mode)
|
94
|
+
raise "Unknown content_mode" unless CONTENT_MODE_OPTIONS.include?(content_mode)
|
95
|
+
end
|
96
|
+
|
97
|
+
def validate_image_style!(image_style)
|
98
|
+
raise "Unknown image_style" unless IMAGE_STYLE_OPTIONS.include?(image_style)
|
89
99
|
end
|
90
100
|
end
|
91
101
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: app_rail-steps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Brooke-Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|