Skip to content

Commit

Permalink
Use CACHE_DIR instead of CACHEDIR
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Mar 11, 2024
1 parent a24693b commit 27ea662
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
5 changes: 4 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Revision history for Geo::Coder::Abbreviations

0.07
0.08
Use CACHE_DIR instead of CACHEDIR
Default cache location is now ~/.cache instead of /tmp/cache
0.07 Tue Feb 27 11:07:01 EST 2024
Added normalize()

0.06 Thu Jun 8 10:26:44 EDT 2023
Expand Down
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Geo-Coder-Abbreviation Release 0.06
Geo-Coder-Abbreviation Release 0.07

INSTALLATION

Expand Down Expand Up @@ -33,6 +33,6 @@ You can also look for information at:

LICENSE AND COPYRIGHT

Copyright (C) 2020-2023 Nigel Horne
Copyright (C) 2020-2024 Nigel Horne

This program is released under the following licence: GPL2
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Geo::Coder::Abbreviations - Quick and Dirty Interface to https://github.com/mapb

# VERSION

Version 0.06
Version 0.07

# SYNOPSIS

Expand All @@ -31,6 +31,10 @@ Abbreviate a place.
print $abbr->abbreviate('Road'), "\n"; # prints 'RD'
print $abbr->abbreviate('RD'), "\n"; # prints 'RD'

## normalize

Normalize and abbreviate street names - useful for comparisons

# SEE ALSO

[https://github.com/mapbox/geocoder-abbreviations](https://github.com/mapbox/geocoder-abbreviations)
Expand Down Expand Up @@ -66,6 +70,6 @@ You can also look for information at:

# LICENSE AND COPYRIGHT

Copyright 2020-2023 Nigel Horne.
Copyright 2020-2024 Nigel Horne.

This program is released under the following licence: GPL2
10 changes: 6 additions & 4 deletions lib/Geo/Coder/Abbreviations.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ Geo::Coder::Abbreviations - Quick and Dirty Interface to https://github.com/mapb
=head1 VERSION
Version 0.06
Version 0.07
=cut

our %abbreviations;
our $VERSION = '0.06';
our $VERSION = '0.07';

# This is giving 404 errors at the moment
# https://github.com/mapbox/mapbox-java/issues/1460
Expand Down Expand Up @@ -65,10 +65,12 @@ sub new {
HTTP::Cache::Transparent->import();

my $cachedir;
if(my $e = $ENV{'CACHEDIR'}) {
if(my $e = $ENV{'CACHE_DIR'}) {
mkdir $cachedir, 02700 if(!-d $cachedir);
$cachedir = File::Spec->catfile($e, 'http-cache-transparent');
} else {
$cachedir = File::Spec->catfile(File::Spec->tmpdir(), 'cache', 'http-cache-transparent');
# $cachedir = File::Spec->catfile(File::Spec->tmpdir(), 'cache', 'http-cache-transparent');
$cachedir = File::Spec->catfile(File::HomeDir->my_home(), '.cache', 'http-cache-transparent');
}

HTTP::Cache::Transparent::init({
Expand Down

0 comments on commit 27ea662

Please sign in to comment.