holidays / holidays

A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Load all regions on demand

espen opened this issue · comments

irb(main):001:0> require "holidays"
=> true
irb(main):002:0> Holidays.available_regions
NameError: uninitialized constant Holidays::REGIONS

Is there any way to load all regions in v5 without calling a specific date method?

😱

That is a pretty egregious oversight, isn't it. I apologize!

I will work this week on finding a solution so that you can 'preload' everything if needed so we can satisfy both use cases. Sorry again!

Oh... 😱
@espen Sorry again.

No worries, I'm using the previous version which works perfectly. Thanks for the work on a very useful gem :)

Sorry that this is taking so long! These last two weeks have been really crazy for me, personally, so things have been slower than I would like. I am still investigating this but I'm not entirely sure when I'll have an answer. Thanks for your patience!

Actually! 🤓

I realized that I could take some previous code and implement this. What do we think @ttwo32 and @espen?

PR: #233

@ptrimble I agree.Thanks for your work.:+1:

@espen Does this new load_all method work for you? Is the name clear?

@espen Friendly poke! I would like to make sure this kind of method works for your use case before I add it to our API. Once it's in there I won't be able to change/remove it without a major version bump. 😄

Sorry been busy
14700920_10157585354840092_3642189891317902741_o

I tried out this branch in my project locally and it's working great with Holidays.load_all in an initializer. Thanks!

Ooof, that's beautiful. Where is that? I'm very jealous. 😃

No worries at all, it's just been sitting. No big deal. Thanks for the feedback!