foobara-sh-cli-connector 1.0.2 → 1.1.1

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: 7d397f7f8734672db7aa0b745d36708f7fff385c381ab0f320370692dc682330
4
- data.tar.gz: 8f14b339ee2c0985e1b59bcaa01aab7f3cbe7192e2d50f16c4d3771e7d9b38c9
3
+ metadata.gz: 58d3fd83b530ea3ba876112fee18c05fc5d84dad4399ca52403c011f21eea6d5
4
+ data.tar.gz: fea12f7c629467c9e41505909a1228a02af76a194793c11f5ec59dc60390769d
5
5
  SHA512:
6
- metadata.gz: 1888fbb583f3a992ccfcd85d7303936853a8b97f3c3610dc89a2bd0dcfc93b5ac50f15232d8670661e1f7e3afe8102d7d79d08f3bcf2e16e58b0b87b4ee334e7
7
- data.tar.gz: eafec27c82c18120ded18bb0c5cdc325c92e7b9f8db383cdadd1efb050a315af0da3c66e8cb3cf1772046ee4e3b29ab32a2fa399becd47759df49c6ad128ba4e
6
+ metadata.gz: dd0afcbcfccf171ee874a17288f9b65899a53afac838c5d702fda8e58bb6063adbf3dae19688836691b814b9ee1c4f4e491df63a9e3546e92ec8692e77f66d28
7
+ data.tar.gz: f0ad7b171126eef0ae5dfa5142ac3c312fbda1c2b859672cc39b4623b7b1567bc2a5c3775efe9e618fe4bc31c6ea5959be0704e5a72f513b766c407e04c36ea9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [1.1.1] - 2025-11-01
2
+
3
+ - Make values shown in help properly quoted for sh, consistently across one_of and default
4
+
5
+ ## [1.1.0] - 2025-08-22
6
+
7
+ - Handle Foobara 0.1.1 type declarations
8
+
1
9
  ## [1.0.2] - 2025-07-31
2
10
 
3
11
  - Fix some deprecation warnings
@@ -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,21 +166,24 @@ 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?
172
- desc << "Default: #{default.inspect}"
178
+ displayable_str = to_bash_str(default)
179
+ desc << "Default: #{displayable_str}"
173
180
  end
174
181
 
175
182
  unless desc.empty?
176
183
  desc.map!.with_index do |d, index|
177
184
  break if index == desc.size - 1
178
185
 
179
- if d =~ /[\.!?\]\}:]$/
186
+ if d =~ /[.!?\]}:]$/
180
187
  d
181
188
  else
182
189
  "#{d}."
@@ -186,6 +193,18 @@ module Foobara
186
193
  desc.join(" ")
187
194
  end
188
195
  end
196
+
197
+ private
198
+
199
+ def to_bash_str(inp_str)
200
+ stripped_str = inp_str.to_s.strip
201
+
202
+ if stripped_str.match?(/\s/)
203
+ stripped_str.inspect
204
+ else
205
+ stripped_str
206
+ end
207
+ end
189
208
  end
190
209
  end
191
210
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-sh-cli-connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-07-31 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: foobara
@@ -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
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  requirements: []
85
- rubygems_version: 3.6.2
85
+ rubygems_version: 3.6.9
86
86
  specification_version: 4
87
87
  summary: Command-line connector for Foobara
88
88
  test_files: []