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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d0a2c468bb3b453ff93e93ac803fe9324bf980cc163bd8414671da9a13555b2
4
- data.tar.gz: 92466c77d31fc18967683165cfed515f4dafcb5fe223fd1b12e13978b1bb89ff
3
+ metadata.gz: 7ac3df232c2bfd0cd864c8ab1491b6d1191906fa1e0397fc91b184342150c7d6
4
+ data.tar.gz: c0152ca0568590771013c85efa8d625240ca417b68c6bde0214e8e6a05fbe5f8
5
5
  SHA512:
6
- metadata.gz: e5dc6f5f0cd3dde62e3f75bced4e6f89898979f7e866ded7480393bf38e09eaebe618c6ab4012b49c205b5b8e1abd8f371cb3bd5320a0b4281727974cb532b69
7
- data.tar.gz: cc025b7a0775e2c4eeedeb46242f243a24146129a08e6d0edf65712037859983a35b0253301b85418742e8edf42ced5df45b6da712e897f4fa8d48a8a52e98a3
6
+ metadata.gz: 2389db830f322a8beb9367eee628ebcc5b2b69594c743ed846e9ad592e2731c953e0bd9c9f723ca906c1faa4de8065d57f69b0cdf86f7f588165e5e5fad20328
7
+ data.tar.gz: e45e8cf553d0ab2e31d95ad9e022fdb2ab7336f117b79a47cb9dc44b5ad744de69956d4d05f9c0e17a75842b472fba8873c4d9b4004df0b23eba4a6aad1d5eaa
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- app_rail-steps (0.2.8)
4
+ app_rail-steps (0.2.9)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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
- { type: :image, contentMode: camelcase_converter(content_mode.to_s, first_letter: :lower),
17
- previewURL: preview_url, url: attachment_url }
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!(on_success)
88
- raise "Unknown content_mode" unless CONTENT_MODE_OPTIONS.include?(on_success)
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AppRail
4
4
  module Steps
5
- VERSION = "0.2.8"
5
+ VERSION = "0.2.9"
6
6
  end
7
7
  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.8
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-22 00:00:00.000000000 Z
11
+ date: 2022-04-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: