edtf 3.0.5 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -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])
@@ -34,9 +34,9 @@ module EDTF
34
34
  self
35
35
  end
36
36
 
37
- def each
37
+ def each(&block)
38
38
  if block_given?
39
- to_a.each(&Proc.new)
39
+ to_a.each(&block)
40
40
  self
41
41
  else
42
42
  to_enum
@@ -1,3 +1,3 @@
1
1
  module EDTF
2
- VERSION = '3.0.5'.freeze
2
+ VERSION = '3.0.6'.freeze
3
3
  end
@@ -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.5
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: 2019-09-16 00:00:00.000000000 Z
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.0.6
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: