tomlib 0.3.0 → 0.4.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: c879638c835897b4aaa67e82eeae29b24d9bc1ca86b25fa6b0fcfb354ea57886
4
- data.tar.gz: d1218c7dfd4aac3cd1bb3f698e800a08b42e8128363c5f11d93a62f5b1b9a36b
3
+ metadata.gz: fb163d03d5ca307ad810914faacadd2ba5650d01d6ed7458849be829cd0d080b
4
+ data.tar.gz: a4e213b0ae1d737d9fd13f0e01381a20a3bf5bfcfa35c8d5021b120b51e1e96c
5
5
  SHA512:
6
- metadata.gz: 86053d93264824b8f7a5ed9faebc6dbbf01f821dd5d6a1da583e437547daa1d052704e6354ee76bf1031264bb955ac8a6cc34acc7496371ac7c0133ab45a84ee
7
- data.tar.gz: '084bb8c33dfdc5e5c13ef6df21d083b0ae6b1161a82618ee2155339f758892887af93588126c4302f6c579200d0d7c8f5950d0cd7391540590279a964b94bc1e'
6
+ metadata.gz: 943608fb548cb2448e83191cacb95aea330fd60a0bdb117c0fd96f2b2adc885f2b8ec2f46bfa455531d3308bee239f6d0996a95f8322e33282580813658d542e
7
+ data.tar.gz: 71132c66ba2eaa88cbb7607c847e82883c0f0ffc3aa601e464d7131b2a15406702d1221a4607cc2d3cd9c597670e2be77c7f0afa023b08928f8ab052ffe98ea7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.4.0] - [2022-08-06]
2
+
3
+ - Correctly dump empty arrays
4
+
1
5
  ## [0.3.0] - 2022-08-05
2
6
 
3
7
  - Add ext/* to bundled files
data/lib/tomlib/dumper.rb CHANGED
@@ -74,7 +74,7 @@ module Tomlib
74
74
  end
75
75
 
76
76
  footer << dump_hash(value, compound_key, skip ? indent_level : indent_level + 1)
77
- elsif value.is_a?(Array) && value.all? { |e| e.is_a?(Hash) }
77
+ elsif value.is_a?(Array) && !value.empty? && value.all? { |e| e.is_a?(Hash) }
78
78
  compound_key = to_toml_compound_key(base_key, toml_key)
79
79
  indent = @use_indent ? INDENT * indent_level : ''.freeze
80
80
 
@@ -148,7 +148,7 @@ module Tomlib
148
148
  when Hash
149
149
  "{ #{value.map { |k, v| "#{to_toml_key(k)} = #{to_toml_value(v)}" }.join(', ')} }"
150
150
  when Array
151
- "[ #{value.map { |e| to_toml_value(e) }.join(', ')} ]"
151
+ value.empty? ? '[]' : "[ #{value.map { |e| to_toml_value(e) }.join(', ')} ]"
152
152
  when nil
153
153
  '""'.freeze
154
154
  else
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Tomlib
4
4
  # @api private
5
- VERSION = '0.3.0'
5
+ VERSION = '0.4.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tomlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kamil Giszczak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-05 00:00:00.000000000 Z
11
+ date: 2022-08-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Fast TOML parser and generator with native extension.
14
14
  email: