edtf-humanize 2.0.1 → 2.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc48511e90b2d4e45ff0be51e918e017d62d416e30e20c170a4fc5665995d47e
4
- data.tar.gz: eabab9819e11f79c8b99e510e8136f8458724e4314b8e0dd8cc5fdf1932f86e2
3
+ metadata.gz: 4d1b42abe59756665b608da4635e8766f78fb44ac2e658e14365141bf919eae9
4
+ data.tar.gz: f7a583e56c886eee461568fd2deacbd4769221b48b1f5e6b6f9b2ed68b08420c
5
5
  SHA512:
6
- metadata.gz: 31eeb4f4ca204efdfa7b323b48968eb1e9a4f50511a1e811a0e171657459b7b6f531d70020befdfd266b7bede99ae326313b5bb38305f1b864e7aaabcc40638a
7
- data.tar.gz: 1fac59abdcc0142f3ff2f7ff210dc3b2acfa8f5171c4614710791d7540ecd924469dd11743818a31615ee4ec9687b723e80970d055eb1a99bfc73207d901cc78
6
+ metadata.gz: e7d3799ba863355aefa8afd5fdd09f20bc796cea31609d2015979b36f175ccff9a998019b62901c71d0873ca48dc03c0405f47fce7dd049d2ac801fc763d74f3
7
+ data.tar.gz: 6233da61c4a069e473336c229cd117e479ce1037d10d789506a32565ff4abed04740ce9fa59df1f8be772aaaa62447e58e9b422f6d72ed8778c9e2a6416e0035
@@ -94,16 +94,14 @@ module Edtf
94
94
  # '198u' => 198x
95
95
  def apply_if_unspecified_year(date)
96
96
  display = date_precision(date)
97
- if date.respond_to? :unspecified?
98
- if date.unspecified? :year
99
- year_substitute =
100
- date.year_precision.edtf.gsub(
101
- /u/,
102
- I18n.t('edtf.terms.unspecified_digit_substitute',
103
- default: 'x')
104
- )
105
- display.gsub!(date.year.to_s, year_substitute)
106
- end
97
+ if date.respond_to?(:unspecified?) && date.unspecified?(:year)
98
+ year_substitute =
99
+ date.year_precision.edtf.gsub(
100
+ /u/,
101
+ I18n.t('edtf.terms.unspecified_digit_substitute',
102
+ default: 'x')
103
+ )
104
+ display.gsub!(date.year.to_s, year_substitute)
107
105
  end
108
106
  display
109
107
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Edtf
4
4
  module Humanize
5
- VERSION = '2.0.1'
5
+ VERSION = '2.1.0'
6
6
  end
7
7
  end
@@ -54,7 +54,7 @@ RSpec.describe Edtf::Humanize do
54
54
 
55
55
  context 'with an unspecified year iso date' do
56
56
  it 'returns a humanized unspecified year ISO date string' do
57
- expect(Date.edtf('197u').humanize).to eq('197x')
57
+ expect(Date.edtf('197u').humanize).to eq('197X')
58
58
  end
59
59
  end
60
60
 
@@ -54,7 +54,7 @@ RSpec.describe Edtf::Humanize do
54
54
 
55
55
  context 'with an unspecified year iso date' do
56
56
  it 'returns a humanized unspecified year ISO date string' do
57
- expect(Date.edtf('197u').humanize).to eq('197x')
57
+ expect(Date.edtf('197u').humanize).to eq('197X')
58
58
  end
59
59
  end
60
60
 
@@ -54,7 +54,7 @@ RSpec.describe Edtf::Humanize do
54
54
 
55
55
  context 'with an unspecified year iso date' do
56
56
  it 'returns a humanized unspecified year ISO date string' do
57
- expect(Date.edtf('197u').humanize).to eq('197x')
57
+ expect(Date.edtf('197u').humanize).to eq('197X')
58
58
  end
59
59
  end
60
60
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edtf-humanize
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cory Lown
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-14 00:00:00.000000000 Z
11
+ date: 2022-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -163,21 +163,24 @@ require_paths:
163
163
  - lib
164
164
  required_ruby_version: !ruby/object:Gem::Requirement
165
165
  requirements:
166
- - - "~>"
166
+ - - ">="
167
167
  - !ruby/object:Gem::Version
168
168
  version: '2.4'
169
+ - - "<"
170
+ - !ruby/object:Gem::Version
171
+ version: '4'
169
172
  required_rubygems_version: !ruby/object:Gem::Requirement
170
173
  requirements:
171
174
  - - ">="
172
175
  - !ruby/object:Gem::Version
173
176
  version: '0'
174
177
  requirements: []
175
- rubygems_version: 3.0.6
178
+ rubygems_version: 3.2.32
176
179
  signing_key:
177
180
  specification_version: 4
178
181
  summary: This gem adds a humanize method to EDTF dates.
179
182
  test_files:
180
- - spec/spec_helper.rb
183
+ - spec/edtf_humanize_en_spec.rb
181
184
  - spec/edtf_humanize_fr_spec.rb
182
185
  - spec/edtf_humanize_it_spec.rb
183
- - spec/edtf_humanize_en_spec.rb
186
+ - spec/spec_helper.rb