foobara-sh-cli-connector 0.0.12 → 0.0.13
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baee3b1690dc7108efe1763f106088b5c60ec44bee67f9e5e973af806dc23dcb
|
4
|
+
data.tar.gz: ff4692056eed0949ef1c4f1b0ece541e3c5805ed9afd1fb282feb35727c48780
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c45bc3cb9f0d47d3ec1dce2cc6fb7ce34712905f9f2c8895d03c56ba5e3bc1a285bc5f325740d17c5d7f6403e17892836b71829f0d065e1c4e0d124823e5c97d
|
7
|
+
data.tar.gz: 7de22a9ff9f3f780b08eb8cb4587204232d7d5e8bd00ccedfead314d737401acd31a51c26a13bc68ad518ec336003e1332aabf2ff40040b336ed70b897fb555a
|
data/CHANGELOG.md
CHANGED
@@ -11,6 +11,8 @@ module Foobara
|
|
11
11
|
|
12
12
|
def validate!
|
13
13
|
unless remainder.empty?
|
14
|
+
# TODO: let's invert the order for single command mode: parse inputs first, then global from remainder,
|
15
|
+
# and then raise if there's anything left
|
14
16
|
raise ParseError, "Unexpected argument: #{remainder.first}"
|
15
17
|
end
|
16
18
|
end
|
@@ -172,8 +172,8 @@ module Foobara
|
|
172
172
|
|
173
173
|
parts_size = parts.size
|
174
174
|
|
175
|
-
parts.each.with_index do |rows_worth,
|
176
|
-
rows_worth << "-" unless
|
175
|
+
parts.each.with_index do |rows_worth, inner_index|
|
176
|
+
rows_worth << "-" unless inner_index == parts_size - 1
|
177
177
|
cell << rows_worth
|
178
178
|
end
|
179
179
|
else
|
data/src/sh_cli_connector.rb
CHANGED
@@ -65,48 +65,54 @@ module Foobara
|
|
65
65
|
nil
|
66
66
|
end
|
67
67
|
|
68
|
-
def
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
68
|
+
def set_response_status(response)
|
69
|
+
request = response.request
|
70
|
+
|
71
|
+
response.status = if request.error
|
72
|
+
6
|
73
|
+
elsif request.success?
|
74
|
+
0
|
75
|
+
else
|
76
|
+
errors = request.error_collection.error_array
|
77
|
+
error = errors.first
|
78
|
+
|
79
|
+
case error
|
80
|
+
when CommandConnector::NotFoundError, Foobara::Entity::NotFoundError
|
81
|
+
# TODO: we should not be coupled to Entities here...
|
82
|
+
# :nocov:
|
83
|
+
2
|
84
|
+
# :nocov:
|
85
|
+
when CommandConnector::UnauthenticatedError
|
86
|
+
# :nocov:
|
87
|
+
3
|
88
|
+
# :nocov:
|
89
|
+
when CommandConnector::NotAllowedError
|
90
|
+
# :nocov:
|
91
|
+
4
|
92
|
+
# :nocov:
|
93
|
+
when CommandConnector::UnknownError
|
94
|
+
# :nocov:
|
95
|
+
5
|
96
|
+
# :nocov:
|
97
|
+
end || 1
|
98
|
+
end
|
99
|
+
end
|
79
100
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
# :nocov:
|
96
|
-
3
|
97
|
-
# :nocov:
|
98
|
-
when CommandConnector::NotAllowedError
|
99
|
-
# :nocov:
|
100
|
-
4
|
101
|
-
# :nocov:
|
102
|
-
when CommandConnector::UnknownError
|
103
|
-
# :nocov:
|
104
|
-
5
|
105
|
-
# :nocov:
|
106
|
-
end || 1
|
107
|
-
end
|
108
|
-
|
109
|
-
Response.new(status:, body:, request:)
|
101
|
+
def set_response_body(response)
|
102
|
+
request = response.request
|
103
|
+
|
104
|
+
response.body = if request.error
|
105
|
+
case request.error
|
106
|
+
when ParseError, CommandConnector::NotFoundError
|
107
|
+
request.error.message
|
108
|
+
else
|
109
|
+
# :nocov:
|
110
|
+
raise "Not sure how to handle error: #{request.error}"
|
111
|
+
# :nocov:
|
112
|
+
end
|
113
|
+
else
|
114
|
+
request.response_body
|
115
|
+
end
|
110
116
|
end
|
111
117
|
end
|
112
118
|
end
|
metadata
CHANGED
@@ -1,28 +1,28 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foobara-sh-cli-connector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Georgi
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-03-
|
10
|
+
date: 2025-03-28 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: foobara
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
|
-
- - "
|
16
|
+
- - "~>"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version:
|
18
|
+
version: 0.0.88
|
19
19
|
type: :runtime
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
|
-
- - "
|
23
|
+
- - "~>"
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version:
|
25
|
+
version: 0.0.88
|
26
26
|
email:
|
27
27
|
- azimux@gmail.com
|
28
28
|
executables: []
|
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
78
|
requirements: []
|
79
|
-
rubygems_version: 3.6.
|
79
|
+
rubygems_version: 3.6.6
|
80
80
|
specification_version: 4
|
81
81
|
summary: Command-line connector for Foobara
|
82
82
|
test_files: []
|