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: beb100bc24dbbd90684a3c07a5201b9608534d9d2a3a26807e59d2b646eb4579
4
- data.tar.gz: b456e4a40d119ebf60e822ecd2f07751c4971f5694e8dd0a2496fccc3226768b
3
+ metadata.gz: 727e8249f07c869a1797870f8b63c566e2a813ca0bdc2bc8da215b1905439911
4
+ data.tar.gz: 43b527655f6a5d6f8b16b56bfba032e7595efde7b521fca8bedcd2e6dc902371
5
5
  SHA512:
6
- metadata.gz: 9b827ee58fe6bec07fc210d3928acea4f5aec538e059ad639cc07dc97dd969837b3c33f778c860a2a5445a89352bac2d706d3ecee6f1a2933016ddb460886ce5
7
- data.tar.gz: abe89b5c64c4a84fa1aaa7b21533eed255983efa6da080ddc1911328cc45c83b8cf804dd71bf079a4c433195f3f0eb1665602ba6f9c46c9b3c5a1c0a8d759377
6
+ metadata.gz: d6eeefdebe1dcd01cec1818f54796b0f1e74fbbe2e97baef5c35794157b61635c4b59f35a01f4d35646558b7288ffc7620e8b17fc7c5c4bd8cf1d4c4fd324a43
7
+ data.tar.gz: c87fad57a025337acfe7f384cb2be65b7d722b3d446cdef62983a4897c1090c099c42c347aa6d6b681b0a148e62fa4e5ae26f332a9023d751dc4d2d8e78c193a
@@ -12,7 +12,7 @@ jobs:
12
12
  continue-on-error: ${{ matrix.experimental }}
13
13
  strategy:
14
14
  matrix:
15
- ruby-version: [2.3.1, 2.7.0]
15
+ ruby-version: [2.4.9, 2.7.0, 3.1.0]
16
16
  experimental: [false]
17
17
  include:
18
18
  - ruby-version: head
@@ -13,7 +13,7 @@ jobs:
13
13
  steps:
14
14
  - uses: actions/checkout@v2
15
15
  - name: Set up Ruby 2.7
16
- uses: actions/setup-ruby@v1
16
+ uses: ruby/setup-ruby@v1
17
17
  with:
18
18
  ruby-version: 2.7
19
19
 
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, :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 = "3.0.0"
2
+ VERSION = "3.1.1"
3
3
  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.0.0
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: 2021-08-18 00:00:00.000000000 Z
11
+ date: 2023-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: holidays