foobara 0.0.122 → 0.0.124
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_connectors/src/command_registry.rb +1 -1
- data/projects/type_declarations/src/handlers/registered_type_declaration/symbol_desugarizer.rb +6 -2
- data/projects/type_declarations/src/type_builder.rb +8 -0
- data/projects/type_declarations/src/type_declarations.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fcb411acfca3b92a2e62c37e03307ae4928eb6d0ec3403669eaccfede0a5bdc
|
4
|
+
data.tar.gz: 3bcb94c31ceb931ec20307afea22e73b9cea58124f6e6ebc1547ac55ce54224d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43d30d0278cb5bbc66b88ff429af8dfb4cda0294f3657d60146aa7ddd5fdaf461124f4dca90710e1880327026f4b519c127ffaa4fe0f68cdb1b8804225713e2b
|
7
|
+
data.tar.gz: 5b02922fcb530fea310c83d566ffcb89fab58dc003a8985c9ca67ea48ca9c3ffb9839964ffbef77f99b2c29e8b23e2db6a16cec8feacd514044d44d7ed274b23
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# [0.0.124] - 2025-05-14
|
2
|
+
|
3
|
+
- Fix bug creating multiple exposed domains instead of just one
|
4
|
+
|
5
|
+
# [0.0.123] - 2025-05-14
|
6
|
+
|
7
|
+
- Allow type name strings as type declarations as a fallback instead of only symbols
|
8
|
+
|
1
9
|
# [0.0.122] - 2025-05-13
|
2
10
|
|
3
11
|
- Add command connector sugar features and implement several command connector sugars
|
@@ -98,7 +98,7 @@ module Foobara
|
|
98
98
|
domain_module.foobara_depends_on.each do |domain_name|
|
99
99
|
# TODO: test this code path!!
|
100
100
|
# :nocov:
|
101
|
-
unless
|
101
|
+
unless foobara_domain_registered?(domain_name)
|
102
102
|
build_and_register_exposed_domain(domain_name)
|
103
103
|
end
|
104
104
|
# :nocov:
|
data/projects/type_declarations/src/handlers/registered_type_declaration/symbol_desugarizer.rb
CHANGED
@@ -7,13 +7,17 @@ module Foobara
|
|
7
7
|
# TODO: make a quick way to convert a couple simple procs into a transformer
|
8
8
|
class SymbolDesugarizer < TypeDeclarations::Desugarizer
|
9
9
|
def applicable?(sugary_type_declaration)
|
10
|
-
sugary_type_declaration.is_a?(Symbol)
|
10
|
+
if sugary_type_declaration.is_a?(::Symbol)
|
11
|
+
type_registered?(sugary_type_declaration)
|
12
|
+
elsif sugary_type_declaration.is_a?(::String) && TypeDeclarations.stringified?
|
13
|
+
applicable?(sugary_type_declaration.to_sym)
|
14
|
+
end
|
11
15
|
end
|
12
16
|
|
13
17
|
def desugarize(symbol)
|
14
18
|
# TODO: just use the symbol and nothing else??
|
15
19
|
# maybe confusing in languages with no distinction between symbol and string?
|
16
|
-
{ type: symbol }
|
20
|
+
{ type: symbol.to_sym }
|
17
21
|
end
|
18
22
|
|
19
23
|
def priority
|
@@ -108,6 +108,14 @@ module Foobara
|
|
108
108
|
lru_cache.cached([type_declaration_bits, block]) do
|
109
109
|
type_for_declaration_without_cache(*type_declaration_bits, &block)
|
110
110
|
end
|
111
|
+
rescue NoTypeDeclarationHandlerFoundError
|
112
|
+
raise if TypeDeclarations.strict_stringified?
|
113
|
+
raise if TypeDeclarations.stringified?
|
114
|
+
raise if TypeDeclarations.strict?
|
115
|
+
|
116
|
+
TypeDeclarations.stringified do
|
117
|
+
type_for_declaration(*type_declaration_bits, &block)
|
118
|
+
end
|
111
119
|
end
|
112
120
|
|
113
121
|
def type_for_declaration_without_cache(*type_declaration_bits, &)
|
@@ -8,6 +8,7 @@ module Foobara
|
|
8
8
|
module Mode
|
9
9
|
STRICT = :strict
|
10
10
|
STRICT_STRINGIFIED = :strict_stringified
|
11
|
+
STRINGIFIED = :stringified
|
11
12
|
end
|
12
13
|
|
13
14
|
class << self
|
@@ -70,6 +71,10 @@ module Foobara
|
|
70
71
|
using_mode(Mode::STRICT_STRINGIFIED, &)
|
71
72
|
end
|
72
73
|
|
74
|
+
def stringified(&)
|
75
|
+
using_mode(Mode::STRINGIFIED, &)
|
76
|
+
end
|
77
|
+
|
73
78
|
# TODO: use manifest context instead
|
74
79
|
def using_mode(new_mode, &)
|
75
80
|
with_manifest_context(mode: new_mode, &)
|
@@ -83,6 +88,10 @@ module Foobara
|
|
83
88
|
foobara_manifest_context_mode == Mode::STRICT_STRINGIFIED
|
84
89
|
end
|
85
90
|
|
91
|
+
def stringified?
|
92
|
+
foobara_manifest_context_mode == Mode::STRINGIFIED
|
93
|
+
end
|
94
|
+
|
86
95
|
# TODO: we should desugarize these but can't because of a bug where desugarizing entities results in creating the
|
87
96
|
# entity class in memory, whoops.
|
88
97
|
def declarations_equal?(declaration1, declaration2)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foobara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.124
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Georgi
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-05-
|
10
|
+
date: 2025-05-14 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: bigdecimal
|