Skip to content

Commit

Permalink
Rename database_version/0 to iana_version/0
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieuprog committed Jun 25, 2021
1 parent bdbe7cf commit cddcb68
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/compiler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ defmodule Tz.Compiler do
quote do
@moduledoc(false)

def database_version() do
def iana_version() do
unquote(tzdata_version)
end
end,
Expand Down
2 changes: 1 addition & 1 deletion lib/tz.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule Tz do
alias Tz.PeriodsProvider

defdelegate database_version(), to: PeriodsProvider
defdelegate iana_version(), to: PeriodsProvider
end
2 changes: 1 addition & 1 deletion lib/updater.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defmodule Tz.Updater do

saved_tz_version = get_latest_tz_database()

if saved_tz_version != PeriodsProvider.database_version() do
if saved_tz_version != PeriodsProvider.iana_version() do
Logger.info("Tz is recompiling time zone periods...")
Code.compiler_options(ignore_module_conflict: true)
Compiler.compile()
Expand Down
2 changes: 1 addition & 1 deletion lib/watch_periodically.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule Tz.WatchPeriodically do

case Updater.fetch_iana_tz_version() do
{:ok, latest_version} ->
if latest_version != PeriodsProvider.database_version() do
if latest_version != PeriodsProvider.iana_version() do
link = "https://data.iana.org/time-zones/releases/tzdata#{latest_version}.tar.gz"
Logger.warn("Tz found a more recent time zone database available for download at #{link}")
end
Expand Down
2 changes: 1 addition & 1 deletion test/time_zone_database_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ defmodule TimeZoneDatabaseTest do
end

test "version" do
assert "2021a" == Tz.database_version()
assert "2021a" == Tz.iana_version()
end
end

0 comments on commit cddcb68

Please sign in to comment.