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 +4 -4
- data/lib/atdis/model.rb +5 -1
- data/lib/atdis/version.rb +1 -1
- data/spec/atdis/models/info_spec.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 115d598c77fb6437ed05614cadc31664786185e4
|
4
|
+
data.tar.gz: 30ac0686681de9748e37171f360d63e72786126d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 502e18e86ed22d0fb1b34130902716ba4c8c020cc1ed1bda8ac8b7c91dc539512a8dbf6cfa49cbe6910b85df6a88cdc0909d1b1f0b35eca2f33f257e359952a9
|
7
|
+
data.tar.gz: f30ae1357c7c3f9db5188a1703822b759c805fe9d929443a1751395ed58dccad946e083f06bd7419eea4e733af3faff73cdf15ce463c2b4aa12727a46c00c070
|
data/lib/atdis/model.rb
CHANGED
@@ -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
|
-
|
212
|
+
begin
|
213
|
+
DateTime.parse(value)
|
214
|
+
rescue ArgumentError
|
215
|
+
nil
|
216
|
+
end
|
213
217
|
end
|
214
218
|
end
|
215
219
|
|
data/lib/atdis/version.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2015-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|