stock_market_days 1.0.1 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +4 -2
- data/README.md +2 -1
- data/lib/market_open_days/nyse_market_days.csv +4 -45
- data/lib/stock_market_days/version.rb +1 -1
- data/spec/stock_market_days/stock_market_days_spec.rb +45 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94edfa2a6d5b3410f856de1d32c246ff87b51cf4d3b74e89e1676a2ed2a59d57
|
4
|
+
data.tar.gz: aa89e3e52a0538fd2aac5e4af6f237f454ec37931ba8fdb263faf30640a7431d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2eb4b581e6609621dd4b5745afddd41775af35350c6285f478cce54b6c43f4e440854a986d748147c049091442e4c62a5bb3750ac5b40a1e09d81c7470350d5d
|
7
|
+
data.tar.gz: a5e02e9d9864a96ba20eb9440a0730d81f6fa0ed6cfac683b1cc5956bf9dfc121f808a0f0c7647807db1692e6d1e4166622311df65e0eb771bfe97e3d6acdcd3
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
pkg/
|
data/CHANGELOG.md
CHANGED
@@ -1,2 +1,8 @@
|
|
1
|
+
Version 1.1.1 (5/22/2024)
|
2
|
+
* A few historical date corrections
|
3
|
+
|
4
|
+
Version 1.1.0 (6/19/2022)
|
5
|
+
* Adjusted market days for new Juneteenth federal holiday
|
6
|
+
|
1
7
|
Version 1.0.1 (12/30/2019)
|
2
8
|
* Fixed bug where methods were not calling properly when including StockMarketDays as a mixin
|
data/Gemfile.lock
CHANGED
@@ -8,7 +8,7 @@ PATH
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
addressable (2.
|
11
|
+
addressable (2.8.0)
|
12
12
|
public_suffix (>= 2.0.2, < 5.0)
|
13
13
|
clipboard (1.3.5)
|
14
14
|
coderay (1.1.3)
|
@@ -22,7 +22,8 @@ GEM
|
|
22
22
|
method_source (~> 1.0)
|
23
23
|
public_suffix (4.0.6)
|
24
24
|
rake (13.0.3)
|
25
|
-
rexml (3.2.
|
25
|
+
rexml (3.2.8)
|
26
|
+
strscan (>= 3.0.9)
|
26
27
|
rspec (3.10.0)
|
27
28
|
rspec-core (~> 3.10.0)
|
28
29
|
rspec-expectations (~> 3.10.0)
|
@@ -36,6 +37,7 @@ GEM
|
|
36
37
|
diff-lcs (>= 1.2.0, < 2.0)
|
37
38
|
rspec-support (~> 3.10.0)
|
38
39
|
rspec-support (3.10.2)
|
40
|
+
strscan (3.1.0)
|
39
41
|
webmock (3.11.2)
|
40
42
|
addressable (>= 2.3.6)
|
41
43
|
crack (>= 0.3.2)
|
data/README.md
CHANGED
@@ -10,6 +10,7 @@ Typically, markets are closed on weekends and the following holidays:
|
|
10
10
|
* Washington's Birthday (third Monday of Feburary)
|
11
11
|
* Good Friday (Determined by http://www.maa.clell.de/StarDate/publ_holidays.html)
|
12
12
|
* Memorial Day (last Monday of May)
|
13
|
+
* Juneteenth (June 19, or nearest Monday or Friday if on a weekend)
|
13
14
|
* Independence Day (July 4, or July 3rd if on Saturday, July 5th if on Sunday)
|
14
15
|
* Labor Day (First Monday of September)
|
15
16
|
* Thanksgiving Day (Fourth Thursday of November)
|
@@ -23,7 +24,7 @@ to get rich!
|
|
23
24
|
In your Gemfile:
|
24
25
|
|
25
26
|
```ruby
|
26
|
-
gem 'stock_market_days'
|
27
|
+
gem 'stock_market_days'
|
27
28
|
```
|
28
29
|
|
29
30
|
## Available Methods
|
@@ -763,7 +763,6 @@
|
|
763
763
|
2017-01-11
|
764
764
|
2017-01-12
|
765
765
|
2017-01-13
|
766
|
-
2017-01-16
|
767
766
|
2017-01-17
|
768
767
|
2017-01-18
|
769
768
|
2017-01-19
|
@@ -826,7 +825,6 @@
|
|
826
825
|
2017-04-11
|
827
826
|
2017-04-12
|
828
827
|
2017-04-13
|
829
|
-
2017-04-14
|
830
828
|
2017-04-17
|
831
829
|
2017-04-18
|
832
830
|
2017-04-19
|
@@ -1007,7 +1005,6 @@
|
|
1007
1005
|
2017-12-27
|
1008
1006
|
2017-12-28
|
1009
1007
|
2017-12-29
|
1010
|
-
2018-01-01
|
1011
1008
|
2018-01-02
|
1012
1009
|
2018-01-03
|
1013
1010
|
2018-01-04
|
@@ -1259,7 +1256,6 @@
|
|
1259
1256
|
2018-12-27
|
1260
1257
|
2018-12-28
|
1261
1258
|
2018-12-31
|
1262
|
-
2019-01-01
|
1263
1259
|
2019-01-02
|
1264
1260
|
2019-01-03
|
1265
1261
|
2019-01-04
|
@@ -1485,11 +1481,11 @@
|
|
1485
1481
|
2019-11-18
|
1486
1482
|
2019-11-19
|
1487
1483
|
2019-11-20
|
1484
|
+
2019-11-21
|
1488
1485
|
2019-11-22
|
1489
1486
|
2019-11-25
|
1490
1487
|
2019-11-26
|
1491
1488
|
2019-11-27
|
1492
|
-
2019-11-28
|
1493
1489
|
2019-11-29
|
1494
1490
|
2019-12-02
|
1495
1491
|
2019-12-03
|
@@ -1512,7 +1508,6 @@
|
|
1512
1508
|
2019-12-27
|
1513
1509
|
2019-12-30
|
1514
1510
|
2019-12-31
|
1515
|
-
2020-01-01
|
1516
1511
|
2020-01-02
|
1517
1512
|
2020-01-03
|
1518
1513
|
2020-01-06
|
@@ -1737,11 +1732,11 @@
|
|
1737
1732
|
2020-11-16
|
1738
1733
|
2020-11-17
|
1739
1734
|
2020-11-18
|
1735
|
+
2020-11-19
|
1740
1736
|
2020-11-20
|
1741
1737
|
2020-11-23
|
1742
1738
|
2020-11-24
|
1743
1739
|
2020-11-25
|
1744
|
-
2020-11-26
|
1745
1740
|
2020-11-27
|
1746
1741
|
2020-11-30
|
1747
1742
|
2020-12-01
|
@@ -2018,6 +2013,7 @@
|
|
2018
2013
|
2021-12-29
|
2019
2014
|
2021-12-30
|
2020
2015
|
2021-12-31
|
2016
|
+
2022-01-03
|
2021
2017
|
2022-01-04
|
2022
2018
|
2022-01-05
|
2023
2019
|
2022-01-06
|
@@ -2133,7 +2129,6 @@
|
|
2133
2129
|
2022-06-15
|
2134
2130
|
2022-06-16
|
2135
2131
|
2022-06-17
|
2136
|
-
2022-06-20
|
2137
2132
|
2022-06-21
|
2138
2133
|
2022-06-22
|
2139
2134
|
2022-06-23
|
@@ -2384,7 +2379,6 @@
|
|
2384
2379
|
2023-06-14
|
2385
2380
|
2023-06-15
|
2386
2381
|
2023-06-16
|
2387
|
-
2023-06-19
|
2388
2382
|
2023-06-20
|
2389
2383
|
2023-06-21
|
2390
2384
|
2023-06-22
|
@@ -2637,7 +2631,6 @@
|
|
2637
2631
|
2024-06-14
|
2638
2632
|
2024-06-17
|
2639
2633
|
2024-06-18
|
2640
|
-
2024-06-19
|
2641
2634
|
2024-06-20
|
2642
2635
|
2024-06-21
|
2643
2636
|
2024-06-24
|
@@ -2889,7 +2882,6 @@
|
|
2889
2882
|
2025-06-16
|
2890
2883
|
2025-06-17
|
2891
2884
|
2025-06-18
|
2892
|
-
2025-06-19
|
2893
2885
|
2025-06-20
|
2894
2886
|
2025-06-23
|
2895
2887
|
2025-06-24
|
@@ -3141,7 +3133,6 @@
|
|
3141
3133
|
2026-06-16
|
3142
3134
|
2026-06-17
|
3143
3135
|
2026-06-18
|
3144
|
-
2026-06-19
|
3145
3136
|
2026-06-22
|
3146
3137
|
2026-06-23
|
3147
3138
|
2026-06-24
|
@@ -3393,7 +3384,6 @@
|
|
3393
3384
|
2027-06-15
|
3394
3385
|
2027-06-16
|
3395
3386
|
2027-06-17
|
3396
|
-
2027-06-18
|
3397
3387
|
2027-06-21
|
3398
3388
|
2027-06-22
|
3399
3389
|
2027-06-23
|
@@ -3645,7 +3635,6 @@
|
|
3645
3635
|
2028-06-14
|
3646
3636
|
2028-06-15
|
3647
3637
|
2028-06-16
|
3648
|
-
2028-06-19
|
3649
3638
|
2028-06-20
|
3650
3639
|
2028-06-21
|
3651
3640
|
2028-06-22
|
@@ -3897,7 +3886,6 @@
|
|
3897
3886
|
2029-06-14
|
3898
3887
|
2029-06-15
|
3899
3888
|
2029-06-18
|
3900
|
-
2029-06-19
|
3901
3889
|
2029-06-20
|
3902
3890
|
2029-06-21
|
3903
3891
|
2029-06-22
|
@@ -4149,7 +4137,6 @@
|
|
4149
4137
|
2030-06-14
|
4150
4138
|
2030-06-17
|
4151
4139
|
2030-06-18
|
4152
|
-
2030-06-19
|
4153
4140
|
2030-06-20
|
4154
4141
|
2030-06-21
|
4155
4142
|
2030-06-24
|
@@ -4401,7 +4388,6 @@
|
|
4401
4388
|
2031-06-16
|
4402
4389
|
2031-06-17
|
4403
4390
|
2031-06-18
|
4404
|
-
2031-06-19
|
4405
4391
|
2031-06-20
|
4406
4392
|
2031-06-23
|
4407
4393
|
2031-06-24
|
@@ -4653,7 +4639,6 @@
|
|
4653
4639
|
2032-06-15
|
4654
4640
|
2032-06-16
|
4655
4641
|
2032-06-17
|
4656
|
-
2032-06-18
|
4657
4642
|
2032-06-21
|
4658
4643
|
2032-06-22
|
4659
4644
|
2032-06-23
|
@@ -4905,7 +4890,6 @@
|
|
4905
4890
|
2033-06-15
|
4906
4891
|
2033-06-16
|
4907
4892
|
2033-06-17
|
4908
|
-
2033-06-20
|
4909
4893
|
2033-06-21
|
4910
4894
|
2033-06-22
|
4911
4895
|
2033-06-23
|
@@ -5156,7 +5140,6 @@
|
|
5156
5140
|
2034-06-14
|
5157
5141
|
2034-06-15
|
5158
5142
|
2034-06-16
|
5159
|
-
2034-06-19
|
5160
5143
|
2034-06-20
|
5161
5144
|
2034-06-21
|
5162
5145
|
2034-06-22
|
@@ -5408,7 +5391,6 @@
|
|
5408
5391
|
2035-06-14
|
5409
5392
|
2035-06-15
|
5410
5393
|
2035-06-18
|
5411
|
-
2035-06-19
|
5412
5394
|
2035-06-20
|
5413
5395
|
2035-06-21
|
5414
5396
|
2035-06-22
|
@@ -5661,7 +5643,6 @@
|
|
5661
5643
|
2036-06-16
|
5662
5644
|
2036-06-17
|
5663
5645
|
2036-06-18
|
5664
|
-
2036-06-19
|
5665
5646
|
2036-06-20
|
5666
5647
|
2036-06-23
|
5667
5648
|
2036-06-24
|
@@ -5913,7 +5894,6 @@
|
|
5913
5894
|
2037-06-16
|
5914
5895
|
2037-06-17
|
5915
5896
|
2037-06-18
|
5916
|
-
2037-06-19
|
5917
5897
|
2037-06-22
|
5918
5898
|
2037-06-23
|
5919
5899
|
2037-06-24
|
@@ -6165,7 +6145,6 @@
|
|
6165
6145
|
2038-06-15
|
6166
6146
|
2038-06-16
|
6167
6147
|
2038-06-17
|
6168
|
-
2038-06-18
|
6169
6148
|
2038-06-21
|
6170
6149
|
2038-06-22
|
6171
6150
|
2038-06-23
|
@@ -6417,7 +6396,6 @@
|
|
6417
6396
|
2039-06-15
|
6418
6397
|
2039-06-16
|
6419
6398
|
2039-06-17
|
6420
|
-
2039-06-20
|
6421
6399
|
2039-06-21
|
6422
6400
|
2039-06-22
|
6423
6401
|
2039-06-23
|
@@ -6669,7 +6647,6 @@
|
|
6669
6647
|
2040-06-14
|
6670
6648
|
2040-06-15
|
6671
6649
|
2040-06-18
|
6672
|
-
2040-06-19
|
6673
6650
|
2040-06-20
|
6674
6651
|
2040-06-21
|
6675
6652
|
2040-06-22
|
@@ -6921,7 +6898,6 @@
|
|
6921
6898
|
2041-06-14
|
6922
6899
|
2041-06-17
|
6923
6900
|
2041-06-18
|
6924
|
-
2041-06-19
|
6925
6901
|
2041-06-20
|
6926
6902
|
2041-06-21
|
6927
6903
|
2041-06-24
|
@@ -7173,7 +7149,6 @@
|
|
7173
7149
|
2042-06-16
|
7174
7150
|
2042-06-17
|
7175
7151
|
2042-06-18
|
7176
|
-
2042-06-19
|
7177
7152
|
2042-06-20
|
7178
7153
|
2042-06-23
|
7179
7154
|
2042-06-24
|
@@ -7425,7 +7400,6 @@
|
|
7425
7400
|
2043-06-16
|
7426
7401
|
2043-06-17
|
7427
7402
|
2043-06-18
|
7428
|
-
2043-06-19
|
7429
7403
|
2043-06-22
|
7430
7404
|
2043-06-23
|
7431
7405
|
2043-06-24
|
@@ -7678,7 +7652,6 @@
|
|
7678
7652
|
2044-06-15
|
7679
7653
|
2044-06-16
|
7680
7654
|
2044-06-17
|
7681
|
-
2044-06-20
|
7682
7655
|
2044-06-21
|
7683
7656
|
2044-06-22
|
7684
7657
|
2044-06-23
|
@@ -7929,7 +7902,6 @@
|
|
7929
7902
|
2045-06-14
|
7930
7903
|
2045-06-15
|
7931
7904
|
2045-06-16
|
7932
|
-
2045-06-19
|
7933
7905
|
2045-06-20
|
7934
7906
|
2045-06-21
|
7935
7907
|
2045-06-22
|
@@ -8181,7 +8153,6 @@
|
|
8181
8153
|
2046-06-14
|
8182
8154
|
2046-06-15
|
8183
8155
|
2046-06-18
|
8184
|
-
2046-06-19
|
8185
8156
|
2046-06-20
|
8186
8157
|
2046-06-21
|
8187
8158
|
2046-06-22
|
@@ -8433,7 +8404,6 @@
|
|
8433
8404
|
2047-06-14
|
8434
8405
|
2047-06-17
|
8435
8406
|
2047-06-18
|
8436
|
-
2047-06-19
|
8437
8407
|
2047-06-20
|
8438
8408
|
2047-06-21
|
8439
8409
|
2047-06-24
|
@@ -8686,7 +8656,6 @@
|
|
8686
8656
|
2048-06-16
|
8687
8657
|
2048-06-17
|
8688
8658
|
2048-06-18
|
8689
|
-
2048-06-19
|
8690
8659
|
2048-06-22
|
8691
8660
|
2048-06-23
|
8692
8661
|
2048-06-24
|
@@ -8938,7 +8907,6 @@
|
|
8938
8907
|
2049-06-15
|
8939
8908
|
2049-06-16
|
8940
8909
|
2049-06-17
|
8941
|
-
2049-06-18
|
8942
8910
|
2049-06-21
|
8943
8911
|
2049-06-22
|
8944
8912
|
2049-06-23
|
@@ -9190,7 +9158,6 @@
|
|
9190
9158
|
2050-06-15
|
9191
9159
|
2050-06-16
|
9192
9160
|
2050-06-17
|
9193
|
-
2050-06-20
|
9194
9161
|
2050-06-21
|
9195
9162
|
2050-06-22
|
9196
9163
|
2050-06-23
|
@@ -9441,7 +9408,6 @@
|
|
9441
9408
|
2051-06-14
|
9442
9409
|
2051-06-15
|
9443
9410
|
2051-06-16
|
9444
|
-
2051-06-19
|
9445
9411
|
2051-06-20
|
9446
9412
|
2051-06-21
|
9447
9413
|
2051-06-22
|
@@ -9694,7 +9660,6 @@
|
|
9694
9660
|
2052-06-14
|
9695
9661
|
2052-06-17
|
9696
9662
|
2052-06-18
|
9697
|
-
2052-06-19
|
9698
9663
|
2052-06-20
|
9699
9664
|
2052-06-21
|
9700
9665
|
2052-06-24
|
@@ -9946,7 +9911,6 @@
|
|
9946
9911
|
2053-06-16
|
9947
9912
|
2053-06-17
|
9948
9913
|
2053-06-18
|
9949
|
-
2053-06-19
|
9950
9914
|
2053-06-20
|
9951
9915
|
2053-06-23
|
9952
9916
|
2053-06-24
|
@@ -10198,7 +10162,6 @@
|
|
10198
10162
|
2054-06-16
|
10199
10163
|
2054-06-17
|
10200
10164
|
2054-06-18
|
10201
|
-
2054-06-19
|
10202
10165
|
2054-06-22
|
10203
10166
|
2054-06-23
|
10204
10167
|
2054-06-24
|
@@ -10450,7 +10413,6 @@
|
|
10450
10413
|
2055-06-15
|
10451
10414
|
2055-06-16
|
10452
10415
|
2055-06-17
|
10453
|
-
2055-06-18
|
10454
10416
|
2055-06-21
|
10455
10417
|
2055-06-22
|
10456
10418
|
2055-06-23
|
@@ -10702,7 +10664,6 @@
|
|
10702
10664
|
2056-06-14
|
10703
10665
|
2056-06-15
|
10704
10666
|
2056-06-16
|
10705
|
-
2056-06-19
|
10706
10667
|
2056-06-20
|
10707
10668
|
2056-06-21
|
10708
10669
|
2056-06-22
|
@@ -10954,7 +10915,6 @@
|
|
10954
10915
|
2057-06-14
|
10955
10916
|
2057-06-15
|
10956
10917
|
2057-06-18
|
10957
|
-
2057-06-19
|
10958
10918
|
2057-06-20
|
10959
10919
|
2057-06-21
|
10960
10920
|
2057-06-22
|
@@ -11206,7 +11166,6 @@
|
|
11206
11166
|
2058-06-14
|
11207
11167
|
2058-06-17
|
11208
11168
|
2058-06-18
|
11209
|
-
2058-06-19
|
11210
11169
|
2058-06-20
|
11211
11170
|
2058-06-21
|
11212
11171
|
2058-06-24
|
@@ -11341,4 +11300,4 @@
|
|
11341
11300
|
2058-12-26
|
11342
11301
|
2058-12-27
|
11343
11302
|
2058-12-30
|
11344
|
-
2058-12-31
|
11303
|
+
2058-12-31
|
@@ -45,10 +45,37 @@ describe StockMarketDays do
|
|
45
45
|
it { is_expected.to be_falsey }
|
46
46
|
end
|
47
47
|
|
48
|
+
context 'is Juneteenth' do
|
49
|
+
let(:dates) do
|
50
|
+
[
|
51
|
+
Date.new(2022,6,19), # Sunday
|
52
|
+
Date.new(2022,6,20), # Monday (holiday falls on Sunday)
|
53
|
+
Date.new(2022,6,19), # Wednesday
|
54
|
+
Date.new(2027,6,18) # Friday (holiday falls on Saturday)
|
55
|
+
]
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'reports market closed on the holiday, or nearest Friday/Monday if on the weekend' do
|
59
|
+
dates.each do |market_closed_day|
|
60
|
+
expect(described_class.is_market_day?(market_closed_day)).to be_falsey
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
48
65
|
context 'is Thanksgiving' do
|
49
|
-
let(:
|
66
|
+
let(:dates) do
|
67
|
+
[
|
68
|
+
Date.new(2019,11,28),
|
69
|
+
Date.new(2020,11,26),
|
70
|
+
Date.new(2023,11,23)
|
71
|
+
]
|
72
|
+
end
|
50
73
|
|
51
|
-
it
|
74
|
+
it 'reports market closed on Thanksgiving' do
|
75
|
+
dates.each do |market_closed_day|
|
76
|
+
expect(described_class.is_market_day?(market_closed_day)).to be_falsey
|
77
|
+
end
|
78
|
+
end
|
52
79
|
end
|
53
80
|
|
54
81
|
context 'is Christmas (observed)' do
|
@@ -56,6 +83,22 @@ describe StockMarketDays do
|
|
56
83
|
|
57
84
|
it { is_expected.to be_falsey }
|
58
85
|
end
|
86
|
+
|
87
|
+
context 'is New Year\'s Day' do
|
88
|
+
let(:dates) do
|
89
|
+
[
|
90
|
+
Date.new(2018,1,1),
|
91
|
+
Date.new(2019,1,1),
|
92
|
+
Date.new(2020,1,1)
|
93
|
+
]
|
94
|
+
end
|
95
|
+
|
96
|
+
it 'reports market closed on New Year\'s Day' do
|
97
|
+
dates.each do |market_closed_day|
|
98
|
+
expect(described_class.is_market_day?(market_closed_day)).to be_falsey
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
59
102
|
end
|
60
103
|
|
61
104
|
context '#market_days_between' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stock_market_days
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Winston Kotzan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -101,6 +101,7 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
+
- ".gitignore"
|
104
105
|
- ".rspec"
|
105
106
|
- CHANGELOG.md
|
106
107
|
- Gemfile
|
@@ -137,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
138
|
- !ruby/object:Gem::Version
|
138
139
|
version: '0'
|
139
140
|
requirements: []
|
140
|
-
rubygems_version: 3.
|
141
|
+
rubygems_version: 3.3.26
|
141
142
|
signing_key:
|
142
143
|
specification_version: 4
|
143
144
|
summary: A gem for determining the days that the stock market is open
|