foobara-sh-cli-connector 1.0.1 → 1.1.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: 4de0d7b7a2a0237898de225ffd38d454860fa333765f295a6dfc8de642e91a80
4
- data.tar.gz: d405c5651c87122e8a708a3fedbe5b3c2f41cefd02721f53aa01bd41dfd00ebd
3
+ metadata.gz: 59cf7a21e3cefb21edff2aeff1190ae80b8ced00ea06ae8f283efeb9edf4fb5d
4
+ data.tar.gz: 3f633ba9a19437fd36b8d5afb11bbe373a222f4e35014b65fe9eeea9a2786e4e
5
5
  SHA512:
6
- metadata.gz: 00f84896c4374f8e2bd926a5bd200d72382a7cb3646cd180f8d808982738f28a134a5613df9932617e500a30dd0e69c6fb8969a42e67c336f42b4ce92db7e035
7
- data.tar.gz: a0b23103c6ff897c7f42eb8c594013b37e09762c2fcacbc091025bdccde86183c33e8bbcd3126edb38efb1a7f0af02e2f3330b980ce2cf2678f47c054204df74
6
+ metadata.gz: 74f188499346a95da97cc18f1ae280ef0f1d2be8444761dc1de08905df15bd40908bec43daed15b95d69f163fa7a7c3bd15c60dd1663ecbacaf49d19744c6455
7
+ data.tar.gz: 3a31ffab1eb40dbf87e767ad84cee1c01e667b124112db3bcd7cf94d12d30f981f843ceae2477d271778e0a70355ce3915debf92c6933d7485445a9a84ea230d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [1.1.0] - 2025-08-22
2
+
3
+ - Handle Foobara 0.1.1 type declarations
4
+
5
+ ## [1.0.2] - 2025-07-31
6
+
7
+ - Fix some deprecation warnings
8
+
1
9
  ## [1.0.1] - 2025-07-17
2
10
 
3
11
  - Handle a strange word-wrapping error with command descriptions
@@ -18,7 +18,7 @@ module Foobara
18
18
  always_prefix_inputs:
19
19
  )
20
20
  sub_required_attributes = if is_required
21
- attribute_type.declaration_data[:required] || []
21
+ attribute_type.declaration_data[:required]
22
22
  end || []
23
23
 
24
24
  defaults = attribute_type.declaration_data[:defaults] || {}
@@ -150,6 +150,10 @@ module Foobara
150
150
  !default.nil?
151
151
  end
152
152
 
153
+ def primitive?
154
+ attribute_type.primitive?
155
+ end
156
+
153
157
  def description
154
158
  desc = []
155
159
  attributes_description = attribute_type.description
@@ -162,10 +166,12 @@ module Foobara
162
166
  desc << "Required"
163
167
  end
164
168
 
165
- one_of = attribute_type.declaration_data[:one_of]
169
+ unless primitive?
170
+ one_of = attribute_type.declaration_data[:one_of]
166
171
 
167
- if one_of && !one_of.empty?
168
- desc << "One of: #{one_of.join(", ")}"
172
+ if one_of && !one_of.empty?
173
+ desc << "One of: #{one_of.join(", ")}"
174
+ end
169
175
  end
170
176
 
171
177
  if has_default?
@@ -176,7 +182,7 @@ module Foobara
176
182
  desc.map!.with_index do |d, index|
177
183
  break if index == desc.size - 1
178
184
 
179
- if d =~ /[\.!?\]\}:]$/
185
+ if d =~ /[.!?\]}:]$/
180
186
  d
181
187
  else
182
188
  "#{d}."
@@ -5,7 +5,7 @@ module Foobara
5
5
  # TODO: move this to its own project
6
6
  class CliErrorsSerializer < CommandConnectors::Serializers::ErrorsSerializer
7
7
  def serialize(error_collection)
8
- Util.to_sentence(error_collection.error_array.map(&:message))
8
+ Util.to_sentence(error_collection.map(&:message))
9
9
  end
10
10
 
11
11
  def priority
@@ -103,7 +103,7 @@ module Foobara
103
103
  elsif request.success?
104
104
  0
105
105
  else
106
- errors = request.error_collection.error_array
106
+ errors = request.error_collection
107
107
  error = errors.first
108
108
 
109
109
  case error
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-sh-cli-connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
@@ -15,7 +15,7 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 0.0.136
18
+ version: 0.1.1
19
19
  - - "<"
20
20
  - !ruby/object:Gem::Version
21
21
  version: 2.0.0
@@ -25,7 +25,7 @@ dependencies:
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: 0.0.136
28
+ version: 0.1.1
29
29
  - - "<"
30
30
  - !ruby/object:Gem::Version
31
31
  version: 2.0.0