foobara 0.6.4 → 0.6.5
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 +5 -0
- data/projects/command/src/command_pattern_implementation/concerns/result.rb +10 -2
- data/projects/typesystem/projects/common/src/outcome.rb +4 -2
- data/projects/typesystem/projects/type_declarations/src/dsl/attributes.rb +11 -0
- data/projects/typesystem/projects/types/src/type.rb +11 -6
- data/version.rb +1 -1
- 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: 8f7628f3975299e2c2d578d47b6ea01cf00d10d0c64566b01d307ae44d400cd6
|
|
4
|
+
data.tar.gz: 7e1964b48bea37ba9206c85d171c0c52985e9499131a3e96bcf661559730b4da
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8061eb55fbc5879d63532708009f9591f4c5c9766a6a282612b51fa8c48a80e537ad5f4e488150f57434cf50a621d4a0c687efcc0963508808470e00c5c0b76b
|
|
7
|
+
data.tar.gz: f593b3dcc25323a6253c928ed4d4735386e65c0cebf4e4ef6d219d8ac8dccfa253b1223aa85d227c66ffdf2c409a39d0ea8632ac90cc489ff8b529b9f41f8913
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
# [0.6.5] - 2026-10-04
|
|
2
|
+
|
|
3
|
+
- Fix a problem where some nested sugary types don't expand correctly when using attributes dsl
|
|
4
|
+
- Add command name to error message when a result can't be cast to the result type
|
|
5
|
+
|
|
1
6
|
# [0.6.4] - 2026-09-11
|
|
2
7
|
|
|
3
8
|
- Track which models instances ignore unsupported attributes to prevent various issues, including breaking domain mappers
|
|
@@ -4,7 +4,15 @@ module Foobara
|
|
|
4
4
|
module Result
|
|
5
5
|
include Concern
|
|
6
6
|
|
|
7
|
-
class CouldNotProcessResult < Outcome::UnsuccessfulOutcomeError;
|
|
7
|
+
class CouldNotProcessResult < Outcome::UnsuccessfulOutcomeError;
|
|
8
|
+
attr_accessor :command
|
|
9
|
+
|
|
10
|
+
def initialize(command, errors)
|
|
11
|
+
self.command = command
|
|
12
|
+
|
|
13
|
+
super(errors, prefix: command.class.full_command_name)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
8
16
|
|
|
9
17
|
private
|
|
10
18
|
|
|
@@ -16,7 +24,7 @@ module Foobara
|
|
|
16
24
|
if outcome.success?
|
|
17
25
|
outcome.result
|
|
18
26
|
else
|
|
19
|
-
raise CouldNotProcessResult, outcome.errors
|
|
27
|
+
raise CouldNotProcessResult.new(self, outcome.errors)
|
|
20
28
|
end
|
|
21
29
|
end
|
|
22
30
|
end
|
|
@@ -3,10 +3,12 @@ module Foobara
|
|
|
3
3
|
class UnsuccessfulOutcomeError < StandardError
|
|
4
4
|
attr_accessor :errors, :backtrace_when_raised
|
|
5
5
|
|
|
6
|
-
def initialize(errors)
|
|
6
|
+
def initialize(errors, message: errors.map(&:message).join(", "), prefix: nil)
|
|
7
7
|
self.errors = errors
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
if prefix
|
|
10
|
+
message = "#{prefix}: #{message}"
|
|
11
|
+
end
|
|
10
12
|
|
|
11
13
|
super(message)
|
|
12
14
|
end
|
|
@@ -83,6 +83,17 @@ module Foobara
|
|
|
83
83
|
end
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
+
if type && !type.is_a?(::Symbol)
|
|
87
|
+
type = Domain.current.foobara_type_from_declaration(type)
|
|
88
|
+
|
|
89
|
+
type = if type.registered?
|
|
90
|
+
type.reference_symbol
|
|
91
|
+
else
|
|
92
|
+
declaration = type.declaration_data.merge(declaration)
|
|
93
|
+
declaration[:type]
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
86
97
|
processor_symbols.each do |processor_symbol|
|
|
87
98
|
case processor_symbol
|
|
88
99
|
when ::String
|
|
@@ -428,12 +428,7 @@ module Foobara
|
|
|
428
428
|
remove_sensitive = TypeDeclarations.foobara_manifest_context_remove_sensitive?
|
|
429
429
|
|
|
430
430
|
if registered?
|
|
431
|
-
|
|
432
|
-
if scoped_unregistered?
|
|
433
|
-
unregistered_foobara_manifest_reference.to_sym
|
|
434
|
-
else
|
|
435
|
-
foobara_manifest_reference.to_sym
|
|
436
|
-
end
|
|
431
|
+
reference_symbol
|
|
437
432
|
elsif remove_sensitive
|
|
438
433
|
TypeDeclarations.remove_sensitive_types(declaration_data)
|
|
439
434
|
else
|
|
@@ -441,6 +436,16 @@ module Foobara
|
|
|
441
436
|
end
|
|
442
437
|
end
|
|
443
438
|
|
|
439
|
+
def reference_symbol
|
|
440
|
+
raise "Not registered so no reference symbol" unless registered?
|
|
441
|
+
|
|
442
|
+
if scoped_unregistered?
|
|
443
|
+
unregistered_foobara_manifest_reference.to_sym
|
|
444
|
+
else
|
|
445
|
+
foobara_manifest_reference.to_sym
|
|
446
|
+
end
|
|
447
|
+
end
|
|
448
|
+
|
|
444
449
|
def declaration_data_for_manifest
|
|
445
450
|
data = declaration_data
|
|
446
451
|
|
data/version.rb
CHANGED