xapian_db 1.3 → 1.3.1

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.
Files changed (3) hide show
  1. data/CHANGELOG.md +6 -0
  2. data/lib/type_codec.rb +2 -0
  3. metadata +3 -3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ##1.3.1 (February 25th, 2013)
2
+
3
+ Fixes:
4
+
5
+ - json codec handles nil values gracefully
6
+
1
7
  ##1.3 (February 19th, 2013)
2
8
 
3
9
  Breaking Changes:
data/lib/type_codec.rb CHANGED
@@ -30,6 +30,7 @@ module XapianDb
30
30
  # @param [Object] object an object to encode
31
31
  # @return [String] the json string
32
32
  def self.encode(object)
33
+ return nil if object.nil?
33
34
  begin
34
35
  object.to_json
35
36
  rescue NoMethodError
@@ -41,6 +42,7 @@ module XapianDb
41
42
  # @param [String] json_string a json string representing the object
42
43
  # @return [Hash] a ruby hash
43
44
  def self.decode(json_string)
45
+ return nil if json_string.nil? || json_string == ""
44
46
  begin
45
47
  JSON.parse json_string
46
48
  rescue TypeError
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xapian_db
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.3'
4
+ version: 1.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-19 00:00:00.000000000 Z
12
+ date: 2013-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: daemons
@@ -246,7 +246,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
246
246
  version: '0'
247
247
  segments:
248
248
  - 0
249
- hash: -2176648600874761364
249
+ hash: -2796232478474522609
250
250
  required_rubygems_version: !ruby/object:Gem::Requirement
251
251
  none: false
252
252
  requirements: