xapian_db 1.2.4.2 → 1.2.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/CHANGELOG.md +6 -0
  2. data/lib/type_codec.rb +4 -2
  3. metadata +19 -19
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ##1.2.4.3 (May 1st, 2012)
2
+
3
+ Fixes:
4
+
5
+ - handle null values on date and datetime attributes correctly
6
+
1
7
  ##1.2.4.2 (May 1st, 2012)
2
8
 
3
9
  Changes:
data/lib/type_codec.rb CHANGED
@@ -76,7 +76,7 @@ module XapianDb
76
76
  # @param [Date] date a date object to encode
77
77
  # @return [String] the encoded date
78
78
  def self.encode(date)
79
- return '' unless date
79
+ return nil if date.nil?
80
80
  begin
81
81
  date.strftime "%Y%m%d"
82
82
  rescue NoMethodError
@@ -88,6 +88,7 @@ module XapianDb
88
88
  # @param [String] date_as_string a string representing a date
89
89
  # @return [Date] the parsed date
90
90
  def self.decode(date_as_string)
91
+ return nil if date_as_string.nil? || date_as_string.strip == ""
91
92
  begin
92
93
  Date.parse date_as_string
93
94
  rescue ArgumentError
@@ -102,7 +103,7 @@ module XapianDb
102
103
  # @param [DateTime] datetime a datetime object to encode
103
104
  # @return [String] the encoded datetime
104
105
  def self.encode(datetime)
105
- return '' unless datetime
106
+ return nil unless datetime
106
107
  begin
107
108
  datetime.strftime "%Y%m%d %H:%M:%S+%L"
108
109
  rescue NoMethodError
@@ -114,6 +115,7 @@ module XapianDb
114
115
  # @param [String] datetime_as_string a string representing a datetime
115
116
  # @return [DateTime] the parsed datetime
116
117
  def self.decode(datetime_as_string)
118
+ return nil if datetime_as_string.nil? || datetime_as_string.strip == ""
117
119
  begin
118
120
  DateTime.parse datetime_as_string
119
121
  rescue ArgumentError
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.2.4.2
4
+ version: 1.2.4.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-05-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: daemons
16
- requirement: &70167709179460 !ruby/object:Gem::Requirement
16
+ requirement: &70192675098540 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.0.10
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70167709179460
24
+ version_requirements: *70192675098540
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: guard
27
- requirement: &70167709194920 !ruby/object:Gem::Requirement
27
+ requirement: &70192675113960 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70167709194920
35
+ version_requirements: *70192675113960
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70167709193440 !ruby/object:Gem::Requirement
38
+ requirement: &70192675112480 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.3.1
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70167709193440
46
+ version_requirements: *70192675112480
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: simplecov
49
- requirement: &70167709191880 !ruby/object:Gem::Requirement
49
+ requirement: &70192675110920 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.3.7
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70167709191880
57
+ version_requirements: *70192675110920
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: beanstalk-client
60
- requirement: &70167709190660 !ruby/object:Gem::Requirement
60
+ requirement: &70192675109700 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.1.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70167709190660
68
+ version_requirements: *70192675109700
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
- requirement: &70167709201640 !ruby/object:Gem::Requirement
71
+ requirement: &70192675120700 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70167709201640
79
+ version_requirements: *70192675120700
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: progressbar
82
- requirement: &70167709200680 !ruby/object:Gem::Requirement
82
+ requirement: &70192675119720 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70167709200680
90
+ version_requirements: *70192675119720
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: resque
93
- requirement: &70167709209000 !ruby/object:Gem::Requirement
93
+ requirement: &70192675128120 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 1.19.0
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70167709209000
101
+ version_requirements: *70192675128120
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: xapian-ruby
104
- requirement: &70167709206880 !ruby/object:Gem::Requirement
104
+ requirement: &70192675126020 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: 1.2.7.1
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70167709206880
112
+ version_requirements: *70192675126020
113
113
  description: XapianDb is a ruby gem that combines features of nosql databases and
114
114
  fulltext indexing. It is based on Xapian, an efficient and powerful indexing library
115
115
  email: gernot.kogler (at) garaio (dot) com