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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 488dca1bfd052afe8a7719c6e5c89d4b2b5c86f189243c02b651438ce45a69c1
4
- data.tar.gz: 33e7aa374cc8285c6dbb76ff4c9d87849116c3fa1a61ddb1ee720d108baed8ee
3
+ metadata.gz: 4d84cc8bc893504d59bcb59768249c3f6880e7bf4757e7cda0333a825fe970cb
4
+ data.tar.gz: 9fc49cbefd3fbaa1dac638866fac31013523d500273caf9833d0a688ab8cc119
5
5
  SHA512:
6
- metadata.gz: 8459a636b16bdbe34e4446530714b1f686daa9bab80ca0cb713fdff9422066a388a7410dae7d083126c92415c8cb97f479a321da91d6113feb947cd03158bff6
7
- data.tar.gz: ae3de9681c49c1d4be422c3b4b7c1fc47aeb0c152cb740370846fc3f80122435b184de6f2c977c3dac06d848c04a2c2d7191ad54d286214eee027c67d0b48abc
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.
@@ -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
- profile = @profiles.fetch(key) { raise ArgumentError, "Unsupported parser platform" }
29
- profile.new(model: model)
33
+ raise ArgumentError, "Unsupported parser platform" unless @profiles.key?(key)
34
+ key
30
35
  end
31
36
 
32
37
  private
@@ -2,5 +2,5 @@
2
2
 
3
3
  module CtxParser
4
4
  # 公开包版本,供 RubyGems 元数据和运行时调用方共用。
5
- VERSION = "0.2.6"
5
+ VERSION = "0.2.7"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ctx_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gatework contributors