edtf 3.0.3 → 3.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/features/step_definitions/edtf_steps.rb +4 -4
- data/lib/edtf/interval.rb +1 -1
- data/lib/edtf/version.rb +1 -1
- data/spec/edtf/interval_spec.rb +20 -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: 4f32f349b2679af06731bea91219f99b81bafa1a
|
4
|
+
data.tar.gz: 2ee298e0884f3d941064fb012e86270012fc6a38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db9901b3555b8ff63b070fbfe82248fe540f8eab4f108a04f7aba6a90d67d15111f59d9df8d3e714aa24e5172224e9090a66b22f87f98c75999a93343da2a202
|
7
|
+
data.tar.gz: 99791a69ce86075d1f4b967231aa62baccc126632bfcc2d8c74a00855e401fbf4e2fee4c8871e3d03e4f29fc0750803eef1efa7ede5488142f5dfbb32dcbb170
|
data/README.md
CHANGED
@@ -30,7 +30,7 @@ overlaps (version 3.x and 4.x are supported).
|
|
30
30
|
|
31
31
|
A variation of EDTF will part of the upcoming ISO 8601-2 standard. EDTF-Ruby
|
32
32
|
does not support this new version of EDTF yet, but if you are curious,
|
33
|
-
[EDTF.js](inukshuk/edtf.js), an ES6 implementation is already available.
|
33
|
+
[EDTF.js](https://github.com/inukshuk/edtf.js), an ES6 implementation is already available.
|
34
34
|
|
35
35
|
Quickstart
|
36
36
|
----------
|
@@ -31,19 +31,19 @@ Then /^the hours should be "([^"]*)"$/ do |hours|
|
|
31
31
|
expect(@date.hour).to eq(hours.to_i)
|
32
32
|
end
|
33
33
|
|
34
|
-
Then /^the year should be "([^"]*)"
|
34
|
+
Then /^the year should be "([^"]*)" UTC$/ do |year|
|
35
35
|
expect(@date.to_time.utc.year).to eq(year.to_i)
|
36
36
|
end
|
37
37
|
|
38
|
-
Then /^the month should be "([^"]*)"
|
38
|
+
Then /^the month should be "([^"]*)" UTC$/ do |month|
|
39
39
|
expect(@date.to_time.utc.month).to eq(month.to_i)
|
40
40
|
end
|
41
41
|
|
42
|
-
Then /^the day should be "([^"]*)"
|
42
|
+
Then /^the day should be "([^"]*)" UTC$/ do |day|
|
43
43
|
expect(@date.to_time.utc.day).to eq(day.to_i)
|
44
44
|
end
|
45
45
|
|
46
|
-
Then /^the hours should be "([^"]*)"
|
46
|
+
Then /^the hours should be "([^"]*)" UTC$/ do |hours|
|
47
47
|
expect(@date.to_time.utc.hour).to eq(hours.to_i)
|
48
48
|
end
|
49
49
|
|
data/lib/edtf/interval.rb
CHANGED
data/lib/edtf/version.rb
CHANGED
data/spec/edtf/interval_spec.rb
CHANGED
@@ -106,6 +106,26 @@ module EDTF
|
|
106
106
|
|
107
107
|
end
|
108
108
|
|
109
|
+
describe 'the interval 2008/unknown' do
|
110
|
+
let(:interval) { Date.edtf('2008/unknown') }
|
111
|
+
|
112
|
+
it { expect(interval).to be_unknown }
|
113
|
+
it { expect(interval).to be_unknown_end }
|
114
|
+
it { expect(interval).not_to be_unknown_start }
|
115
|
+
|
116
|
+
it 'the min date is 2008-01-01' do
|
117
|
+
expect(interval.min.to_s).to eq('2008-01-01')
|
118
|
+
end
|
119
|
+
|
120
|
+
it 'the min date has year precision' do
|
121
|
+
expect(interval.min).to be_year_precision
|
122
|
+
end
|
123
|
+
|
124
|
+
it 'the max date is nil' do
|
125
|
+
expect(interval.max).to be nil
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
109
129
|
describe 'comparisions' do
|
110
130
|
it '2007/2009 should be greater than 2001/2002' do
|
111
131
|
expect(Date.edtf('2007/2009')).to be > Date.edtf('2001/2002')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: edtf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvester Keil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|