toml-rb 2.1.2 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/toml-rb/dumper.rb +6 -1
- data/lib/toml-rb/grammars/array.citrus +6 -6
- data/lib/toml-rb/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ffefacf06bf0b68f7d313970ca32038eee20ca6523e858bfb2868a0a157b54c
|
4
|
+
data.tar.gz: 46a024f4576404516986a08785b63f2c63c3eabf29fa0e114b6758ca251ef6e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce98e0824c9079b7f2703330fb23d5954bb6ce2a3e0f1f69b7fb7d0a98098d46f74a4e0a5011b21bffea83c52e03932658ba54ce336231c28f250306fdac6c31
|
7
|
+
data.tar.gz: 1a12c162af7d87ea67906fb83849b300e8cf7810e39ee2009a0a3fc2f496be916cca99defca054687e53a9a6ce46da432874032d98836fc262b45154ff9aeb80
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
![TOML Logo](https://github.com/toml-lang/toml/blob/
|
1
|
+
![TOML Logo](https://github.com/toml-lang/toml/blob/main/logos/toml-100.png)
|
2
2
|
|
3
3
|
|
4
4
|
toml-rb
|
@@ -11,7 +11,7 @@ toml-rb
|
|
11
11
|
|
12
12
|
A [TOML](https://github.com/toml-lang/toml) parser using [Citrus](http://mjackson.github.io/citrus) library.
|
13
13
|
|
14
|
-
TOML specs supported: `0.
|
14
|
+
TOML specs supported: `1.0.0`
|
15
15
|
|
16
16
|
Installation
|
17
17
|
------------
|
data/lib/toml-rb/dumper.rb
CHANGED
@@ -108,8 +108,13 @@ module TomlRB
|
|
108
108
|
!!key.to_s.match(/^[a-zA-Z0-9_-]*$/)
|
109
109
|
end
|
110
110
|
|
111
|
+
# The key needs to use quotes according to TOML specs.
|
112
|
+
# Ruby representation of literals or strings, mixed with special characters
|
113
|
+
# made the concatenation error-prone, luckiley the `#inspect` method returns
|
114
|
+
# exactly what we need. I decided to keep the method `quote_key/1`
|
115
|
+
# for readability.
|
111
116
|
def quote_key(key)
|
112
|
-
|
117
|
+
key.inspect
|
113
118
|
end
|
114
119
|
end
|
115
120
|
end
|
@@ -1,36 +1,36 @@
|
|
1
1
|
grammar TomlRB::Arrays
|
2
2
|
include TomlRB::Primitive
|
3
|
-
|
3
|
+
|
4
4
|
rule array_comments
|
5
5
|
(indent? (comment indent?)*)
|
6
6
|
end
|
7
7
|
|
8
8
|
rule float_array
|
9
|
-
(float (
|
9
|
+
(float (indent? "," array_comments float)*) {
|
10
10
|
captures[:float].map(&:value)
|
11
11
|
}
|
12
12
|
end
|
13
13
|
|
14
14
|
rule string_array
|
15
|
-
(string (
|
15
|
+
(string (indent? "," array_comments string)*) {
|
16
16
|
captures[:string].map(&:value)
|
17
17
|
}
|
18
18
|
end
|
19
19
|
|
20
20
|
rule integer_array
|
21
|
-
(integer (
|
21
|
+
(integer (indent? "," array_comments integer)*) {
|
22
22
|
captures[:integer].map(&:value)
|
23
23
|
}
|
24
24
|
end
|
25
25
|
|
26
26
|
rule datetime_array
|
27
|
-
(datetime (
|
27
|
+
(datetime (indent? "," array_comments datetime)*) {
|
28
28
|
captures[:datetime].map(&:value)
|
29
29
|
}
|
30
30
|
end
|
31
31
|
|
32
32
|
rule bool_array
|
33
|
-
(bool (
|
33
|
+
(bool (indent? "," array_comments bool)*) {
|
34
34
|
captures[:bool].map(&:value)
|
35
35
|
}
|
36
36
|
end
|
data/lib/toml-rb/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toml-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emiliano Mancuso
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-01-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: citrus
|
@@ -31,6 +31,20 @@ dependencies:
|
|
31
31
|
- - ">"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '3.0'
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: racc
|
36
|
+
requirement: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.7'
|
41
|
+
type: :runtime
|
42
|
+
prerelease: false
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.7'
|
34
48
|
- !ruby/object:Gem::Dependency
|
35
49
|
name: minitest
|
36
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -118,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
132
|
- !ruby/object:Gem::Version
|
119
133
|
version: '0'
|
120
134
|
requirements: []
|
121
|
-
rubygems_version: 3.
|
135
|
+
rubygems_version: 3.4.10
|
122
136
|
signing_key:
|
123
137
|
specification_version: 4
|
124
138
|
summary: Toml parser in ruby, for ruby.
|