foobara 0.0.107 → 0.0.109
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/projects/command/src/transformed_command.rb +2 -1
- data/projects/command_connectors/src/authenticator.rb +4 -4
- data/projects/command_connectors/src/command_connector/not_found_error.rb +19 -1
- data/projects/command_connectors/src/command_connector.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee346090e6fcaa8a036f4edd3df0eda6ca76b55d600906b86226aa8c4a13862d
|
4
|
+
data.tar.gz: 403fd19ededf68298e03087abeb747a23e7015d4f45981bf0afefab64a5bd204
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70dba1fa9bbed33a1cee53a7b64c1d36b417b1a148f678a1a52878b9677b550f7bd0d47f644c4df4bb7c08591bc0d288ad13423c9af88a61e613f9ca82dd216e
|
7
|
+
data.tar.gz: 8aeb22a52568439b29b0ba823a7add6b18301b0bd08f2532ca5829c36364634c5d7145894d694c7dab8af1b63229a1c3bc7ffcc06881e52b28b4ea6c51ef0b2c
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# [0.0.109] - 2025-04-22
|
2
|
+
|
3
|
+
- Support CommandConnector transformers that don't take declaration_data
|
4
|
+
|
5
|
+
# [0.0.108] - 2025-04-22
|
6
|
+
|
7
|
+
- Fix bug in CommandConnector::NotFoundError constructor
|
8
|
+
|
1
9
|
# [0.0.107] - 2025-04-22
|
2
10
|
|
3
11
|
- Make sure various Foobara::Error subclasses have consistent interfaces
|
@@ -424,7 +424,8 @@ module Foobara
|
|
424
424
|
target_type = new_type if new_type
|
425
425
|
end
|
426
426
|
else
|
427
|
-
|
427
|
+
# TODO: perhaps pass in the command connector as the parent declaration data?
|
428
|
+
transformer.new_with_agnostic_args(declaration_data:)
|
428
429
|
end
|
429
430
|
elsif transformer.is_a?(Value::Processor)
|
430
431
|
transformer
|
@@ -1,14 +1,14 @@
|
|
1
1
|
module Foobara
|
2
2
|
class CommandConnector
|
3
3
|
class Authenticator
|
4
|
-
|
4
|
+
attr_reader :block, :explanation, :symbol
|
5
5
|
|
6
6
|
def initialize(symbol: nil, explanation: nil, &block)
|
7
7
|
symbol ||= Util.non_full_name_underscore(self.class).to_sym
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
@symbol = symbol
|
10
|
+
@block = block
|
11
|
+
@explanation = explanation || symbol
|
12
12
|
end
|
13
13
|
|
14
14
|
def to_proc
|
@@ -3,9 +3,27 @@ require_relative "command_connector_error"
|
|
3
3
|
module Foobara
|
4
4
|
class CommandConnector
|
5
5
|
class NotFoundError < CommandConnectorError
|
6
|
+
class << self
|
7
|
+
def for(not_found)
|
8
|
+
if not_found
|
9
|
+
new(context: { not_found: }, message: "Not found: #{not_found}")
|
10
|
+
else
|
11
|
+
new
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
6
16
|
context not_found: :string
|
7
17
|
|
8
|
-
def initialize(message:
|
18
|
+
def initialize(message: nil, context: nil, **)
|
19
|
+
if context
|
20
|
+
not_found = context[:not_found]
|
21
|
+
message ||= "Not found: #{not_found}"
|
22
|
+
else
|
23
|
+
context = {}
|
24
|
+
message ||= "Not found"
|
25
|
+
end
|
26
|
+
|
9
27
|
super
|
10
28
|
end
|
11
29
|
end
|