Skip to content

Commit

Permalink
Merge pull request #1652 from alexreisner/make-archive-edition-public
Browse files Browse the repository at this point in the history
Make `Geocoder::MaxmindDatabase.archive_edition` Method Public
  • Loading branch information
alexreisner authored Apr 7, 2024
2 parents 0ea4526 + efe713e commit 05faae3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/maxmind_database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ def archive_filename(package)
p[s..-1]
end

def archive_edition(package)
{
geolite_country_csv: "GeoLite2-Country-CSV",
geolite_city_csv: "GeoLite2-City-CSV",
geolite_asn_csv: "GeoLite2-ASN-CSV"
}[package]
end

private # -------------------------------------------------------------

def table_columns(table_name)
Expand Down Expand Up @@ -94,14 +102,6 @@ def archive_url(package)
base_url + archive_url_path(package)
end

def archive_edition(package)
{
geolite_country_csv: "GeoLite2-Country-CSV",
geolite_city_csv: "GeoLite2-City-CSV",
geolite_asn_csv: "GeoLite2-ASN-CSV"
}[package]
end

def base_url(edition)
"https://download.maxmind.com/app/geoip_download?edition_id=#{edition}&license_key=#{ENV['LICENSE_KEY']}&suffix=zip"
end
Expand Down

0 comments on commit 05faae3

Please sign in to comment.