tomlib 0.1.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -1
- data/README.md +8 -9
- data/ext/tomlib/toml.c +2379 -0
- data/ext/tomlib/toml.h +175 -0
- data/ext/tomlib/tomlib.c +359 -0
- data/lib/tomlib/dumper.rb +37 -15
- data/lib/tomlib/version.rb +1 -1
- data/lib/tomlib.rb +3 -1
- data/tomlib.gemspec +8 -1
- metadata +5 -3
- data/lib/tomlib/tomlib.bundle +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb163d03d5ca307ad810914faacadd2ba5650d01d6ed7458849be829cd0d080b
|
4
|
+
data.tar.gz: a4e213b0ae1d737d9fd13f0e01381a20a3bf5bfcfa35c8d5021b120b51e1e96c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 943608fb548cb2448e83191cacb95aea330fd60a0bdb117c0fd96f2b2adc885f2b8ec2f46bfa455531d3308bee239f6d0996a95f8322e33282580813658d542e
|
7
|
+
data.tar.gz: 71132c66ba2eaa88cbb7607c847e82883c0f0ffc3aa601e464d7131b2a15406702d1221a4607cc2d3cd9c597670e2be77c7f0afa023b08928f8ab052ffe98ea7
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,27 @@
|
|
1
|
+
## [0.4.0] - [2022-08-06]
|
2
|
+
|
3
|
+
- Correctly dump empty arrays
|
4
|
+
|
5
|
+
## [0.3.0] - 2022-08-05
|
6
|
+
|
7
|
+
- Add ext/* to bundled files
|
8
|
+
|
9
|
+
## [0.2.0] - 2022-08-04
|
10
|
+
|
11
|
+
- Refactor Tomlib::Dumper to be a littel faster and generate squashed nested tables
|
12
|
+
```
|
13
|
+
e.g. instead of this:
|
14
|
+
[a]
|
15
|
+
[a.b]
|
16
|
+
[a.b.c]
|
17
|
+
|
18
|
+
the output will be this:
|
19
|
+
[a.b.c]
|
20
|
+
```
|
21
|
+
- Add mention about compliance and passed tests in README.
|
22
|
+
- Declare global variables with `rb_global_variable`.
|
23
|
+
It may prevent VM from crashing in some cases.
|
24
|
+
|
1
25
|
## [0.1.0] - 2022-08-02
|
2
26
|
|
3
|
-
Initial release
|
27
|
+
- Initial release
|
data/README.md
CHANGED
@@ -3,7 +3,11 @@
|
|
3
3
|
Tomlib is a TOML parser and generator for Ruby. It is fast and standards-compliant by relying
|
4
4
|
on native [tomlc99](https://github.com/cktan/tomlc99) parser.
|
5
5
|
|
6
|
+
## Compliance
|
7
|
+
|
6
8
|
Tomlib is TOML v1.0 compliant.
|
9
|
+
It passes both [BurntSushi/toml-test](https://github.com/BurntSushi/toml-test) and
|
10
|
+
[iarna/toml-spec-tests](https://github.com/iarna/toml-spec-tests).
|
7
11
|
|
8
12
|
## Installation
|
9
13
|
|
@@ -34,12 +38,7 @@ To parse a TOML document use:
|
|
34
38
|
```ruby
|
35
39
|
require 'tomlib'
|
36
40
|
|
37
|
-
Tomlib.
|
38
|
-
firstName = "John"
|
39
|
-
lastName = "Doe"
|
40
|
-
hobbies = [ "Singing", "Dancing" ]
|
41
|
-
|
42
|
-
[address]
|
41
|
+
Tomlib.load(<<~TOML)
|
43
42
|
firstName = "John"
|
44
43
|
lastName = "Doe"
|
45
44
|
hobbies = [ "Singing", "Dancing" ]
|
@@ -119,10 +118,10 @@ Tomlib.dump(hash, indent: false)
|
|
119
118
|
|
120
119
|
## Performance
|
121
120
|
|
122
|
-
`Tomlib` parsing is ~300x faster than `toml-rb
|
123
|
-
for usual use case (~5KB TOML document size).
|
121
|
+
`Tomlib` parsing is ~300x faster than `toml-rb`, ~15x faster than `Tomlrb`
|
122
|
+
and ~3x faster than `perfect_toml` for usual use case (~5KB TOML document size).
|
124
123
|
|
125
|
-
Generating TOML document is about
|
124
|
+
Generating TOML document is about 2x faster than `toml-rb`.
|
126
125
|
|
127
126
|
For full comparison take a look at
|
128
127
|
[benchmarks](https://github.com/kgiszczak/tomlib/tree/master/benchmarks)
|