super_serialize 0.0.7 → 0.0.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 113e73578c6129d5fe83f8891462fe48420e0ccb
4
- data.tar.gz: c5d8288544248745501069722553aa199b50c1c9
3
+ metadata.gz: c845b46dfc0d04532239e05687b35e7a801670b7
4
+ data.tar.gz: 32a7d0be062f79ef35ec5f54d1792beae5897a9e
5
5
  SHA512:
6
- metadata.gz: 0da355d407dd48d5c268364161a2c273710065125157eeb4aaae711a36c6d77b2844138beff05a8ca6efff248d030ca22c7257bfb6a0e76bcfa072f4f4b6cbe0
7
- data.tar.gz: 823ba318be5d3a2d26085e127e4d4c840c88deb0d0652a1b7e63652afdc2a8e6f133fabc3a72a071321d694259da275a260b8054326a7ca61d9b3cfc545c0926
6
+ metadata.gz: a1707c7fec3e2e20b5ab4ea11898c74f989e9064456704b3521b4e3a9b8ba22d940f403a78cdda70308e2c6f2ba960cd2a597dabfaf485553092443ba5a8be01
7
+ data.tar.gz: fe4464fbecce39117023a0c286ed3b5a0728db8a4b96062d6403b116340fdfc3e4a8b64bbae634fdb22e45afbc0bde67041cd5c0aa18990f9218987239b7fdef
@@ -1,3 +1,3 @@
1
1
  module SuperSerialize
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -222,7 +222,7 @@ module SuperSerialize
222
222
 
223
223
  def trying_to_serialize_a_hash?(value)
224
224
  return false unless value.is_a?(String)
225
- !!(value =~ /^{.+}$/)
225
+ !!(value =~ /\A{.+|.+}\Z/)
226
226
  end
227
227
 
228
228
  def attempt_to_sanitize_hash_syntax(value)
@@ -240,7 +240,8 @@ module SuperSerialize
240
240
 
241
241
  def super_serialized_attr_as_string_or_yaml(attr_name)
242
242
  if read_attribute(attr_name).is_a?(String)
243
- read_attribute(attr_name)
243
+ value = read_attribute(attr_name)
244
+ trying_to_serialize_a_hash?(value) ? value : value.to_yaml
244
245
  else
245
246
  send(attr_name).to_yaml
246
247
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_serialize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Quiñones