foobara 0.0.122 → 0.0.123
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: 604089ac36c58dbd5640d75018baabab9510df8ef2c358318af660c0fa1db12a
|
4
|
+
data.tar.gz: e87264b5380e66ab05985092f370c4c00c668b0d860e91df86d6f9044738fc0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f47aab9fd3411f3999d07dd3ba07d29fc6512b5efcf0eb2d1059f6f8d49b64edc3a38a4f9831d9b277844d80497600384902e7092c9c7237b74db6b6b92eaa69
|
7
|
+
data.tar.gz: dd0f28a582d9deb6429c4419d3b715836566d19c14ccb4791408d3b3d8015b9694b48041f697f972934a9a013490bc6df3309ea75d2b414f3b4ff69de4d1f855
|
data/CHANGELOG.md
CHANGED
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.123
|
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
|