foobara 0.0.66 → 0.0.68
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: 790ae183ee74af5880496317c73fd548aefe37167a38b4591dedb46b67a2bf79
|
4
|
+
data.tar.gz: c057c7557d53dff6efef1ae9506b57a0fbdc0249f48cb10040de808697b7e495
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7b5571c2174ae0022efeccdbdcf053e8c2fcfa9cd152a4caf31d4f1313dd9f4ec32d0a249a88b4c59b271685e1676d0ba8537da77dd7c7e6b6a119838d40622
|
7
|
+
data.tar.gz: 243e81f88a9456cb93ded173519f79eb863779ce8957fc51fc3ba808acc24b0ad59090310b4671bfa4034adfc676bc1733c43a3e60b615b7439eb7ec414fb53d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## [0.0.68] - 2025-02-28
|
2
|
+
|
3
|
+
- Make use of LruCache for performance boost when converting type declarations to types
|
4
|
+
|
5
|
+
## [0.0.67] - 2025-02-26
|
6
|
+
|
7
|
+
- Convert / to _ when building constant names in Enumerated::Values
|
8
|
+
|
1
9
|
## [0.0.66] - 2025-02-26
|
2
10
|
|
3
11
|
- Make sure methods like Command::Manifest#inputs_types_depended_on return [] instead of nil when missing
|
@@ -57,7 +57,7 @@ module Foobara
|
|
57
57
|
normalized = {}
|
58
58
|
|
59
59
|
symbol_map.each_pair do |name, value|
|
60
|
-
normalized[Util.constantify(name).gsub(
|
60
|
+
normalized[Util.constantify(name).gsub(/[:\/]/, "_").to_sym] = value&.to_sym
|
61
61
|
end
|
62
62
|
|
63
63
|
normalized.freeze
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "foobara/lru_cache"
|
2
|
+
|
1
3
|
module Foobara
|
2
4
|
module TypeDeclarations
|
3
5
|
class TypeBuilder
|
@@ -63,6 +65,12 @@ module Foobara
|
|
63
65
|
end
|
64
66
|
|
65
67
|
def type_for_declaration(*type_declaration_bits, &block)
|
68
|
+
lru_cache.cached([type_declaration_bits, block]) do
|
69
|
+
type_for_declaration_without_cache(*type_declaration_bits, &block)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def type_for_declaration_without_cache(*type_declaration_bits, &block)
|
66
74
|
type_declaration = if block
|
67
75
|
unless type_declaration_bits.empty?
|
68
76
|
# :nocov:
|
@@ -88,8 +96,18 @@ module Foobara
|
|
88
96
|
handler.process_value!(type_declaration)
|
89
97
|
end
|
90
98
|
|
99
|
+
def clear_cache
|
100
|
+
if @lru_cache
|
101
|
+
lru_cache.reset!
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
91
105
|
private
|
92
106
|
|
107
|
+
def lru_cache
|
108
|
+
@lru_cache ||= Foobara::LruCache.new(100)
|
109
|
+
end
|
110
|
+
|
93
111
|
def type_declaration_bits_to_type_declaration(type_declaration_bits)
|
94
112
|
type, *symbolic_processors, processor_data = type_declaration_bits
|
95
113
|
|
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.68
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Georgi
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-02-
|
10
|
+
date: 2025-02-28 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: bigdecimal
|
@@ -23,6 +23,20 @@ dependencies:
|
|
23
23
|
- - ">="
|
24
24
|
- !ruby/object:Gem::Version
|
25
25
|
version: '0'
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: foobara-lru-cache
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
26
40
|
- !ruby/object:Gem::Dependency
|
27
41
|
name: foobara-util
|
28
42
|
requirement: !ruby/object:Gem::Requirement
|