business_calendar 3.0.0 → 3.1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 727e8249f07c869a1797870f8b63c566e2a813ca0bdc2bc8da215b1905439911
|
4
|
+
data.tar.gz: 43b527655f6a5d6f8b16b56bfba032e7595efde7b521fca8bedcd2e6dc902371
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6eeefdebe1dcd01cec1818f54796b0f1e74fbbe2e97baef5c35794157b61635c4b59f35a01f4d35646558b7288ffc7620e8b17fc7c5c4bd8cf1d4c4fd324a43
|
7
|
+
data.tar.gz: c87fad57a025337acfe7f384cb2be65b7d722b3d446cdef62983a4897c1090c099c42c347aa6d6b681b0a148e62fa4e5ae26f332a9023d751dc4d2d8e78c193a
|
data/.github/workflows/ci.yml
CHANGED
data/data/US.yml
CHANGED
@@ -232,3 +232,26 @@ US:
|
|
232
232
|
- '2025-11-11'
|
233
233
|
- '2025-11-27'
|
234
234
|
- '2025-12-25'
|
235
|
+
- '2026-01-01'
|
236
|
+
- '2026-01-19'
|
237
|
+
- '2026-02-16'
|
238
|
+
- '2026-05-25'
|
239
|
+
- '2026-06-19'
|
240
|
+
- '2026-07-04'
|
241
|
+
- '2026-09-07'
|
242
|
+
- '2026-10-12'
|
243
|
+
- '2026-11-11'
|
244
|
+
- '2026-11-26'
|
245
|
+
- '2026-12-25'
|
246
|
+
- '2027-01-01'
|
247
|
+
- '2027-01-18'
|
248
|
+
- '2027-02-15'
|
249
|
+
- '2027-05-31'
|
250
|
+
- '2027-06-19'
|
251
|
+
- '2027-07-05'
|
252
|
+
- '2027-09-06'
|
253
|
+
- '2027-10-11'
|
254
|
+
- '2027-11-11'
|
255
|
+
- '2027-11-25'
|
256
|
+
- '2027-12-25'
|
257
|
+
- '2028-01-01'
|
@@ -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, :
|
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
|
@@ -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: 3.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Nubel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: holidays
|