business_calendar 2.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 565c792e03739cdb3e5f506afba3f18c45098b204dda20051978333bcb5a5acc
4
- data.tar.gz: 39de2f975e53ab66e32408c7591ec620b7596784277eebf1994c7231ecdd27af
3
+ metadata.gz: 7b390e3954573c98a996c9839374b3f2802f3ecb81d0815f62d28fc36b294c62
4
+ data.tar.gz: 7b5aeebc620e1c5c80b70a3359cb01cef43e7d27c3ca0778d7e13eeab5f17c58
5
5
  SHA512:
6
- metadata.gz: 6a671409be0e036f24dd0d15a8125702b37c0218387026a2a609cd1c22a6a8b25523dd4a78a16b2b5dfb688230fe2286bbf3f9f273cbdf26f0bca3a74b3b3d30
7
- data.tar.gz: 59d51361f35e15405f208288c9865e1d602fdb4baef607a509e191273c5ba1f38600a6d70a80e76104dc944cdab8539b25c33c8881a811dde5d11aec8a91d00e
6
+ metadata.gz: 975c687a0f0ea409e5c6a97116fe00807a2b14d4bfb85a9a43a575ce07549b30fa11f7ca2bd3b417f560df53842e450a24d1c564dbabf1481974bac77f4e2a98
7
+ data.tar.gz: bf9427e07ab653c90537a41b8f2b4e9cb95b09d9ec407c764b6b6fc9e3aa12037f1934c9cfe389626419f35e187578555681880a074efeeff49ae7e91590d90a
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["rnubel@enova.com"]
11
11
  spec.description = %q{Helper gem for dealing with business days and date adjustment in multiple countries.}
12
12
  spec.summary = %q{Country-aware business-date logic and handling.}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/enova/business_calendar"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
data/data/US.yml CHANGED
@@ -182,7 +182,6 @@ US:
182
182
  - '2021-01-18'
183
183
  - '2021-02-15'
184
184
  - '2021-05-31'
185
- - '2021-07-04'
186
185
  - '2021-07-05'
187
186
  - '2021-09-06'
188
187
  - '2021-10-11'
@@ -193,18 +192,18 @@ US:
193
192
  - '2022-01-17'
194
193
  - '2022-02-21'
195
194
  - '2022-05-30'
195
+ - '2022-06-20'
196
196
  - '2022-07-04'
197
197
  - '2022-09-05'
198
198
  - '2022-10-10'
199
199
  - '2022-11-11'
200
200
  - '2022-11-24'
201
- - '2022-12-25'
202
201
  - '2022-12-26'
203
- - '2023-01-01'
204
202
  - '2023-01-02'
205
203
  - '2023-01-16'
206
204
  - '2023-02-20'
207
205
  - '2023-05-29'
206
+ - '2023-06-19'
208
207
  - '2023-07-04'
209
208
  - '2023-09-04'
210
209
  - '2023-10-09'
@@ -215,6 +214,7 @@ US:
215
214
  - '2024-01-15'
216
215
  - '2024-02-19'
217
216
  - '2024-05-27'
217
+ - '2024-06-19'
218
218
  - '2024-07-04'
219
219
  - '2024-09-02'
220
220
  - '2024-10-14'
@@ -225,6 +225,7 @@ US:
225
225
  - '2025-01-20'
226
226
  - '2025-02-17'
227
227
  - '2025-05-26'
228
+ - '2025-06-19'
228
229
  - '2025-07-04'
229
230
  - '2025-09-01'
230
231
  - '2025-10-13'
@@ -2,7 +2,7 @@ require 'holidays'
2
2
 
3
3
  class BusinessCalendar::HolidayDeterminer
4
4
  DEFAULT_TIME_TO_LIVE = 24 * 60 * 60
5
- attr_reader :regions, :holiday_names, :additions, :removals, :additions_only
5
+ attr_reader :regions, :holiday_names, :additions_only
6
6
 
7
7
  def initialize(regions, holiday_names, opts = {})
8
8
  ttl = opts[:ttl]
@@ -27,6 +27,14 @@ class BusinessCalendar::HolidayDeterminer
27
27
  end
28
28
  end
29
29
 
30
+ def additions
31
+ @additions_cache ||= @additions.is_a?(Proc) ? @additions.call : @additions
32
+ end
33
+
34
+ def removals
35
+ @removals_cache ||= @removals.is_a?(Proc) ? @removals.call : @removals
36
+ end
37
+
30
38
  private
31
39
 
32
40
  def should_clear_cache?
@@ -40,12 +48,4 @@ class BusinessCalendar::HolidayDeterminer
40
48
  @additions_cache = nil
41
49
  @removals_cache = nil
42
50
  end
43
-
44
- def additions
45
- @additions_cache ||= @additions.is_a?(Proc) ? @additions.call : @additions
46
- end
47
-
48
- def removals
49
- @removals_cache ||= @removals.is_a?(Proc) ? @removals.call : @removals
50
- end
51
51
  end
@@ -1,3 +1,3 @@
1
1
  module BusinessCalendar
2
- VERSION = "2.0.0"
2
+ VERSION = "3.0.1"
3
3
  end
@@ -175,7 +175,6 @@ describe "US holidays" do
175
175
  2021-01-18
176
176
  2021-02-15
177
177
  2021-05-31
178
- 2021-07-04
179
178
  2021-07-05
180
179
  2021-09-06
181
180
  2021-10-11
@@ -186,18 +185,18 @@ describe "US holidays" do
186
185
  2022-01-17
187
186
  2022-02-21
188
187
  2022-05-30
188
+ 2022-06-20
189
189
  2022-07-04
190
190
  2022-09-05
191
191
  2022-10-10
192
192
  2022-11-11
193
193
  2022-11-24
194
- 2022-12-25
195
194
  2022-12-26
196
- 2023-01-01
197
195
  2023-01-02
198
196
  2023-01-16
199
197
  2023-02-20
200
198
  2023-05-29
199
+ 2023-06-19
201
200
  2023-07-04
202
201
  2023-09-04
203
202
  2023-10-09
@@ -208,6 +207,7 @@ describe "US holidays" do
208
207
  2024-01-15
209
208
  2024-02-19
210
209
  2024-05-27
210
+ 2024-06-19
211
211
  2024-07-04
212
212
  2024-09-02
213
213
  2024-10-14
@@ -218,6 +218,7 @@ describe "US holidays" do
218
218
  2025-01-20
219
219
  2025-02-17
220
220
  2025-05-26
221
+ 2025-06-19
221
222
  2025-07-04
222
223
  2025-09-01
223
224
  2025-10-13
@@ -47,5 +47,9 @@ describe BusinessCalendar::HolidayDeterminer do
47
47
  it "correctly determines false for dates not in additions, nor exceptions" do
48
48
  expect(subject.call('2101-07-04'.to_date)).to be_falsy
49
49
  end
50
+
51
+ it "lists out the additions" do
52
+ expect(subject.additions).to include('2101-07-05'.to_date)
53
+ end
50
54
  end
51
55
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: business_calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Nubel
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-18 00:00:00.000000000 Z
11
+ date: 2022-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: holidays
@@ -132,11 +132,11 @@ files:
132
132
  - spec/business_calendar/holiday_determiner_spec.rb
133
133
  - spec/business_calendar_spec.rb
134
134
  - spec/spec_helper.rb
135
- homepage: ''
135
+ homepage: https://github.com/enova/business_calendar
136
136
  licenses:
137
137
  - MIT
138
138
  metadata: {}
139
- post_install_message:
139
+ post_install_message:
140
140
  rdoc_options: []
141
141
  require_paths:
142
142
  - lib
@@ -151,8 +151,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  requirements: []
154
- rubygems_version: 3.1.2
155
- signing_key:
154
+ rubygems_version: 3.1.6
155
+ signing_key:
156
156
  specification_version: 4
157
157
  summary: Country-aware business-date logic and handling.
158
158
  test_files: