peach-ruby 0.3.0 → 0.4.0

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: 8a7f27b5b01c8b9ea55f876a6250f0c88eb475f5b420357a286a89cf8fa9482e
4
- data.tar.gz: 59347383246e9ba8820d31fc97eed2f1a41c58fda460c540e00ea91d9a2fd5b6
3
+ metadata.gz: 22044ce025121dc6f98a9b9847815caff80ef0f16089368616b048f02e145d37
4
+ data.tar.gz: ead484f3c4c9427e918fe819d5d128f0c900104b8dbfa1d6a12f03942b68715e
5
5
  SHA512:
6
- metadata.gz: 7f82051293a16fdd61f4bc0b8d034e92eaed01f44fb0aa7dcaabc36db8f17b8e8af0c7c55092efe08fe24db6e1c3d9a3ed1ee9d85da7bdce31afdafcc5c0cbb5
7
- data.tar.gz: b416cdc3ae802d1466a612e41f806407fe89597c3c113ca46b558e151abed10fce3eaaee7edf0f225cea8d59eef91b85a02722997f8fd3335b33f0b749f41b9a
6
+ metadata.gz: f2a7f243046a6c61cf7ef62f5ebe3d321f2b0491a3460620f3940592e99593624388e46b5513ff6297777085554030e9cedcdf61ec9720c655291fea2a07ab80
7
+ data.tar.gz: 5ba357f84e83d4d638fe3cadea472a08275b2b6d1eda30fc4b133a76dfa3edc181cfb3fb1995912c40891a3a37764650d165464ba71dc141d0e4fb7cbfa3ac08
@@ -95,8 +95,8 @@ module Peach
95
95
  def validate_prompt(prompt)
96
96
  validate_key(prompt)
97
97
  validate_data(prompt)
98
- validate_button(prompt) if prompt.key?(:button)
99
- validate_options(prompt) if prompt.key?(:options)
98
+ validate_button(prompt)
99
+ validate_options(prompt)
100
100
  end
101
101
 
102
102
  def validate_key(prompt)
@@ -110,11 +110,15 @@ module Peach
110
110
  end
111
111
 
112
112
  def validate_button(prompt)
113
+ return unless prompt.key?(:button)
114
+
113
115
  raise Peach::BadResponseError, 'Field `prompt.button` is not a String' unless prompt[:button].is_a?(String)
114
116
  raise Peach::BadResponseError, 'Field `prompt.button` is empty' if prompt[:button].empty?
115
117
  end
116
118
 
117
119
  def validate_options(prompt)
120
+ return unless prompt.key?(:options)
121
+
118
122
  raise Peach::BadResponseError, 'Field `prompt.options` is not an Array' unless prompt[:options].is_a?(Array)
119
123
 
120
124
  validate_each_option(prompt)
@@ -123,7 +127,7 @@ module Peach
123
127
  def validate_each_option(prompt)
124
128
  prompt[:options].each_with_index do |option, idx|
125
129
  validate_option_is_hash(option, idx)
126
- validate_option_title(option, idx)
130
+ # validate_option_title(option, idx)
127
131
  validate_option_value_or_values(prompt, option, idx)
128
132
  end
129
133
  end
@@ -144,7 +148,7 @@ module Peach
144
148
  if prompt.key?(:button)
145
149
  validate_option_values(option, idx)
146
150
  else
147
- validate_option_value(option, idx)
151
+ # validate_option_value(option, idx)
148
152
  end
149
153
  end
150
154
 
@@ -160,7 +164,7 @@ module Peach
160
164
  end
161
165
 
162
166
  validate_values_are_array(option, idx)
163
- validate_each_value(option, idx)
167
+ # validate_each_value(option, idx)
164
168
  end
165
169
 
166
170
  def validate_values_are_array(option, idx)
data/lib/peach/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Peach
4
- VERSION = '0.3.0'
4
+ VERSION = '0.4.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peach-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peach Developers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-08 00:00:00.000000000 Z
11
+ date: 2024-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug