philiprehberger-toml_kit 0.2.1 → 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: d2f89cf922471a9e2c70133ac896b317aa2f627b220324cd9b64b445049b374f
4
- data.tar.gz: 50f05dfc9b0aaa4e69fc15a1f3e3d7543c0a0071f81c4bb4f1291ecdcaacf606
3
+ metadata.gz: 174ea153b4049cb9bfa03861fcfd17b0a1d6ca732c77bee833596261d8c3ac73
4
+ data.tar.gz: 9bcc85d52e0186652cee5b9304c4673da3f66d0eec8a4ff70ecd2bdfc856635b
5
5
  SHA512:
6
- metadata.gz: f0e25fa65fc9b83facbb8367ae5c8018300cbfd4de66512d94dd8f716279e119cdf16986c160dc47f11128b1ec9b0ba5a69df0e58f689f08eda6a62119604d7e
7
- data.tar.gz: e68b68e762bf3e997f88e85251583ccafbc046a9b3efbd1288204f705e3dcc4e47c2924bea102476a8b497156d306b598554e6b4095aa2b61599a3e2531b4416
6
+ metadata.gz: e45be50d82be1e07d068a2932aa9c5889f5f2ae3a9fde62ec76850d9df3e9b3297ce3fa2fd46999af8f8fbc2e47e49ca1f5c89f3f5c0d8bd00e11fb7ea05d687
7
+ data.tar.gz: d65fe1af77f1fb87a56a4270e5bc2a7624fec1f75cab35bf56a24bc6f69369c9b5464991870475abe166b785626d64e23788141dfc68d8e3f6ea4a9baf6e0ccb
data/CHANGELOG.md CHANGED
@@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.3.0] - 2026-04-15
11
+
12
+ ### Added
13
+ - `TomlKit.valid?(string)` predicate for checking whether a string parses as TOML without raising
14
+
15
+ ## [0.2.4] - 2026-04-09
16
+
17
+ ### Fixed
18
+ - CI: split long gemspec summary line to satisfy RuboCop Layout/LineLength.
19
+
20
+ ## [0.2.3] - 2026-04-08
21
+
22
+ ### Changed
23
+ - Align gemspec summary with README description.
24
+
25
+ ## [0.2.2] - 2026-03-31
26
+
27
+ ### Added
28
+ - Add GitHub issue templates, dependabot config, and PR template
29
+
10
30
  ## [0.2.1] - 2026-03-31
11
31
 
12
32
  ### Changed
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![Gem Version](https://badge.fury.io/rb/philiprehberger-toml_kit.svg)](https://rubygems.org/gems/philiprehberger-toml_kit)
5
5
  [![Last updated](https://img.shields.io/github/last-commit/philiprehberger/rb-toml-kit)](https://github.com/philiprehberger/rb-toml-kit/commits/main)
6
6
 
7
- TOML v1.0 parser and serializer for Ruby with comment preservation, schema validation, merging, querying, type coercion, and diffing.
7
+ TOML v1.0 parser and serializer for Ruby with comment preservation, schema validation, merging, querying, type coercion, and diffing
8
8
 
9
9
  ## Requirements
10
10
 
@@ -56,6 +56,15 @@ config["database"]["host"] # => "localhost"
56
56
  config["servers"][0]["name"] # => "alpha"
57
57
  ```
58
58
 
59
+ ### Validity Check
60
+
61
+ Check whether a string is valid TOML without raising:
62
+
63
+ ```ruby
64
+ Philiprehberger::TomlKit.valid?('key = "value"') # => true
65
+ Philiprehberger::TomlKit.valid?('key = [broken') # => false
66
+ ```
67
+
59
68
  ### Loading Files
60
69
 
61
70
  ```ruby
@@ -253,6 +262,7 @@ Philiprehberger::TomlKit::Diff.identical?(old_config, new_config)
253
262
  | Method | Description |
254
263
  |--------|-------------|
255
264
  | `TomlKit.parse(string)` | Parse a TOML string into a Hash |
265
+ | `TomlKit.valid?(string)` | Return `true` if the string parses as valid TOML |
256
266
  | `TomlKit.load(path)` | Parse a TOML file into a Hash |
257
267
  | `TomlKit.dump(hash)` | Serialize a Hash to a TOML string |
258
268
  | `TomlKit.save(hash, path)` | Write a Hash as a TOML file |
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Philiprehberger
4
4
  module TomlKit
5
- VERSION = '0.2.1'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
@@ -29,6 +29,17 @@ module Philiprehberger
29
29
  Parser.new.parse(string)
30
30
  end
31
31
 
32
+ # Check whether a string parses as valid TOML without raising.
33
+ #
34
+ # @param string [String] TOML document
35
+ # @return [Boolean] true if the string is valid TOML
36
+ def self.valid?(string)
37
+ parse(string)
38
+ true
39
+ rescue ParseError
40
+ false
41
+ end
42
+
32
43
  # Parse a TOML file into a Ruby Hash.
33
44
  #
34
45
  # @param path [String] path to a TOML file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: philiprehberger-toml_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Rehberger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-31 00:00:00.000000000 Z
11
+ date: 2026-04-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Parse and generate TOML v1.0 documents with full type support including
14
14
  datetimes, inline tables, and array of tables. Zero dependencies.
@@ -31,11 +31,11 @@ files:
31
31
  - lib/philiprehberger/toml_kit/serializer.rb
32
32
  - lib/philiprehberger/toml_kit/type_coercion.rb
33
33
  - lib/philiprehberger/toml_kit/version.rb
34
- homepage: https://github.com/philiprehberger/rb-toml-kit
34
+ homepage: https://philiprehberger.com/open-source-packages/ruby/philiprehberger-toml_kit
35
35
  licenses:
36
36
  - MIT
37
37
  metadata:
38
- homepage_uri: https://github.com/philiprehberger/rb-toml-kit
38
+ homepage_uri: https://philiprehberger.com/open-source-packages/ruby/philiprehberger-toml_kit
39
39
  source_code_uri: https://github.com/philiprehberger/rb-toml-kit
40
40
  changelog_uri: https://github.com/philiprehberger/rb-toml-kit/blob/main/CHANGELOG.md
41
41
  bug_tracker_uri: https://github.com/philiprehberger/rb-toml-kit/issues
@@ -58,5 +58,6 @@ requirements: []
58
58
  rubygems_version: 3.5.22
59
59
  signing_key:
60
60
  specification_version: 4
61
- summary: TOML v1.0 parser and serializer for Ruby
61
+ summary: TOML v1.0 parser and serializer for Ruby with comment preservation, schema
62
+ validation, merging, querying, type coercion, and diffing
62
63
  test_files: []