ar_json_serialize 0.0.1 → 0.0.2

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,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0ec1e50466ff99d7a49ad96f5281cea64117372b
4
- data.tar.gz: 465eef3bfe1260f81b7bbf4ec7ed21539e97f788
5
- SHA512:
6
- metadata.gz: 4e4ef817eb2bbfcfff4e0ffa14f7332beac5ca8c825cffdab367705bab52f2eb1f6498b36777fef01e4ed47afd55a89b7d0652055dd358745e1236c69f90dadb
7
- data.tar.gz: ba05f35f23ae599884bc466c9ca5b5500f363a73a4e1e0ecbd30cfc395165bae4396ce5f3b23363ab3a307276e174de13ab8185e69cc93a59b8a43bb9df87191
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OGJhMjJlN2Q5ODkwZTkzNjZkZjU0MjNiYjM5YTU2MmY1MjRhMTQyMw==
5
+ data.tar.gz: !binary |-
6
+ MmQ1NWZlMzgwNDg2YjVkMjg4M2JjNTM5OGQ0NDQ4MmI4NTgzNTk0MQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NTUxZjIxNTU2YTFlZGI1Mzg5M2I5ZDcxNGMxNzc4ZGYyNDU5NmUxZTVkYWZh
10
+ ZmYzY2YyZjdmYThmYTk1MDNmOTZiN2M4MDYzZGI3ZTg3NThiMWY1M2QxZWE0
11
+ NjU3YjMzZjYzZjIwYzk4ZTRlNjJmN2IyYWM5YjczM2VlZDBkZGI=
12
+ data.tar.gz: !binary |-
13
+ YWI0YmYyNTdkYTM3ZjNhNzg1MTM2Y2Y5MzljYTg5YzZjNzA3YzBlZmQwNDky
14
+ MTI2YWZlNTk2NzY2NWU0MGQ0MDg1MmEwZDcwM2JmMmM1ZTY5MjE3MzZlZDdj
15
+ OTcyMzU1MDRmNDNjMDcxZDg5NjEzODU5OTEzOTRlYmE1YjZmOWQ=
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
- # ArJsonSerialize[![Coverage Status](https://coveralls.io/repos/phenomena/ar_json_serialize/badge.png?branch=master)](https://coveralls.io/r/phenomena/ar_json_serialize?branch=master)[![Build Status](https://travis-ci.org/phenomena/ar_json_serialize.png?branch=master)](https://travis-ci.org/phenomena/ar_json_serialize)
1
+ # ActiveRecord Json Serialize
2
+ [![Coverage Status](https://coveralls.io/repos/phenomena/ar_json_serialize/badge.png?branch=master)](https://coveralls.io/r/phenomena/ar_json_serialize?branch=master)[![Build Status](https://travis-ci.org/phenomena/ar_json_serialize.png?branch=master)](https://travis-ci.org/phenomena/ar_json_serialize)[![Gem Version](https://badge.fury.io/rb/ar_json_serialize.png)](http://badge.fury.io/rb/ar_json_serialize)[![Code Climate](https://codeclimate.com/github/dotpromo/ar_json_serialize.png)](https://codeclimate.com/github/dotpromo/ar_json_serialize)
3
+
2
4
  ActiveRecord JSON serializer
3
5
 
4
6
  ## Installation
@@ -4,17 +4,13 @@ module ArJsonSerialize
4
4
 
5
5
  def load(s)
6
6
  if s.present?
7
- result = ::MultiJson.load(s)
7
+ result = ::MultiJson.load(s) rescue s
8
8
  case result
9
9
  when ::Hash
10
10
  ::Hashie::Mash.new(result)
11
11
  when ::Array
12
12
  result.map do |item|
13
- if item.is_a?(::Hash)
14
- ::Hashie::Mash.new(item)
15
- else
16
- item
17
- end
13
+ item.is_a?(::Hash) ? ::Hashie::Mash.new(item) : item
18
14
  end
19
15
  else
20
16
  result
@@ -27,5 +23,6 @@ module ArJsonSerialize
27
23
  def dump(s)
28
24
  ::MultiJson.dump(s)
29
25
  end
26
+
30
27
  end
31
28
  end
@@ -1,3 +1,3 @@
1
1
  module ArJsonSerialize
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ar_json_serialize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Simonov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-30 00:00:00.000000000 Z
11
+ date: 2013-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -42,7 +42,7 @@ dependencies:
42
42
  name: activerecord
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: 3.2.13
48
48
  - - <
@@ -52,7 +52,7 @@ dependencies:
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - '>='
55
+ - - ! '>='
56
56
  - !ruby/object:Gem::Version
57
57
  version: 3.2.13
58
58
  - - <
@@ -76,14 +76,14 @@ dependencies:
76
76
  name: rake
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - '>='
79
+ - - ! '>='
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - '>='
86
+ - - ! '>='
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  description: ActiveRecord JSON serializer
@@ -119,12 +119,12 @@ require_paths:
119
119
  - lib
120
120
  required_ruby_version: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ! '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  requirements:
127
- - - '>='
127
+ - - ! '>='
128
128
  - !ruby/object:Gem::Version
129
129
  version: '0'
130
130
  requirements: []