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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ed2a5c60a90b96e4f1d9a0aa3024fc3b1cfc9504fe959d881528bf0daa9367f
4
- data.tar.gz: 9fa0b0ce2c2ae818c797aa7f5b42d51988ab502f498807aa60db6b1aff106ac1
3
+ metadata.gz: 8ffefacf06bf0b68f7d313970ca32038eee20ca6523e858bfb2868a0a157b54c
4
+ data.tar.gz: 46a024f4576404516986a08785b63f2c63c3eabf29fa0e114b6758ca251ef6e0
5
5
  SHA512:
6
- metadata.gz: 4a94f395d0d470a13d4b45b39a11f44917f7b9d992b18717677b219ffb4abe4ca73cf0bd693da833dbaf6eabe627b25e4f43bfe1661ed61cc9d6ca2a215313c0
7
- data.tar.gz: 842796622e4c97b5c08c691a4a876a6a00b358b4d0222e8665a7e1b34b105f30d8f711e77ecc77f4f49d9d6417b57e775c842dcc15c5b7998c4c6199c0dede4e
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/master/logos/toml-100.png)
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.5.0`
14
+ TOML specs supported: `1.0.0`
15
15
 
16
16
  Installation
17
17
  ------------
@@ -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
- '"' + key.gsub('"', '\\"') + '"'
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 (space "," array_comments 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 (space "," array_comments 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 (space "," array_comments 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 (space "," array_comments 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 (space "," array_comments bool)*) {
33
+ (bool (indent? "," array_comments bool)*) {
34
34
  captures[:bool].map(&:value)
35
35
  }
36
36
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TomlRB
4
- VERSION = "2.1.2"
4
+ VERSION = "3.0.0"
5
5
  end
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: 2.1.2
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: 2022-01-27 00:00:00.000000000 Z
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.2.9
135
+ rubygems_version: 3.4.10
122
136
  signing_key:
123
137
  specification_version: 4
124
138
  summary: Toml parser in ruby, for ruby.