ctx_parser 0.2.9 → 0.3.0

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: '05721084ade7516289ec28e3d1330349e1a24536838523b386a04c1e760cca40'
4
- data.tar.gz: 17812aad28594b7fee5e3abb9e287e8a8876831aea01bbcb3e672282103cc90f
3
+ metadata.gz: 492a2e200870280a1f4b2d58100e532557ac7f8b92bb3f4a84d7850089ebb80a
4
+ data.tar.gz: 4e9055e1be83197785f5fbedd6043a42b2568e377951916cc78921d28d9738be
5
5
  SHA512:
6
- metadata.gz: 93ae2fc0264f54382ae02aae0c5de52bbba3ed7c0b56466c251d314b990c3846e33b57716672d9f9a7273722de42d0b8f0d1e07e511631b5b0e96d43c555126b
7
- data.tar.gz: be753612b50f307c882ca33bcdc2aae5f17fc84206c3cb935107777e7f7886323f107ba1b42b329f819cbcc302e37c86556b12c64b0948ea5fc030d70b739fc4
6
+ metadata.gz: c855bbd1456d6c6569eee7cf9834ea6914d29c942954836b87a5453386cb117f77b38e717b87a88f4d5c5662705976ca02bdb0391d15978d7c95c7aa2dd57131
7
+ data.tar.gz: 6043a601e4d81c530ef7f812ae66d78b61f44444574bed26cf02d7bebca3d8fa29b2f91831ca6eca67b1e1b3d66250d8252ab40a036cde57c86aa4dadb743a0c
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.3.0 (2026-10-29)
8
+
9
+ - Add `Result#partial?` and `#available?`; reject records on failed or unsupported results.
10
+
7
11
  ## 0.2.9 (2026-10-24)
8
12
 
9
13
  - Correct dependency documentation to match the unconstrained ipaddr and digest declarations; applications select and validate their runtime dependency combination.
data/README-zh.md CHANGED
@@ -122,3 +122,6 @@ CI 在 Linux、macOS 上执行测试、lint、示例、构建和隔离安装。`
122
122
  ## 许可证
123
123
 
124
124
  MIT,见 [LICENSE](LICENSE)。
125
+
126
+
127
+ `Result#partial?` identifies partial parsing; `#available?` is true for complete or partial results. Failed and unsupported results cannot contain records. Availability does not establish completeness or network health.
data/README.md CHANGED
@@ -122,3 +122,6 @@ Publish dependency gems first. A Git tag, a successful build, or a workflow file
122
122
  ## License
123
123
 
124
124
  MIT. See [LICENSE](LICENSE).
125
+
126
+
127
+ `Result#partial?` identifies partial parsing; `#available?` is true for complete or partial results. Failed and unsupported results cannot contain records. Availability does not establish completeness or network health.
@@ -11,11 +11,18 @@ module CtxParser
11
11
  raise ArgumentError, "Records must be hashes" unless records.is_a?(Array) && records.all? { |row| row.is_a?(Hash) }
12
12
  raise ArgumentError, "Issues must be hashes" unless issues.is_a?(Array) && issues.all? { |issue| issue.is_a?(Hash) }
13
13
 
14
+ if %i[failed unsupported].include?(status) && records.any?
15
+ raise ArgumentError, "Unavailable parser results cannot contain records"
16
+ end
17
+
14
18
  super(status: status, records: Immutable.copy(records), issues: Immutable.copy(issues))
15
19
  end
16
20
 
17
21
  # 判断解析结果是否具有完整证据。
18
22
  def complete? = status == :complete
23
+ # 不完整事实仍可用于报告已观察到的问题。
24
+ def partial? = status == :partial
25
+ def available? = complete? || partial?
19
26
 
20
27
  # 展示对象身份与状态,避免泄露原始回显或凭据。
21
28
  def inspect = "#<#{self.class.name} status=#{status} records=#{records.size}>"
@@ -2,5 +2,5 @@
2
2
 
3
3
  module CtxParser
4
4
  # 公开包版本,供 RubyGems 元数据和运行时调用方共用。
5
- VERSION = "0.2.9"
5
+ VERSION = "0.3.0"
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.9
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gatework contributors