edtf 3.3.0 → 4.0.0
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/README.md +143 -117
- data/lib/edtf/date.rb +39 -2
- data/lib/edtf/epoch.rb +3 -1
- data/lib/edtf/interval.rb +40 -15
- data/lib/edtf/parser.rb +33 -33
- data/lib/edtf/parser.y +32 -32
- data/lib/edtf/season.rb +10 -2
- data/lib/edtf/set.rb +15 -1
- data/lib/edtf/uncertainty.rb +7 -8
- data/lib/edtf/version.rb +1 -1
- metadata +26 -57
- data/.github/workflows/ci.yml +0 -44
- data/.gitignore +0 -8
- data/.rspec +0 -3
- data/.simplecov +0 -19
- data/Gemfile +0 -20
- data/Rakefile +0 -41
- data/cucumber.yml +0 -1
- data/edtf.gemspec +0 -29
- data/features/parser/date_times.feature +0 -41
- data/features/parser/dates.feature +0 -89
- data/features/parser/intervals.feature +0 -18
- data/features/parser/precision.feature +0 -14
- data/features/parser/uncertain_or_approximate.feature +0 -129
- data/features/parser/unspecified.feature +0 -34
- data/features/print/level_0_edtf.feature +0 -79
- data/features/print/level_1_edtf.feature +0 -137
- data/features/print/level_2_edtf.feature +0 -39
- data/features/print/uncertain_or_approximate.feature +0 -131
- data/features/step_definitions/edtf_steps.rb +0 -150
- data/features/support/env.rb +0 -13
- data/spec/edtf/date_spec.rb +0 -245
- data/spec/edtf/epoch_spec.rb +0 -88
- data/spec/edtf/interval_spec.rb +0 -308
- data/spec/edtf/parser_spec.rb +0 -427
- data/spec/edtf/season_spec.rb +0 -111
- data/spec/edtf/set_spec.rb +0 -107
- data/spec/edtf/uncertainty_spec.rb +0 -296
- data/spec/spec_helper.rb +0 -15
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: edtf
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sylvester Keil
|
|
@@ -30,6 +30,20 @@ dependencies:
|
|
|
30
30
|
- - "<"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
32
|
version: '9.0'
|
|
33
|
+
- !ruby/object:Gem::Dependency
|
|
34
|
+
name: racc
|
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - "~>"
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '1.7'
|
|
40
|
+
type: :runtime
|
|
41
|
+
prerelease: false
|
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - "~>"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '1.7'
|
|
33
47
|
description: A Ruby implementation of the Extended Date/Time Format (EDTF).
|
|
34
48
|
executables: []
|
|
35
49
|
extensions: []
|
|
@@ -37,28 +51,8 @@ extra_rdoc_files:
|
|
|
37
51
|
- LICENSE
|
|
38
52
|
- README.md
|
|
39
53
|
files:
|
|
40
|
-
- ".github/workflows/ci.yml"
|
|
41
|
-
- ".gitignore"
|
|
42
|
-
- ".rspec"
|
|
43
|
-
- ".simplecov"
|
|
44
|
-
- Gemfile
|
|
45
54
|
- LICENSE
|
|
46
55
|
- README.md
|
|
47
|
-
- Rakefile
|
|
48
|
-
- cucumber.yml
|
|
49
|
-
- edtf.gemspec
|
|
50
|
-
- features/parser/date_times.feature
|
|
51
|
-
- features/parser/dates.feature
|
|
52
|
-
- features/parser/intervals.feature
|
|
53
|
-
- features/parser/precision.feature
|
|
54
|
-
- features/parser/uncertain_or_approximate.feature
|
|
55
|
-
- features/parser/unspecified.feature
|
|
56
|
-
- features/print/level_0_edtf.feature
|
|
57
|
-
- features/print/level_1_edtf.feature
|
|
58
|
-
- features/print/level_2_edtf.feature
|
|
59
|
-
- features/print/uncertain_or_approximate.feature
|
|
60
|
-
- features/step_definitions/edtf_steps.rb
|
|
61
|
-
- features/support/env.rb
|
|
62
56
|
- lib/edtf.rb
|
|
63
57
|
- lib/edtf/compatibility.rb
|
|
64
58
|
- lib/edtf/date.rb
|
|
@@ -73,60 +67,35 @@ files:
|
|
|
73
67
|
- lib/edtf/uncertainty.rb
|
|
74
68
|
- lib/edtf/unknown.rb
|
|
75
69
|
- lib/edtf/version.rb
|
|
76
|
-
|
|
77
|
-
- spec/edtf/epoch_spec.rb
|
|
78
|
-
- spec/edtf/interval_spec.rb
|
|
79
|
-
- spec/edtf/parser_spec.rb
|
|
80
|
-
- spec/edtf/season_spec.rb
|
|
81
|
-
- spec/edtf/set_spec.rb
|
|
82
|
-
- spec/edtf/uncertainty_spec.rb
|
|
83
|
-
- spec/spec_helper.rb
|
|
84
|
-
homepage: http://github.com/inukshuk/edtf-ruby
|
|
70
|
+
homepage: https://github.com/inukshuk/edtf-ruby
|
|
85
71
|
licenses:
|
|
86
72
|
- BSD-2-Clause-Views
|
|
87
|
-
metadata:
|
|
73
|
+
metadata:
|
|
74
|
+
source_code_uri: https://github.com/inukshuk/edtf-ruby
|
|
75
|
+
bug_tracker_uri: https://github.com/inukshuk/edtf-ruby/issues
|
|
76
|
+
rubygems_mfa_required: 'true'
|
|
88
77
|
rdoc_options:
|
|
89
78
|
- "--line-numbers"
|
|
90
|
-
- "--inline-source"
|
|
91
79
|
- "--title"
|
|
92
|
-
-
|
|
80
|
+
- EDTF-Ruby
|
|
93
81
|
- "--main"
|
|
94
82
|
- README.md
|
|
95
|
-
- "--
|
|
83
|
+
- "--exclude"
|
|
84
|
+
- lib/edtf/parser.rb
|
|
96
85
|
require_paths:
|
|
97
86
|
- lib
|
|
98
87
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
88
|
requirements:
|
|
100
89
|
- - ">="
|
|
101
90
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: '
|
|
91
|
+
version: '3.3'
|
|
103
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
93
|
requirements:
|
|
105
94
|
- - ">="
|
|
106
95
|
- !ruby/object:Gem::Version
|
|
107
96
|
version: '0'
|
|
108
97
|
requirements: []
|
|
109
|
-
rubygems_version: 4.0.
|
|
98
|
+
rubygems_version: 4.0.22
|
|
110
99
|
specification_version: 4
|
|
111
100
|
summary: Extended Date/Time Format for Ruby.
|
|
112
|
-
test_files:
|
|
113
|
-
- features/parser/date_times.feature
|
|
114
|
-
- features/parser/dates.feature
|
|
115
|
-
- features/parser/intervals.feature
|
|
116
|
-
- features/parser/precision.feature
|
|
117
|
-
- features/parser/uncertain_or_approximate.feature
|
|
118
|
-
- features/parser/unspecified.feature
|
|
119
|
-
- features/print/level_0_edtf.feature
|
|
120
|
-
- features/print/level_1_edtf.feature
|
|
121
|
-
- features/print/level_2_edtf.feature
|
|
122
|
-
- features/print/uncertain_or_approximate.feature
|
|
123
|
-
- features/step_definitions/edtf_steps.rb
|
|
124
|
-
- features/support/env.rb
|
|
125
|
-
- spec/edtf/date_spec.rb
|
|
126
|
-
- spec/edtf/epoch_spec.rb
|
|
127
|
-
- spec/edtf/interval_spec.rb
|
|
128
|
-
- spec/edtf/parser_spec.rb
|
|
129
|
-
- spec/edtf/season_spec.rb
|
|
130
|
-
- spec/edtf/set_spec.rb
|
|
131
|
-
- spec/edtf/uncertainty_spec.rb
|
|
132
|
-
- spec/spec_helper.rb
|
|
101
|
+
test_files: []
|
data/.github/workflows/ci.yml
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
name: ci
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [ main ]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [ main ]
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
build:
|
|
11
|
-
environment: CI
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
|
|
14
|
-
strategy:
|
|
15
|
-
matrix:
|
|
16
|
-
coverage:
|
|
17
|
-
- false
|
|
18
|
-
ruby-version:
|
|
19
|
-
- '3.3'
|
|
20
|
-
- '3.2'
|
|
21
|
-
- 'jruby'
|
|
22
|
-
include:
|
|
23
|
-
- ruby-version: '4.0'
|
|
24
|
-
coverage: true
|
|
25
|
-
|
|
26
|
-
steps:
|
|
27
|
-
- name: Git checkout
|
|
28
|
-
uses: actions/checkout@v7
|
|
29
|
-
|
|
30
|
-
- name: Setup Ruby
|
|
31
|
-
uses: ruby/setup-ruby@v1
|
|
32
|
-
with:
|
|
33
|
-
ruby-version: ${{ matrix.ruby-version }}
|
|
34
|
-
bundler-cache: true
|
|
35
|
-
|
|
36
|
-
- name: Run tests
|
|
37
|
-
run: bundle exec rake
|
|
38
|
-
|
|
39
|
-
- name: Upload coverage results
|
|
40
|
-
if: matrix.coverage
|
|
41
|
-
continue-on-error: true
|
|
42
|
-
uses: coverallsapp/github-action@v2
|
|
43
|
-
with:
|
|
44
|
-
github-token: ${{ github.token }}
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.simplecov
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
require 'simplecov-lcov'
|
|
2
|
-
|
|
3
|
-
SimpleCov::Formatter::LcovFormatter.config do |c|
|
|
4
|
-
c.output_directory = 'coverage'
|
|
5
|
-
c.lcov_file_name = 'lcov.info'
|
|
6
|
-
c.report_with_single_file = true
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
|
10
|
-
SimpleCov::Formatter::HTMLFormatter,
|
|
11
|
-
SimpleCov::Formatter::LcovFormatter
|
|
12
|
-
])
|
|
13
|
-
|
|
14
|
-
SimpleCov.start do
|
|
15
|
-
add_filter 'spec/'
|
|
16
|
-
add_filter 'features/'
|
|
17
|
-
|
|
18
|
-
enable_coverage :branch
|
|
19
|
-
end
|
data/Gemfile
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
gemspec
|
|
3
|
-
|
|
4
|
-
group :coverage do
|
|
5
|
-
platforms :mri do
|
|
6
|
-
gem 'simplecov'
|
|
7
|
-
gem 'simplecov-lcov'
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
group :debug, optional: true do
|
|
12
|
-
gem 'debug', '>= 1.0.0', require: false
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
group :development do
|
|
16
|
-
gem 'rake'
|
|
17
|
-
gem 'racc'
|
|
18
|
-
gem 'cucumber'
|
|
19
|
-
gem 'rspec'
|
|
20
|
-
end
|
data/Rakefile
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
require 'bundler/gem_tasks'
|
|
2
|
-
require 'rake/clean'
|
|
3
|
-
|
|
4
|
-
$:.unshift(File.join(File.dirname(__FILE__), './lib'))
|
|
5
|
-
require 'edtf/version'
|
|
6
|
-
|
|
7
|
-
task :default => [:spec, :cucumber]
|
|
8
|
-
|
|
9
|
-
desc 'Run an IRB session with EDTF loaded'
|
|
10
|
-
task :console, [:script] do |t,args|
|
|
11
|
-
ARGV.clear
|
|
12
|
-
|
|
13
|
-
require 'irb'
|
|
14
|
-
require 'edtf'
|
|
15
|
-
|
|
16
|
-
IRB.conf[:SCRIPT] = args.script
|
|
17
|
-
IRB.start
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
desc 'Generates the parser'
|
|
21
|
-
task :racc do
|
|
22
|
-
sh 'bundle exec racc -o lib/edtf/parser.rb lib/edtf/parser.y'
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
desc 'Generates the parser with debug information'
|
|
26
|
-
task :racc_debug do
|
|
27
|
-
sh 'bundle exec racc -v -t -o lib/edtf/parser.rb lib/edtf/parser.y'
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
require 'rspec/core'
|
|
31
|
-
require 'rspec/core/rake_task'
|
|
32
|
-
RSpec::Core::RakeTask.new(:spec) do |spec|
|
|
33
|
-
spec.pattern = FileList['spec/**/*_spec.rb']
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
require 'cucumber/rake/task'
|
|
37
|
-
Cucumber::Rake::Task.new(:cucumber)
|
|
38
|
-
|
|
39
|
-
CLEAN.include('lib/edtf/parser.rb')
|
|
40
|
-
CLEAN.include('lib/edtf/parser.output')
|
|
41
|
-
CLOBBER.include('pkg')
|
data/cucumber.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
default: --format progress --require features --color --publish-quiet
|
data/edtf.gemspec
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
|
-
lib = File.expand_path('../lib/', __FILE__)
|
|
3
|
-
$:.unshift lib unless $:.include?(lib)
|
|
4
|
-
|
|
5
|
-
require 'edtf/version'
|
|
6
|
-
|
|
7
|
-
Gem::Specification.new do |s|
|
|
8
|
-
s.name = 'edtf'
|
|
9
|
-
s.version = EDTF::VERSION.dup
|
|
10
|
-
s.platform = Gem::Platform::RUBY
|
|
11
|
-
s.authors = ['Sylvester Keil', 'Ilja Srna']
|
|
12
|
-
s.homepage = 'http://github.com/inukshuk/edtf-ruby'
|
|
13
|
-
s.summary = 'Extended Date/Time Format for Ruby.'
|
|
14
|
-
s.description = 'A Ruby implementation of the Extended Date/Time Format (EDTF).'
|
|
15
|
-
s.license = 'BSD-2-Clause-Views'
|
|
16
|
-
|
|
17
|
-
s.add_runtime_dependency('activesupport', '>= 3.0', '< 9.0')
|
|
18
|
-
|
|
19
|
-
s.files = `git ls-files`.split("\n") << 'lib/edtf/parser.rb'
|
|
20
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
21
|
-
s.executables = []
|
|
22
|
-
s.require_path = 'lib'
|
|
23
|
-
|
|
24
|
-
s.rdoc_options = %w{--line-numbers --inline-source --title "EDTF-Ruby" --main README.md --webcvs=http://github.com/inukshuk/edtf-ruby/tree/master/}
|
|
25
|
-
s.extra_rdoc_files = %w{README.md LICENSE}
|
|
26
|
-
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
# vim: syntax=ruby
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
Feature: EDTF parses date/time strings
|
|
2
|
-
|
|
3
|
-
As a user of edtf-ruby
|
|
4
|
-
I want to parse date/time strings formatted in EDTF
|
|
5
|
-
|
|
6
|
-
Scenario Outline: EDTF parses a date/time string
|
|
7
|
-
When I parse the string "<string>"
|
|
8
|
-
Then the year should be "<year>"
|
|
9
|
-
And the month should be "<month>"
|
|
10
|
-
And the day should be "<day>"
|
|
11
|
-
And the hours should be "<hours>"
|
|
12
|
-
And the minutes should be "<minutes>"
|
|
13
|
-
And the seconds should be "<seconds>"
|
|
14
|
-
|
|
15
|
-
@002 @level0
|
|
16
|
-
Scenarios: simple dates
|
|
17
|
-
| string | year | month | day | hours | minutes | seconds |
|
|
18
|
-
| 2001-02-03T09:30:01 | 2001 | 2 | 3 | 9 | 30 | 1 |
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
Scenario Outline: EDTF parses a date/time string with timezone indicator
|
|
22
|
-
When I parse the string "<string>"
|
|
23
|
-
Then the year should be "<year>" (UTC)
|
|
24
|
-
And the month should be "<month>" (UTC)
|
|
25
|
-
And the day should be "<day>" (UTC)
|
|
26
|
-
And the hours should be "<hours>" (UTC)
|
|
27
|
-
And the minutes should be "<minutes>"
|
|
28
|
-
And the seconds should be "<seconds>"
|
|
29
|
-
|
|
30
|
-
@002 @level0
|
|
31
|
-
Scenarios: date/times with timezone
|
|
32
|
-
| string | year | month | day | hours | minutes | seconds |
|
|
33
|
-
| 2004-01-01T10:10:10Z | 2004 | 1 | 1 | 10 | 10 | 10 |
|
|
34
|
-
| 2004-01-01T10:10:10+05:00 | 2004 | 1 | 1 | 5 | 10 | 10 |
|
|
35
|
-
| 2004-01-01T02:10:10+05:00 | 2003 | 12 | 31 | 21 | 10 | 10 |
|
|
36
|
-
|
|
37
|
-
# Scenarios: fractions
|
|
38
|
-
# | string | year | month | day | hours | minutes | seconds |
|
|
39
|
-
# | 2004-01-01T10 | 2004 | 1 | 1 | 10 | 0 | 0 |
|
|
40
|
-
# | 2004-01-01T10:10:10+05:00 | 2004 | 1 | 1 | 5 | 10 | 10 |
|
|
41
|
-
# | 2004-01-01T02:10:10+05:00 | 2003 | 12 | 31 | 21 | 10 | 10 |
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
Feature: EDTF parser parses date strings
|
|
2
|
-
|
|
3
|
-
In order to use dates in EDTF
|
|
4
|
-
As a user of edtf-ruby
|
|
5
|
-
I want to parse date strings formatted in EDTF
|
|
6
|
-
|
|
7
|
-
Scenario Outline: EDTF parses a date string
|
|
8
|
-
When I parse the string "<string>"
|
|
9
|
-
Then the year should be "<year>"
|
|
10
|
-
And the month should be "<month>"
|
|
11
|
-
And the day should be "<day>"
|
|
12
|
-
|
|
13
|
-
@001 @level0
|
|
14
|
-
Scenarios: simple dates
|
|
15
|
-
| string | year | month | day |
|
|
16
|
-
| 2001-02-03 | 2001 | 2 | 3 |
|
|
17
|
-
| 2008-12 | 2008 | 12 | 1 |
|
|
18
|
-
| 2008 | 2008 | 1 | 1 |
|
|
19
|
-
| -0999 | -999 | 1 | 1 |
|
|
20
|
-
| 0000 | 0 | 1 | 1 |
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Scenario Outline: EDTF parses uncertain date strings
|
|
24
|
-
When I parse the string "<string>"
|
|
25
|
-
Then the year should be "<year>"
|
|
26
|
-
And the year should be uncertain? "<uncertain-year>"
|
|
27
|
-
And the month should be "<month>"
|
|
28
|
-
And the month should be uncertain? "<uncertain-month>"
|
|
29
|
-
And the day should be "<day>"
|
|
30
|
-
And the day should be uncertain? "<uncertain-day>"
|
|
31
|
-
|
|
32
|
-
@101 @level1
|
|
33
|
-
Scenarios: uncertain date examples from the specification
|
|
34
|
-
| string | year | uncertain-year | month | uncertain-month | day | uncertain-day |
|
|
35
|
-
| 1992? | 1992 | yes | 1 | no | 1 | no |
|
|
36
|
-
| 1984? | 1984 | yes | 1 | no | 1 | no |
|
|
37
|
-
| 2004-06? | 2004 | yes | 6 | yes | 1 | no |
|
|
38
|
-
| 2004-06-11? | 2004 | yes | 6 | yes | 11 | yes |
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
Scenario Outline: EDTF parses uncertain or approximate date strings
|
|
42
|
-
When I parse the string "<string>"
|
|
43
|
-
Then the year should be "<year>"
|
|
44
|
-
And the month should be "<month>"
|
|
45
|
-
And the day should be "<day>"
|
|
46
|
-
And the date should be uncertain? "<uncertain>"
|
|
47
|
-
And the date should be approximate? "<approximate>"
|
|
48
|
-
|
|
49
|
-
@101 @level1
|
|
50
|
-
Scenarios: uncertain date examples from the specification
|
|
51
|
-
| string | year | month | day | uncertain | approximate |
|
|
52
|
-
| 1984~ | 1984 | 1 | 1 | no | yes |
|
|
53
|
-
| 1984?~ | 1984 | 1 | 1 | yes | yes |
|
|
54
|
-
|
|
55
|
-
Scenario Outline: EDTF parses uncertain or approximate dates
|
|
56
|
-
When I parse the string "<string>"
|
|
57
|
-
And the year should be uncertain? "<?-year>"
|
|
58
|
-
And the month should be uncertain? "<?-month>"
|
|
59
|
-
And the day should be uncertain? "<?-day>"
|
|
60
|
-
And the year should be approximate? "<~-year>"
|
|
61
|
-
And the month should be approximate? "<~-month>"
|
|
62
|
-
And the day should be approximate? "<~-day>"
|
|
63
|
-
|
|
64
|
-
@201 @level2
|
|
65
|
-
Scenarios: uncertain date examples from the specification
|
|
66
|
-
| string | ~-year | ?-year | ~-month | ?-month | ~-day | ?-day |
|
|
67
|
-
| 2004?-06-11 | no | yes | no | no | no | no |
|
|
68
|
-
| 2004-06~-11 | yes | no | yes | no | no | no |
|
|
69
|
-
| 2004-(06)?-11 | no | no | no | yes | no | no |
|
|
70
|
-
| 2004-06-(11)~ | no | no | no | no | yes | no |
|
|
71
|
-
| 2004-(06)?~ | no | no | yes | yes | no | no |
|
|
72
|
-
| 2004-(06-11)? | no | no | no | yes | no | yes |
|
|
73
|
-
| 2004?-06-(11)~ | no | yes | no | no | yes | no |
|
|
74
|
-
| (2004-(06)~)? | no | yes | yes | yes | no | no |
|
|
75
|
-
| 2004-06-(01)~ | no | no | no | no | yes | no |
|
|
76
|
-
| (2004-(06-01)~)? | no | yes | yes | yes | yes | yes |
|
|
77
|
-
| (2004-(06)?-01)~ | yes | no | yes | yes | yes | no |
|
|
78
|
-
| 2004-06?-(01)~ | no | yes | no | yes | yes | no |
|
|
79
|
-
| 2004~-(06)?-01~ | yes | no | no | yes | yes | no |
|
|
80
|
-
| 2004~-(06-(01)~)? | yes | no | no | yes | yes | yes |
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
Scenario: Invalid dates
|
|
84
|
-
When I parse the following strings an error should be raised:
|
|
85
|
-
| xyz |
|
|
86
|
-
| x2009 |
|
|
87
|
-
| 2004-04-(1)?1 |
|
|
88
|
-
|
|
89
|
-
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
Feature: EDTF parses ISO 8601 interval strings
|
|
2
|
-
As a user of edtf-ruby
|
|
3
|
-
I want to parse ISO 8601 interval strings
|
|
4
|
-
|
|
5
|
-
Scenario Outline: parse intervals
|
|
6
|
-
When I parse the string "<string>"
|
|
7
|
-
Then the interval should cover the date "<date>"
|
|
8
|
-
|
|
9
|
-
@004 @level0
|
|
10
|
-
Scenarios: specification intervals
|
|
11
|
-
| string | date |
|
|
12
|
-
| 1964/2008 | 1964-01-01 |
|
|
13
|
-
| 2004-06/2006-08 | 2006-08-31 |
|
|
14
|
-
| 2004-01-01/2004-01-02 | 2004-01-01 |
|
|
15
|
-
| 2004-02-01/2005-02-08 | 2005-02-08 |
|
|
16
|
-
| 2004-02-01/2005-02 | 2004-12-01 |
|
|
17
|
-
| 2004-02-01/2005 | 2005-12-31 |
|
|
18
|
-
| 2005/2006-02 | 2005-01-01 |
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
Feature: Parse masked precision strings
|
|
2
|
-
|
|
3
|
-
As a user of edtf-ruby
|
|
4
|
-
I want to parse masked precision strings
|
|
5
|
-
|
|
6
|
-
Scenario Outline: Masked precision strings
|
|
7
|
-
When I parse the string "<string>"
|
|
8
|
-
Then the duration should range from "<start>" to "<end>"
|
|
9
|
-
|
|
10
|
-
@level2 @2041
|
|
11
|
-
Scenarios: decades and centuries
|
|
12
|
-
| string | start | end |
|
|
13
|
-
| 196x | 1960 | 1969 |
|
|
14
|
-
| 19xx | 1900 | 1999 |
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
Feature: Parse partial uncertain or approximate dates
|
|
2
|
-
As a Ruby programmer
|
|
3
|
-
I want to convert Date/Time objects to EDTF strings
|
|
4
|
-
|
|
5
|
-
@201 @level2
|
|
6
|
-
Scenario Outline: Prints uncertain or approximate dates
|
|
7
|
-
When I parse the string "<string>"
|
|
8
|
-
Then the year should be uncertain? "<?-year>"
|
|
9
|
-
And the month should be uncertain? "<?-month>"
|
|
10
|
-
And the day should be uncertain? "<?-day>"
|
|
11
|
-
And the year should be approximate? "<~-year>"
|
|
12
|
-
And the month should be approximate? "<~-month>"
|
|
13
|
-
And the day should be approximate? "<~-day>"
|
|
14
|
-
|
|
15
|
-
Scenarios: Uncertain or approximate dates, day precision
|
|
16
|
-
| date | precision | string | ?-year | ?-month | ?-day | ~-year | ~-month | ~-day |
|
|
17
|
-
| 2004-06-01 | day | 2004-06-01?~ | yes | yes | yes | yes | yes | yes |
|
|
18
|
-
| 2004-06-01 | day | 2004-06~-01? | yes | yes | yes | yes | yes | no |
|
|
19
|
-
| 2004-06-01 | day | (2004~-06-(01)~)? | yes | yes | yes | yes | no | yes |
|
|
20
|
-
| 2004-06-01 | day | 2004~-06?-(01)?~ | yes | yes | yes | yes | no | yes |
|
|
21
|
-
| 2004-06-01 | day | 2004~-06-01? | yes | yes | yes | yes | no | no |
|
|
22
|
-
| 2004-06-01 | day | (2004-(06-01)~)? | yes | yes | yes | no | yes | yes |
|
|
23
|
-
| 2004-06-01 | day | 2004?-(06-01)?~ | yes | yes | yes | no | yes | yes |
|
|
24
|
-
| 2004-06-01 | day | (2004-(06)~-01)? | yes | yes | yes | no | yes | no |
|
|
25
|
-
| 2004-06-01 | day | 2004?-(06)?~-01? | yes | yes | yes | no | yes | no |
|
|
26
|
-
| 2004-06-01 | day | (2004-06-(01)~)? | yes | yes | yes | no | no | yes |
|
|
27
|
-
| 2004-06-01 | day | 2004-06?-(01)?~ | yes | yes | yes | no | no | yes |
|
|
28
|
-
| 2004-06-01 | day | 2004-06-01? | yes | yes | yes | no | no | no |
|
|
29
|
-
| 2004-06-01 | day | 2004-06?-01~ | yes | yes | no | yes | yes | yes |
|
|
30
|
-
| 2004-06-01 | day | 2004-06?~-01 | yes | yes | no | yes | yes | no |
|
|
31
|
-
| 2004-06-01 | day | 2004~-06?-(01)~ | yes | yes | no | yes | no | yes |
|
|
32
|
-
| 2004-06-01 | day | 2004~-06?-01 | yes | yes | no | yes | no | no |
|
|
33
|
-
# | 2004-06-01 | day | 2004-(06?-01)~ | yes | yes | no | no | yes | yes | is this correct?
|
|
34
|
-
# | 2004-06-01 | day | 2004?-((06)?-01)~ | yes | yes | no | no | yes | yes |
|
|
35
|
-
| 2004-06-01 | day | 2004?-(06)?~-01~ | yes | yes | no | no | yes | yes |
|
|
36
|
-
# | 2004-06-01 | day | (2004-(06)~)?-01 | yes | yes | no | no | yes | no |
|
|
37
|
-
| 2004-06-01 | day | 2004?-(06)?~-01 | yes | yes | no | no | yes | no |
|
|
38
|
-
| 2004-06-01 | day | 2004-06?-(01)~ | yes | yes | no | no | no | yes |
|
|
39
|
-
| 2004-06-01 | day | 2004-06?-01 | yes | yes | no | no | no | no |
|
|
40
|
-
| 2004-06-01 | day | (2004?-06-(01)?)~ | yes | no | yes | yes | yes | yes |
|
|
41
|
-
| 2004-06-01 | day | 2004?-06~-(01)?~ | yes | no | yes | yes | yes | yes |
|
|
42
|
-
| 2004-06-01 | day | 2004?-06~-(01)? | yes | no | yes | yes | yes | no |
|
|
43
|
-
| 2004-06-01 | day | 2004?~-06-(01)?~ | yes | no | yes | yes | no | yes |
|
|
44
|
-
| 2004-06-01 | day | 2004?~-06-(01)? | yes | no | yes | yes | no | no |
|
|
45
|
-
| 2004-06-01 | day | 2004?-(06-(01)?)~ | yes | no | yes | no | yes | yes |
|
|
46
|
-
| 2004-06-01 | day | 2004?-(06)~-01?~ | yes | no | yes | no | yes | yes |
|
|
47
|
-
| 2004-06-01 | day | 2004?-(06)~-01? | yes | no | yes | no | yes | no |
|
|
48
|
-
| 2004-06-01 | day | 2004?-06-(01)?~ | yes | no | yes | no | no | yes |
|
|
49
|
-
| 2004-06-01 | day | 2004?-06-(01)? | yes | no | yes | no | no | no |
|
|
50
|
-
| 2004-06-01 | day | 2004?-06-01~ | yes | no | no | yes | yes | yes |
|
|
51
|
-
| 2004-06-01 | day | 2004?-06~-01 | yes | no | no | yes | yes | no |
|
|
52
|
-
| 2004-06-01 | day | 2004?~-06-(01)~ | yes | no | no | yes | no | yes |
|
|
53
|
-
| 2004-06-01 | day | 2004?~-06-01 | yes | no | no | yes | no | no |
|
|
54
|
-
| 2004-06-01 | day | 2004?-(06-01)~ | yes | no | no | no | yes | yes |
|
|
55
|
-
| 2004-06-01 | day | 2004?-(06)~-01 | yes | no | no | no | yes | no |
|
|
56
|
-
| 2004-06-01 | day | 2004?-06-(01)~ | yes | no | no | no | no | yes |
|
|
57
|
-
| 2004-06-01 | day | 2004?-06-01 | yes | no | no | no | no | no |
|
|
58
|
-
| 2004-06-01 | day | (2004-(06-01)?)~ | no | yes | yes | yes | yes | yes |
|
|
59
|
-
| 2004-06-01 | day | 2004~-(06-01)?~ | no | yes | yes | yes | yes | yes |
|
|
60
|
-
# | 2004-06-01 | day | 2004-(06~-01)? | no | yes | yes | yes | yes | no | is this correct?
|
|
61
|
-
# | 2004-06-01 | day | 2004~-((06)~-01)? | no | yes | yes | yes | yes | no |
|
|
62
|
-
| 2004-06-01 | day | 2004~-(06)?~-01? | no | yes | yes | yes | yes | no |
|
|
63
|
-
| 2004-06-01 | day | 2004~-(06-(01)~)? | no | yes | yes | yes | no | yes |
|
|
64
|
-
| 2004-06-01 | day | 2004~-(06)?-01?~ | no | yes | yes | yes | no | yes |
|
|
65
|
-
| 2004-06-01 | day | 2004~-(06-01)? | no | yes | yes | yes | no | no |
|
|
66
|
-
| 2004-06-01 | day | 2004-(06-01)?~ | no | yes | yes | no | yes | yes |
|
|
67
|
-
# | 2004-06-01 | day | 2004-((06)~-01)? | no | yes | yes | no | yes | no |
|
|
68
|
-
| 2004-06-01 | day | 2004-(06)?~-01? | no | yes | yes | no | yes | no |
|
|
69
|
-
| 2004-06-01 | day | 2004-(06-(01)~)? | no | yes | yes | no | no | yes |
|
|
70
|
-
| 2004-06-01 | day | 2004-(06)?-01?~ | no | yes | yes | no | no | yes |
|
|
71
|
-
| 2004-06-01 | day | 2004-(06-01)? | no | yes | yes | no | no | no |
|
|
72
|
-
| 2004-06-01 | day | (2004-(06)?-01)~ | no | yes | no | yes | yes | yes |
|
|
73
|
-
| 2004-06-01 | day | 2004~-(06)?~-01~ | no | yes | no | yes | yes | yes |
|
|
74
|
-
# | 2004-06-01 | day | (2004-(06)?)~-01 | no | yes | no | yes | yes | no |
|
|
75
|
-
| 2004-06-01 | day | 2004~-(06)?~-01 | no | yes | no | yes | yes | no |
|
|
76
|
-
| 2004-06-01 | day | 2004~-(06)?-01~ | no | yes | no | yes | no | yes |
|
|
77
|
-
| 2004-06-01 | day | 2004~-(06)?-01 | no | yes | no | yes | no | no |
|
|
78
|
-
# | 2004-06-01 | day | 2004-((06)?-01)~ | no | yes | no | no | yes | yes |
|
|
79
|
-
| 2004-06-01 | day | 2004-(06)?~-01~ | no | yes | no | no | yes | yes |
|
|
80
|
-
| 2004-06-01 | day | 2004-(06)?~-01 | no | yes | no | no | yes | no |
|
|
81
|
-
| 2004-06-01 | day | 2004-(06)?-01~ | no | yes | no | no | no | yes |
|
|
82
|
-
| 2004-06-01 | day | 2004-(06)?-01 | no | yes | no | no | no | no |
|
|
83
|
-
| 2004-06-01 | day | (2004-06-(01)?)~ | no | no | yes | yes | yes | yes |
|
|
84
|
-
| 2004-06-01 | day | 2004-06~-(01)?~ | no | no | yes | yes | yes | yes |
|
|
85
|
-
| 2004-06-01 | day | 2004-06~-(01)? | no | no | yes | yes | yes | no |
|
|
86
|
-
| 2004-06-01 | day | 2004~-06-(01)?~ | no | no | yes | yes | no | yes |
|
|
87
|
-
| 2004-06-01 | day | 2004~-06-(01)? | no | no | yes | yes | no | no |
|
|
88
|
-
| 2004-06-01 | day | 2004-(06-(01)?)~ | no | no | yes | no | yes | yes |
|
|
89
|
-
| 2004-06-01 | day | 2004-(06)~-01?~ | no | no | yes | no | yes | yes |
|
|
90
|
-
| 2004-06-01 | day | 2004-(06)~-01? | no | no | yes | no | yes | no |
|
|
91
|
-
| 2004-06-01 | day | 2004-06-(01)?~ | no | no | yes | no | no | yes |
|
|
92
|
-
| 2004-06-01 | day | 2004-06-(01)? | no | no | yes | no | no | no |
|
|
93
|
-
| 2004-06-01 | day | 2004-06-01~ | no | no | no | yes | yes | yes |
|
|
94
|
-
| 2004-06-01 | day | 2004-06~-01 | no | no | no | yes | yes | no |
|
|
95
|
-
| 2004-06-01 | day | 2004~-06-(01)~ | no | no | no | yes | no | yes |
|
|
96
|
-
| 2004-06-01 | day | 2004~-06-01 | no | no | no | yes | no | no |
|
|
97
|
-
| 2004-06-01 | day | 2004-(06-01)~ | no | no | no | no | yes | yes |
|
|
98
|
-
| 2004-06-01 | day | 2004-(06)~-01 | no | no | no | no | yes | no |
|
|
99
|
-
| 2004-06-01 | day | 2004-06-(01)~ | no | no | no | no | no | yes |
|
|
100
|
-
| 2004-06-01 | day | 2004-06-01 | no | no | no | no | no | no |
|
|
101
|
-
|
|
102
|
-
Scenarios: Uncertain or approximate dates, month precision
|
|
103
|
-
| date | precision | string | ?-year | ?-month | ?-day | ~-year | ~-month | ~-day |
|
|
104
|
-
| 2004-06-01 | month | 2004-06?~ | yes | yes | no | yes | yes | no |
|
|
105
|
-
| 2004-06-01 | month | 2004~-06? | yes | yes | no | yes | no | no |
|
|
106
|
-
| 2004-06-01 | month | (2004-(06)~)? | yes | yes | no | no | yes | no |
|
|
107
|
-
| 2004-06-01 | month | 2004?-(06)?~ | yes | yes | no | no | yes | no |
|
|
108
|
-
| 2004-06-01 | month | 2004-06? | yes | yes | no | no | no | no |
|
|
109
|
-
| 2004-06-01 | month | 2004?-06~ | yes | no | no | yes | yes | no |
|
|
110
|
-
| 2004-06-01 | month | 2004?~-06 | yes | no | no | yes | no | no |
|
|
111
|
-
| 2004-06-01 | month | 2004?-(06)~ | yes | no | no | no | yes | no |
|
|
112
|
-
| 2004-06-01 | month | 2004?-06 | yes | no | no | no | no | no |
|
|
113
|
-
| 2004-06-01 | month | (2004-(06)?)~ | no | yes | no | yes | yes | no |
|
|
114
|
-
| 2004-06-01 | month | 2004~-(06)?~ | no | yes | no | yes | yes | no |
|
|
115
|
-
| 2004-06-01 | month | 2004~-(06)? | no | yes | no | yes | no | no |
|
|
116
|
-
| 2004-06-01 | month | 2004-(06)?~ | no | yes | no | no | yes | no |
|
|
117
|
-
| 2004-06-01 | month | 2004-(06)? | no | yes | no | no | no | no |
|
|
118
|
-
| 2004-06-01 | month | 2004-06~ | no | no | no | yes | yes | no |
|
|
119
|
-
| 2004-06-01 | month | 2004~-06 | no | no | no | yes | no | no |
|
|
120
|
-
| 2004-06-01 | month | 2004-(06)~ | no | no | no | no | yes | no |
|
|
121
|
-
| 2004-06-01 | month | 2004-06 | no | no | no | no | no | no |
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
Scenarios: Uncertain or approximate dates, year precision
|
|
125
|
-
| date | precision | string | ?-year | ?-month | ?-day | ~-year | ~-month | ~-day |
|
|
126
|
-
| 2004-06-01 | year | 2004?~ | yes | no | no | yes | no | no |
|
|
127
|
-
| 2004-06-01 | year | 2004? | yes | no | no | no | no | no |
|
|
128
|
-
| 2004-06-01 | year | 2004~ | no | no | no | yes | no | no |
|
|
129
|
-
| 2004-06-01 | year | 2004 | no | no | no | no | no | no |
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
Feature: Parse unspecified date strings
|
|
2
|
-
As a user of EDTF-Ruby
|
|
3
|
-
I want to be able to parse date strings containing unspecified elements
|
|
4
|
-
|
|
5
|
-
Scenario Outline: parse unspecified dates
|
|
6
|
-
When I parse the string "<string>"
|
|
7
|
-
Then the year should be "<year>"
|
|
8
|
-
And the month should be "<month>"
|
|
9
|
-
And the day should be "<day>"
|
|
10
|
-
And the unspecified string code be "<unspecified>"
|
|
11
|
-
|
|
12
|
-
@102 @level1 @draft
|
|
13
|
-
Scenarios: examples from the specification draft
|
|
14
|
-
| string | year | month | day | unspecified |
|
|
15
|
-
| 199u | 1990 | 1 | 1 | sssX-ss-ss |
|
|
16
|
-
| 19uu | 1900 | 1 | 1 | ssXX-ss-ss |
|
|
17
|
-
| 1999-uu | 1999 | 1 | 1 | ssss-XX-ss |
|
|
18
|
-
| 1999-02-uu | 1999 | 2 | 1 | ssss-ss-XX |
|
|
19
|
-
| 1999-uu-uu | 1999 | 1 | 1 | ssss-XX-XX |
|
|
20
|
-
|
|
21
|
-
@102 @level1 @final
|
|
22
|
-
Scenarios: examples from the specification draft
|
|
23
|
-
| string | year | month | day | unspecified |
|
|
24
|
-
| 199X | 1990 | 1 | 1 | sssX-ss-ss |
|
|
25
|
-
| 19XX | 1900 | 1 | 1 | ssXX-ss-ss |
|
|
26
|
-
| 1999-XX | 1999 | 1 | 1 | ssss-XX-ss |
|
|
27
|
-
| 1999-02-XX | 1999 | 2 | 1 | ssss-ss-XX |
|
|
28
|
-
| 1999-XX-XX | 1999 | 1 | 1 | ssss-XX-XX |
|
|
29
|
-
|
|
30
|
-
Scenario: Completely unknown
|
|
31
|
-
When I parse the string "uuuu"
|
|
32
|
-
Then the result should be an Unknown
|
|
33
|
-
When I parse the string "XXXX"
|
|
34
|
-
Then the result should be an Unknown
|