edtf 2.2.0 → 2.3.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.
data/lib/edtf/parser.y CHANGED
@@ -92,7 +92,9 @@ rule
92
92
  # ---- Level 1 Extension Rules ----
93
93
 
94
94
  # NB: Uncertain/approximate Dates are covered by the Level 2 rules
95
- level_1_expression : unspecified | level_1_interval | long_year_simple | season
95
+ level_1_expression : unknown | unspecified | level_1_interval | long_year_simple | season
96
+
97
+ unknown : U U U U { result = EDTF::Unknown.new }
96
98
 
97
99
  # uncertain_or_approximate_date : date UA { result = uoa(val[0], val[1]) }
98
100
 
@@ -0,0 +1,25 @@
1
+ module EDTF
2
+ class Unknown < ::Date::Infinity
3
+ def edtf
4
+ 'uuuu'
5
+ end
6
+
7
+ alias to_s edtf
8
+
9
+ def uncertain?
10
+ true
11
+ end
12
+
13
+ def certain?
14
+ false
15
+ end
16
+
17
+ def approximate?
18
+ true
19
+ end
20
+
21
+ def precise?
22
+ false
23
+ end
24
+ end
25
+ end
data/lib/edtf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module EDTF
2
- VERSION = '2.2.0'.freeze
2
+ VERSION = '2.3.0'.freeze
3
3
  end
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: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-05 00:00:00.000000000 Z
11
+ date: 2016-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -75,6 +75,7 @@ files:
75
75
  - lib/edtf/season.rb
76
76
  - lib/edtf/set.rb
77
77
  - lib/edtf/uncertainty.rb
78
+ - lib/edtf/unknown.rb
78
79
  - lib/edtf/version.rb
79
80
  - spec/edtf/date_spec.rb
80
81
  - spec/edtf/epoch_spec.rb
@@ -111,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
112
  version: '0'
112
113
  requirements: []
113
114
  rubyforge_project:
114
- rubygems_version: 2.4.6
115
+ rubygems_version: 2.4.5.1
115
116
  signing_key:
116
117
  specification_version: 4
117
118
  summary: Extended Date/Time Format for Ruby.