Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't locate Date/Holidays/Adapter/ca_es.pm #2

Closed
eserte opened this issue Jun 9, 2018 · 5 comments · Fixed by jonasbn/perl-date-holidays#40
Closed

Can't locate Date/Holidays/Adapter/ca_es.pm #2

eserte opened this issue Jun 9, 2018 · 5 comments · Fixed by jonasbn/perl-date-holidays#40

Comments

@eserte
Copy link

eserte commented Jun 9, 2018

The test suite started to fail:

Unable to load module: Date::Holidays::Adapter::ca_es - Unable to load: Date::Holidays::Adapter::ca_es - Can't locate Date/Holidays/Adapter/ca_es.pm in @INC (@INC contains: /usr/home/eserte/.cpan/build/2018060909/Date-Holidays-CA_ES-0.03-3/blib/lib /usr/home/eserte/.cpan/build/2018060909/Date-Holidays-CA_ES-0.03-3/blib/arch /usr/perl5.16.3t/lib/site_perl/5.16.3/amd64-freebsd-thread-multi /usr/perl5.16.3t/lib/site_perl/5.16.3 /usr/perl5.16.3t/lib/5.16.3/amd64-freebsd-thread-multi /usr/perl5.16.3t/lib/5.16.3 .) at /usr/perl5.16.3t/lib/site_perl/5.16.3/Module/Load.pm line 77.
Can't locate Date/Holidays/Adapter/ca_es in @INC (@INC contains: /usr/home/eserte/.cpan/build/2018060909/Date-Holidays-CA_ES-0.03-3/blib/lib /usr/home/eserte/.cpan/build/2018060909/Date-Holidays-CA_ES-0.03-3/blib/arch /usr/perl5.16.3t/lib/site_perl/5.16.3/amd64-freebsd-thread-multi /usr/perl5.16.3t/lib/site_perl/5.16.3 /usr/perl5.16.3t/lib/5.16.3/amd64-freebsd-thread-multi /usr/perl5.16.3t/lib/5.16.3 .) at /usr/perl5.16.3t/lib/site_perl/5.16.3/Module/Load.pm line 77.
...
# Looks like your test exited with 2 just after 1.
t/02-ca_es.t ........ 
Dubious, test returned 2 (wstat 512, 0x200)
Failed 10/11 subtests 

Maybe this happens with newer Date::Holidays (@jonasbn: FYI).

@jonasbn
Copy link
Contributor

jonasbn commented Jun 9, 2018

Hi @eserte

There is no adapter implemented for this distribution in Date::Holidays. I am planning to do so. The issue is that there is an implementation for ES in Date::Holidays::ES. As far as I can tell there is no country code for Catalonia, so an implementation like for Australia (Date::Holidays::AU) with states or New Zealand (Date::Holidays::NZ) with regions, would probably be the way to go.

@jonasbn
Copy link
Contributor

jonasbn commented Jun 9, 2018

My opinion is that this issue should be closed, since the issue is with Date::Holidays and not with the Date::Holidays::CA_ES distribution. The distribution could be adjusted for easy adaptation, but due to the naming and the scope and the implementation of Date::Holidays and adaptation would be required to be implemented in Date::Holidays

@eserte
Copy link
Author

eserte commented Jun 9, 2018

@jonasbn I think this issue may still be left open --- once Date::Holidays is fixed Date::Holidays::CA_ES could mark Date::Holidays with a minimum prereq version as a dependency to make sure that the problematic versions are upgraded.

@jonasbn
Copy link
Contributor

jonasbn commented Jun 16, 2018

Hi @eserte support for Date::Holidays::CA_ES has been added with release 1.13.

1.13 2018-06-12 Feature release, update recommended

This release integrates Date::Holidays::CA_ES is does so
by supporting the region parameter with the value 'ca' via
Date::Holidays::ES

The module is not supported directly, but as described earlier it is identified as a region ('CA') in Spain ('ES').

Example:

use Date::Holidays;

my $dh = Date::Holidays->new( countrycode => 'es' );

if ($dh->is_holiday(year => 2017, month  => 6, day => 24, region => 'ca')) {
    print "Yes it is a Catalan holiday\n";
}

my $holidays = $dh->holidays( year => 2006, region => 'ca' );

If you do want to view Catalonia as a region in Spain, you can use it directly:

use Date::Holidays;

my $dh = Date::Holidays->new( countrycode => 'CA_ES', nocheck => 1 );

if ($dh->is_holiday(year => 2017, month  => 6, day => 24)) {
    print "Yes it is a Catalan holiday\n";
}

my $holidays = $dh->holidays( year => 2006);

I plan to discontinue the nocheck parameter for something more elegant, more on this in a future release.

@miquelruiz
Copy link
Owner

Re-enabled tests in 5d28195

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants