super_serialize 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/super_serialize/version.rb +1 -1
- data/lib/super_serialize.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01786a69a2421f173b5caaca4c5545f94b6c6762
|
4
|
+
data.tar.gz: 3b1052d17f4d938cbd1b623458bbeb686ff343fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fe2507216bd560c8ce8bad1e7c1f9fedaf555c047d43825e502abbea5c8287f9b06b8a2c01bcf4d3233481e4aa73bd39f21e39adcedde2f9b94128ca166789e
|
7
|
+
data.tar.gz: dbe429d9ae48bf5700e121088bf87ab8300262d7112ce0ed4fa08703b9acdee89005ef35251a418bfdc36160c7213357eb9164ff622fee17868c3c74752113b2
|
data/lib/super_serialize.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module SuperSerialize
|
2
2
|
extend ActiveSupport::Concern
|
3
|
-
|
3
|
+
|
4
4
|
included do
|
5
5
|
end
|
6
6
|
|
@@ -112,6 +112,8 @@ module SuperSerialize
|
|
112
112
|
value = attempt_to_sanitize_hash_syntax(value)
|
113
113
|
elsif is_number_string_starting_with_zero?(value)
|
114
114
|
value = value.to_yaml
|
115
|
+
elsif value == ''
|
116
|
+
value = nil
|
115
117
|
end
|
116
118
|
end
|
117
119
|
|
@@ -176,6 +178,9 @@ module SuperSerialize
|
|
176
178
|
|
177
179
|
def is_valid_yaml?(value)
|
178
180
|
begin
|
181
|
+
# YAML::load('') returns false
|
182
|
+
return true if value == ''
|
183
|
+
|
179
184
|
!!YAML.load(value)
|
180
185
|
rescue
|
181
186
|
false
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: super_serialize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Quiñones
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|