foobara-sh-cli-connector 0.0.18 → 1.0.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: 321c16a5eb440c4866618f3692059e2214cc4542c423b1f61cb10919b41d20f2
4
- data.tar.gz: 186278107ea0d9d418750d0c22af5ed6498d57fda383f36e5f33796bbe4992d2
3
+ metadata.gz: 4de0d7b7a2a0237898de225ffd38d454860fa333765f295a6dfc8de642e91a80
4
+ data.tar.gz: d405c5651c87122e8a708a3fedbe5b3c2f41cefd02721f53aa01bd41dfd00ebd
5
5
  SHA512:
6
- metadata.gz: c605f79f67c4f8888b2d744eabef55413a07960cd463cf801c8c0649a3b4a441f9f624cf76f12f7130993f3e73a16dff3efbecc756cd29395dcab7169d7e8e53
7
- data.tar.gz: ad83c744c31c7b780dd894558849fdfa6821bbc57c663e83a2b485c1079870761cb9d40b1413423f7bf09e00a35a59eabcad76dfec3ee5a42736e4e739a27adf
6
+ metadata.gz: 00f84896c4374f8e2bd926a5bd200d72382a7cb3646cd180f8d808982738f28a134a5613df9932617e500a30dd0e69c6fb8969a42e67c336f42b4ce92db7e035
7
+ data.tar.gz: a0b23103c6ff897c7f42eb8c594013b37e09762c2fcacbc091025bdccde86183c33e8bbcd3126edb38efb1a7f0af02e2f3330b980ce2cf2678f47c054204df74
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [1.0.1] - 2025-07-17
2
+
3
+ - Handle a strange word-wrapping error with command descriptions
4
+ - Do not output a blank line if the result is nil
5
+
6
+ ## [1.0.0] - 2025-06-17
7
+
8
+ - Do not print out "nil" if the result is nil
9
+
1
10
  ## [0.0.18] - 2025-06-16
2
11
 
3
12
  - Support Time/Date/DateTime in CliResultSerializer
@@ -5,6 +5,8 @@ module Foobara
5
5
  # Should allow either atomic or aggregate
6
6
  class CliResultSerializer < CommandConnectors::Serializers::SuccessSerializer
7
7
  def serialize(object)
8
+ return "" if object.nil?
9
+
8
10
  serializable = atomic_serializer.serialize(object)
9
11
 
10
12
  if serializable.is_a?(::String)
@@ -151,7 +151,23 @@ module Foobara
151
151
  cellified_table = []
152
152
 
153
153
  row_regexes = widths.map do |width|
154
- /\S.{0,#{width}}\S(?=\s|$)|\S+/
154
+ # Matches a non-whitespace character
155
+ # followed by 0 to width characters of any type
156
+ # then a non-whitespace character
157
+ # We assert that we either at a whitespace character or the end of the string (without consuming)
158
+ #
159
+ # or
160
+ #
161
+ # that the entire string has no whitespace characters at all.
162
+ #
163
+ # Basically, we are making sure we are starting on and stopping on
164
+ # a word boundary.
165
+ #
166
+ # Note: Assuming we need to subtract two characters from width here
167
+ # because we consume two characters in the regex with \S.
168
+ # However, it could be that this is instead needed because
169
+ # of padding or something.
170
+ /\S.{0,#{width - 2}}\S(?=\s|$)|\S+/
155
171
  end
156
172
 
157
173
  table.each do |row|
@@ -173,7 +189,9 @@ module Foobara
173
189
  parts_size = parts.size
174
190
 
175
191
  parts.each.with_index do |rows_worth, inner_index|
176
- rows_worth << "-" unless inner_index == parts_size - 1
192
+ unless inner_index == parts_size - 1
193
+ rows_worth << "-"
194
+ end
177
195
  cell << rows_worth
178
196
  end
179
197
  else
@@ -61,7 +61,11 @@ module Foobara
61
61
  status = response.status
62
62
  out = response.status.zero? ? request.stdout : request.stderr
63
63
 
64
- out.puts response.body
64
+ body = response.body
65
+
66
+ unless body.empty?
67
+ out.puts response.body
68
+ end
65
69
 
66
70
  if request.exit
67
71
  exit status
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: 0.0.18
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
@@ -13,16 +13,22 @@ dependencies:
13
13
  name: foobara
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - "~>"
16
+ - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 0.0.88
18
+ version: 0.0.136
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: 2.0.0
19
22
  type: :runtime
20
23
  prerelease: false
21
24
  version_requirements: !ruby/object:Gem::Requirement
22
25
  requirements:
23
- - - "~>"
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: 0.0.136
29
+ - - "<"
24
30
  - !ruby/object:Gem::Version
25
- version: 0.0.88
31
+ version: 2.0.0
26
32
  email:
27
33
  - azimux@gmail.com
28
34
  executables: []