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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4eaa12c5a18d89168a79a4440ab57ad31f30f1a6
4
- data.tar.gz: 0d519d883e3fe9b935b93dde20c15377109576a2
3
+ metadata.gz: 4f32f349b2679af06731bea91219f99b81bafa1a
4
+ data.tar.gz: 2ee298e0884f3d941064fb012e86270012fc6a38
5
5
  SHA512:
6
- metadata.gz: 3350c1191ede7bb72951ad845c220e0ab87d30315b1d4677660922b2b5c831d7aa3331f3694b4105f4a7bbc3b0984a24af371af840d0a28764a13dc652e57c8c
7
- data.tar.gz: 8d1c8954f197ed4871217c151b8619a27b247068d470a843a5a74d941f627dc477408fe3fb9377e6fb431768a2697236f3dbdfa84b349f9a263818ae8f0f4ce4
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 "([^"]*)" \(UTC\)$/ do |year|
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 "([^"]*)" \(UTC\)$/ do |month|
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 "([^"]*)" \(UTC\)$/ do |day|
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 "([^"]*)" \(UTC\)$/ do |hours|
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
 
@@ -216,7 +216,7 @@ module EDTF
216
216
  to_a.min(&Proc.new)
217
217
  else
218
218
  case
219
- when unknown_start?, !open? && to < from
219
+ when unknown_start?, !unknown_end? && !open? && to < from
220
220
  nil
221
221
  when from.day_precision?
222
222
  from
@@ -1,3 +1,3 @@
1
1
  module EDTF
2
- VERSION = '3.0.3'.freeze
2
+ VERSION = '3.0.4'.freeze
3
3
  end
@@ -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.3
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-09-22 00:00:00.000000000 Z
11
+ date: 2017-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport