ctx_parser 0.2.8 → 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 +8 -0
- data/README-zh.md +4 -1
- data/README.md +4 -1
- 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,14 @@ 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
|
+
|
|
11
|
+
## 0.2.9 (2026-10-24)
|
|
12
|
+
|
|
13
|
+
- Correct dependency documentation to match the unconstrained ipaddr and digest declarations; applications select and validate their runtime dependency combination.
|
|
14
|
+
|
|
7
15
|
## 0.2.8 (2026-10-23)
|
|
8
16
|
|
|
9
17
|
- Remove the extra minimum version requirement for the standard-library ipaddr dependency.
|
data/README-zh.md
CHANGED
|
@@ -21,7 +21,7 @@ gem "ctx_parser"
|
|
|
21
21
|
|
|
22
22
|
然后执行 `bundle install`;也可直接执行 `gem install ctx_parser`。Ruby 加载入口为 `ctx_parser`,公开命名空间为 `CtxParser`;gem 包名与 Ruby 命名空间分别维护。
|
|
23
23
|
|
|
24
|
-
本模块不依赖其他 Gatework 领域 gem。 gemspec
|
|
24
|
+
本模块不依赖其他 Gatework 领域 gem。 gemspec 声明 `ipaddr` 和 `digest`,不限制版本;运行依赖组合应由应用锁文件固定并验证;应用应提交自己的 `Gemfile.lock`,保持部署可复现。使用本库不需要启动 Rails 或配置兄弟模块的本地路径。
|
|
25
25
|
|
|
26
26
|
发布产物和校验值见 [GitHub Releases](https://github.com/gatework/ctx_parser/releases),已发布版本以 [RubyGems](https://rubygems.org/gems/ctx_parser) 为准。
|
|
27
27
|
|
|
@@ -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
|
@@ -21,7 +21,7 @@ gem "ctx_parser"
|
|
|
21
21
|
|
|
22
22
|
Then run `bundle install`, or install directly with `gem install ctx_parser`. The require path is `ctx_parser` and the public namespace is `CtxParser`; package names and Ruby namespaces are intentionally separate.
|
|
23
23
|
|
|
24
|
-
This package has no dependency on the other Gatework domain gems. The gemspec
|
|
24
|
+
This package has no dependency on the other Gatework domain gems. The gemspec declares `ipaddr` and `digest` without version constraints. Select and validate the runtime dependency combination in the application lockfile. Applications should commit their own `Gemfile.lock` to make deployments reproducible. No Rails boot or sibling checkout paths are required.
|
|
25
25
|
|
|
26
26
|
Release artifacts and checksums are available from [GitHub Releases](https://github.com/gatework/ctx_parser/releases). Check [RubyGems](https://rubygems.org/gems/ctx_parser) for published versions.
|
|
27
27
|
|
|
@@ -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