odata 0.6.7 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c8d4272413289a30d35a4b09f817f3d7686c3dc
4
- data.tar.gz: 0d07830dbda9b044c740ec0cd3d879cbe7844276
3
+ metadata.gz: 86fe14dc79c8c23c28ec5ad563b987ef69005dc6
4
+ data.tar.gz: b05f4ae4d66316aac9ac870d8d05ef15afb3a410
5
5
  SHA512:
6
- metadata.gz: 7e3308fd2fdc7ad523dc2b6f64015cee6467d8d00cc26dbf759b23c0aa68b28c918b87846944cb084a2b4bc09368051a1c2e1d24093027b3d0972068b2a97ca4
7
- data.tar.gz: 7177e7a0995e6323cf2e0a929b8a3e9547552f8c8cf01c1e6d94eb5b4b718a3c98598b8dd1bae34518d4ecca2e60904862aa1a6eaccf118e4b63482b198794ba
6
+ metadata.gz: 5901650dc4ac9b3c4da8fa20007654e4afb53b7cfa4054d3b99bb6e43f02446b1a42a973d9ff2df451367ac443b99bd3c2a2131e695e55daa5d4f6ac49257a21
7
+ data.tar.gz: b31c165283c39baa71be5387e321b736b4c25c083ec6e4046b02d74d81e8f422b642a1ec3c712fa2abf7e465631f3ca8e05fa66144743936ae15d13090985dd3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.6.8
4
+
5
+ * Added empty checking when checking for a nil value.
6
+
3
7
  ## 0.6.7
4
8
 
5
9
  * Changed how commit failures are handled to use logging instead of raising an
@@ -5,7 +5,7 @@ module OData
5
5
  # Returns the property value, properly typecast
6
6
  # @return [Integer,nil]
7
7
  def value
8
- if @value.nil? && allows_nil?
8
+ if (@value.nil? || @value.empty?) && allows_nil?
9
9
  nil
10
10
  else
11
11
  @value.to_i
@@ -5,7 +5,7 @@ module OData
5
5
  # Returns the property value, properly typecast
6
6
  # @return [Boolean, nil]
7
7
  def value
8
- if @value.nil? && allows_nil?
8
+ if (@value.nil? || @value.empty?) && allows_nil?
9
9
  nil
10
10
  else
11
11
  (@value == 'true' || @value == '1')
@@ -5,7 +5,7 @@ module OData
5
5
  # Returns the property value, properly typecast
6
6
  # @return [DateTime, nil]
7
7
  def value
8
- if @value.nil? && allows_nil?
8
+ if (@value.nil? || @value.empty?) && allows_nil?
9
9
  nil
10
10
  else
11
11
  begin
@@ -5,7 +5,7 @@ module OData
5
5
  # Returns the property value, properly typecast
6
6
  # @return [DateTime,nil]
7
7
  def value
8
- if @value.nil? && allow_nil?
8
+ if (@value.nil? || @value.empty?) && allow_nil?
9
9
  nil
10
10
  else
11
11
  ::DateTime.strptime(@value, '%Y-%m-%dT%H:%M:%S.%LZ%:z')
@@ -5,7 +5,7 @@ module OData
5
5
  # Returns the property value, properly typecast
6
6
  # @return [BigDecimal,nil]
7
7
  def value
8
- if @value.nil? && allows_nil?
8
+ if (@value.nil? || @value.empty?) && allows_nil?
9
9
  nil
10
10
  else
11
11
  BigDecimal(@value)
@@ -7,7 +7,7 @@ module OData
7
7
  # Returns the property value, properly typecast
8
8
  # @return [Float,nil]
9
9
  def value
10
- if @value.nil? && allows_nil?
10
+ if (@value.nil? || @value.empty?) && allows_nil?
11
11
  nil
12
12
  else
13
13
  @value.to_f
@@ -7,7 +7,7 @@ module OData
7
7
  # Returns the property value, properly typecast
8
8
  # @return [Integer,nil]
9
9
  def value
10
- if @value.nil? && allows_nil?
10
+ if (@value.nil? || @value.empty?) && allows_nil?
11
11
  nil
12
12
  else
13
13
  @value.to_i
@@ -5,7 +5,7 @@ module OData
5
5
  # Returns the property value, properly typecast
6
6
  # @return [String,nil]
7
7
  def value
8
- if @value.nil? && allows_nil?
8
+ if (@value.nil? || @value.empty?) && allows_nil?
9
9
  nil
10
10
  else
11
11
  encode_value(@value)
@@ -5,7 +5,7 @@ module OData
5
5
  # Returns the property value, properly typecast
6
6
  # @return [Time,nil]
7
7
  def value
8
- if @value.nil? && allow_nil?
8
+ if (@value.nil? || @value.empty?) && allow_nil?
9
9
  nil
10
10
  else
11
11
  ::Time.strptime(@value, '%H:%M:%S%:z')
data/lib/odata/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module OData
2
- VERSION = '0.6.7'
2
+ VERSION = '0.6.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: odata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.7
4
+ version: 0.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Thompson