API-Drip-Request
view release on metacpan or search on metacpan
lib/API/Drip/Request.pm view on Meta::CPAN
foreach my $key ( keys %DEFAULTS ) {
next KEY if defined $OPT->{$key};
if ( defined $ENV{$key} ) { $conf->{$key} = $ENV{$key}; next KEY; }
state $YAML_CONF //= _load_yaml_conf( $OPT );
if ( defined $YAML_CONF->{$key} ) { $conf->{$key} = $YAML_CONF->{$key}; next KEY; }
$conf->{$key} = $DEFAULTS{$key};
}
return $conf;
}
sub _load_yaml_conf {
my $OPT = shift();
FILE:
foreach my $location( $OPT->{DRIP_CLIENT_CONF}, $ENV{DRIP_CLIENT_CONF}, File::Spec->catfile( File::HomeDir->my_home, '.drip.conf' )) {
no warnings 'uninitialized';
next FILE unless -f $location && -r _;
return YAML::LoadFile $location;
}
}
=head1 AUTHOR
Dan Wright, C<< <Dan at DWright.Org> >>
=head1 BUGS
Please report bugs as an issue via GitHub L<https://github.com/dwright/API-Drip/issues>.
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc API::Drip::Request
You can also look for information at:
=over 4
=item * Github repository (please report bugs here)
L<https://github.com/dwright/API-Drip>
=item * RT: CPAN's request tracker (not recommended)
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=API-Drip>
=item * AnnoCPAN: Annotated CPAN documentation
L<http://annocpan.org/dist/API-Drip>
=item * CPAN Ratings
L<http://cpanratings.perl.org/d/API-Drip>
=item * Search CPAN
L<http://search.cpan.org/dist/API-Drip/>
=back
=head1 ACKNOWLEDGEMENTS
This code is written to help support my day job and is being released open
source thanks to pair Networks, Inc.
=head1 LICENSE AND COPYRIGHT
Copyright 2017 Dan Wright.
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See L<http://dev.perl.org/licenses/> for more information.
=cut
1; # End of API::Drip::Request
( run in 0.836 second using v1.01-cache-2.11-cpan-e1769b4cff6 )