atdis 0.3.12 → 0.3.13

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: a03e3373d96203ad81c374988fc292decea13ee9
4
- data.tar.gz: 68ae0b7ac6954cb526912eb400e8cb6772f6a56b
3
+ metadata.gz: 115d598c77fb6437ed05614cadc31664786185e4
4
+ data.tar.gz: 30ac0686681de9748e37171f360d63e72786126d
5
5
  SHA512:
6
- metadata.gz: 9864a651d4fa52b4a7e392669edcdc3a9c49c9426509e3e86a1a23cd6bfb51906e4093ff22ed4fe1c9d20ac9edc385ab0a8bf3342b99dc1a16c62df021d1c13a
7
- data.tar.gz: 4ed21f52f6a36f13905a8924d3b2f48433f8075d8d32ca1de0971418895752b21df7a1c6d82ef7983cbba915e576bdb3fe4cd30785d7a656276bf4862c437868
6
+ metadata.gz: 502e18e86ed22d0fb1b34130902716ba4c8c020cc1ed1bda8ac8b7c91dc539512a8dbf6cfa49cbe6910b85df6a88cdc0909d1b1f0b35eca2f33f257e359952a9
7
+ data.tar.gz: f30ae1357c7c3f9db5188a1703822b759c805fe9d929443a1751395ed58dccad946e083f06bd7419eea4e733af3faff73cdf15ce463c2b4aa12727a46c00c070
@@ -209,7 +209,11 @@ module ATDIS
209
209
  # or the full date with hours, seconds, minutes and timezone. We'll assume that these
210
210
  # are the two variants that are allowed.
211
211
  if value.respond_to?(:match) && value.match(/^\d\d\d\d-\d\d-\d\d(T\d\d:\d\d:\d\d(Z|(\+|-)\d\d:\d\d))?$/)
212
- DateTime.parse(value)
212
+ begin
213
+ DateTime.parse(value)
214
+ rescue ArgumentError
215
+ nil
216
+ end
213
217
  end
214
218
  end
215
219
 
@@ -1,3 +1,3 @@
1
1
  module Atdis
2
- VERSION = "0.3.12"
2
+ VERSION = "0.3.13"
3
3
  end
@@ -116,6 +116,15 @@ describe ATDIS::Models::Info do
116
116
  a.determination_date = nil
117
117
  a.should be_valid
118
118
  end
119
+ it do
120
+ a.determination_date = "2013-01-18"
121
+ a.should be_valid
122
+ end
123
+ it do
124
+ a.determination_date = "2013-18-01"
125
+ a.should_not be_valid
126
+ a.errors.messages.should == {determination_date: [ATDIS::ErrorMessage["is not a valid date", "4.3.1"]]}
127
+ end
119
128
  it do
120
129
  a.determination_date = "18 January 2013"
121
130
  a.should_not be_valid
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atdis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.12
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Landauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-26 00:00:00.000000000 Z
11
+ date: 2015-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler