diff --git a/lib/maxmind_database.rb b/lib/maxmind_database.rb index fd07df948..6affe8370 100644 --- a/lib/maxmind_database.rb +++ b/lib/maxmind_database.rb @@ -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) @@ -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