foobara-sh-cli-connector 1.0.0 → 1.0.2

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: 7bc1365a85e052ca92e274b311de4869c81f1b8a6de2c6576a5b1c17d61045aa
4
- data.tar.gz: 4da7ba126591ea5b5d82f57c80d22bfc60a6bee3ba3abc835fb670cb4899b45c
3
+ metadata.gz: 7d397f7f8734672db7aa0b745d36708f7fff385c381ab0f320370692dc682330
4
+ data.tar.gz: 8f14b339ee2c0985e1b59bcaa01aab7f3cbe7192e2d50f16c4d3771e7d9b38c9
5
5
  SHA512:
6
- metadata.gz: 23d25d6b4ea75e70dc71825ebcdc4bb106260761947d4c1cc591363874c58637558d6fc4fa11a39732e53593058df110efa993edd5f163e946160c7e068aab6c
7
- data.tar.gz: 6e56d3c1b53ec4892e28e04846bd24ea4cee8e283350d3676c00da40d51cbe90901bb3b7c86352a2dd7315795272e582c317250023b0eaca20f4c4432c689af1
6
+ metadata.gz: 1888fbb583f3a992ccfcd85d7303936853a8b97f3c3610dc89a2bd0dcfc93b5ac50f15232d8670661e1f7e3afe8102d7d79d08f3bcf2e16e58b0b87b4ee334e7
7
+ data.tar.gz: eafec27c82c18120ded18bb0c5cdc325c92e7b9f8db383cdadd1efb050a315af0da3c66e8cb3cf1772046ee4e3b29ab32a2fa399becd47759df49c6ad128ba4e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [1.0.2] - 2025-07-31
2
+
3
+ - Fix some deprecation warnings
4
+
5
+ ## [1.0.1] - 2025-07-17
6
+
7
+ - Handle a strange word-wrapping error with command descriptions
8
+ - Do not output a blank line if the result is nil
9
+
1
10
  ## [1.0.0] - 2025-06-17
2
11
 
3
12
  - Do not print out "nil" if the result is nil
@@ -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
@@ -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
@@ -99,7 +103,7 @@ module Foobara
99
103
  elsif request.success?
100
104
  0
101
105
  else
102
- errors = request.error_collection.error_array
106
+ errors = request.error_collection
103
107
  error = errors.first
104
108
 
105
109
  case error
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.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
10
+ date: 2025-07-31 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: foobara
@@ -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.9
85
+ rubygems_version: 3.6.2
86
86
  specification_version: 4
87
87
  summary: Command-line connector for Foobara
88
88
  test_files: []