edtf 3.0.5 → 3.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/edtf/epoch.rb +2 -2
- data/lib/edtf/parser.rb +295 -284
- data/lib/edtf/parser.y +6 -0
- data/lib/edtf/set.rb +2 -2
- data/lib/edtf/version.rb +1 -1
- data/spec/edtf/parser_spec.rb +1 -0
- metadata +6 -6
data/lib/edtf/parser.y
CHANGED
@@ -272,6 +272,12 @@ rule
|
|
272
272
|
result = Date.new(val[0][0], val[2], val[4])
|
273
273
|
result.unspecified.year[2,2] = val[0][1]
|
274
274
|
}
|
275
|
+
| unspecified_year '-' month
|
276
|
+
{
|
277
|
+
result = Date.new(val[0][0], val[2], 1)
|
278
|
+
result.month_precision!
|
279
|
+
result.unspecified.year[2,2] = val[0][1]
|
280
|
+
}
|
275
281
|
| unspecified_year '-' U U '-' day
|
276
282
|
{
|
277
283
|
result = Date.new(val[0][0], 1, val[5])
|
data/lib/edtf/set.rb
CHANGED
data/lib/edtf/version.rb
CHANGED
data/spec/edtf/parser_spec.rb
CHANGED
@@ -49,6 +49,7 @@ module EDTF
|
|
49
49
|
it 'parses unspecified dates' do
|
50
50
|
expect(Parser.new.parse('199u')).to be_unspecified
|
51
51
|
expect(Parser.new.parse('1999-uu-uu')).to be_unspecified
|
52
|
+
expect(Parser.new.parse('199u-01')).to be_unspecified
|
52
53
|
end
|
53
54
|
|
54
55
|
it 'parses negative unspecified dates' do
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvester Keil
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -89,7 +89,7 @@ homepage: http://github.com/inukshuk/edtf-ruby
|
|
89
89
|
licenses:
|
90
90
|
- BSD-2-Clause-FreeBSD
|
91
91
|
metadata: {}
|
92
|
-
post_install_message:
|
92
|
+
post_install_message:
|
93
93
|
rdoc_options:
|
94
94
|
- "--line-numbers"
|
95
95
|
- "--inline-source"
|
@@ -111,8 +111,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
|
-
rubygems_version: 3.
|
115
|
-
signing_key:
|
114
|
+
rubygems_version: 3.1.2
|
115
|
+
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Extended Date/Time Format for Ruby.
|
118
118
|
test_files:
|