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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README-zh.md +3 -0
- data/README.md +3 -0
- data/lib/ctx_parser/result.rb +7 -0
- 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: 492a2e200870280a1f4b2d58100e532557ac7f8b92bb3f4a84d7850089ebb80a
|
|
4
|
+
data.tar.gz: 4e9055e1be83197785f5fbedd6043a42b2568e377951916cc78921d28d9738be
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
data/lib/ctx_parser/result.rb
CHANGED
|
@@ -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}>"
|
data/lib/ctx_parser/version.rb
CHANGED