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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cad3285573937eb84bc6296769943167c22e0ee3d2116bfa14ede731c01b16a8
4
- data.tar.gz: df39ee74e57292f031c18eff86bd1e83f5f4ee0d4cf0662a33cede4d54fb7fad
3
+ metadata.gz: 492a2e200870280a1f4b2d58100e532557ac7f8b92bb3f4a84d7850089ebb80a
4
+ data.tar.gz: 4e9055e1be83197785f5fbedd6043a42b2568e377951916cc78921d28d9738be
5
5
  SHA512:
6
- metadata.gz: 5f8f13c0eb39be188471266b3d50bd74549a74d15f62fb029a01afaad0e637c508349cf742cdb01b9213207cbe4cafc2f8e9f4d5a201ebd0aed09da4e94cf34c
7
- data.tar.gz: 1accf89b2e92848fed18a51324c1bde95e4f2165db697bd2bb6718be2cc482ac4d9c901b1810d47a769104ece3c6010be66956f5770e5f5ef3e6bcf0a63b4e11
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 要求 `ipaddr >= 1.2.3` 以确保严格地址解析,`digest` 不设版本约束;应用应提交自己的 `Gemfile.lock`,保持部署可复现。使用本库不需要启动 Rails 或配置兄弟模块的本地路径。
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 requires `ipaddr >= 1.2.3` for strict address parsing; `digest` has no version constraint. Applications should commit their own `Gemfile.lock` to make deployments reproducible. No Rails boot or sibling checkout paths are required.
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.
@@ -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.8"
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.8
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gatework contributors