abroad 3.0.0 → 3.0.1

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
  SHA1:
3
- metadata.gz: c77d7fb008e8b64206757f4b759c6072c81f5bfe
4
- data.tar.gz: aabb8e2704bb74b6c1fca063d4e7abe88e3f4be8
3
+ metadata.gz: 4cbe6a333acda4b792403b71bed3161dd123ee5d
4
+ data.tar.gz: 20790811f1e0927b0a0b2962f8f433f6e6b7ec7e
5
5
  SHA512:
6
- metadata.gz: 2634856a2566131663f7aac23384351159c4c1006d48362bd5b56cb497d224f574f754c2adb69fe4440e615bebe3f853e2e22dacf356cab32bd0152608381d22
7
- data.tar.gz: 27c2801ff3f1f4986375f1181a900d5dcf5711abe55a283a5e313c1a286121066f99ba7cbcb59b8b23c6390860c52fafbda8de06f6bc4875f769c9ef80f2148e
6
+ metadata.gz: 2bb927936eff4941f64c053da29d1aca9452b58ba1ac92f0844da29390383c22b7be982ae678ec2c462e346d538fa29b04b2cecd5202ffe8caec7ab37aa47b85
7
+ data.tar.gz: c23e65ec8f4783daf0e3609aad162996c2e241bf6316bbdb30525d4a62f45c5acb5d76ff380fc85de0f76e7ec632be750c9022a0396846dc7bc7ab655dbb74d4
@@ -16,7 +16,7 @@ module Abroad
16
16
 
17
17
  def write_key_value(key, value)
18
18
  key_parts = split_key(key)
19
- encoded_value = value.encode(encoding)
19
+ encoded_value = value.encode(encoding) if value
20
20
  trie.add(key_parts, encoded_value)
21
21
  end
22
22
 
@@ -57,7 +57,7 @@ module Abroad
57
57
  end
58
58
 
59
59
  def write_value(node, parent_key)
60
- value = node ? node.value : ''
60
+ value = (node ? node.value : '') || ''
61
61
  if writer.in_map?
62
62
  writer.write_key_value(parent_key, value)
63
63
  else
@@ -1,3 +1,3 @@
1
1
  module Abroad
2
- VERSION = '3.0.0'
2
+ VERSION = '3.0.1'
3
3
  end
@@ -168,4 +168,12 @@ describe Yaml::RailsSerializer do
168
168
  }
169
169
  })
170
170
  end
171
+
172
+ it 'converts nils to empty strings' do
173
+ result = serialize do
174
+ serializer.write_key_value('foo.bar', nil)
175
+ end
176
+
177
+ expect(result).to eq('fr' => { 'foo' => { 'bar' => '' } })
178
+ end
171
179
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abroad
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-23 00:00:00.000000000 Z
11
+ date: 2016-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities