ctx_parser 0.2.6 → 0.2.7
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 +4 -0
- data/lib/ctx_parser/registry.rb +7 -2
- data/lib/ctx_parser/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: 4d84cc8bc893504d59bcb59768249c3f6880e7bf4757e7cda0333a825fe970cb
|
|
4
|
+
data.tar.gz: 9fc49cbefd3fbaa1dac638866fac31013523d500273caf9833d0a688ab8cc119
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9c44977283824958faf6f1018739d54e0f8942bf4414bf452feaae4e982d542de190ef07743822625122034c3a22c4d42bf799f58cce600db174a7810aa7a5b7
|
|
7
|
+
data.tar.gz: dfa24e5bfe18b39003f226fe9bf6fac3eb31f72a9f093404998cade819edea543a7387c42a498099d15afb7a87f6a55ff0052d86e2e31a9276095656f0474409
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,10 @@ Changes to the public contract are recorded here. Versions follow Semantic Versi
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 0.2.7 (2026-10-23)
|
|
8
|
+
|
|
9
|
+
- Expose one canonical platform lookup shared by profile selection and consuming checkers.
|
|
10
|
+
|
|
7
11
|
## 0.2.6 (2026-10-21)
|
|
8
12
|
|
|
9
13
|
- Build immutable hash snapshots without temporary field-pair arrays, retaining ordinary key equality, cycle rejection and deep-tree support.
|
data/lib/ctx_parser/registry.rb
CHANGED
|
@@ -23,10 +23,15 @@ module CtxParser
|
|
|
23
23
|
|
|
24
24
|
# 按平台或别名创建 Profile 实例,拒绝未知名称。
|
|
25
25
|
def fetch(platform, model: nil)
|
|
26
|
+
@profiles.fetch(canonical(platform)).new(model: model)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# 平台身份与 Profile 选择使用同一套归一化和别名规则。
|
|
30
|
+
def canonical(platform)
|
|
26
31
|
key = platform_key(platform)
|
|
27
32
|
key = @aliases.fetch(key, key)
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
raise ArgumentError, "Unsupported parser platform" unless @profiles.key?(key)
|
|
34
|
+
key
|
|
30
35
|
end
|
|
31
36
|
|
|
32
37
|
private
|
data/lib/ctx_parser/version.rb
CHANGED