Skip to content

Commit 650b6e4

Browse files
sgessabitwalker
authored andcommitted
Fix deprecation warnings
1 parent 15a4d04 commit 650b6e4

File tree

8 files changed

+13
-10
lines changed

8 files changed

+13
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1313
- Add Croatian translation
1414
- Changed charlists from the deprecated `''` to `~c""`
1515
- Changed negative range to pass the step of default value for suppressing deprecation warnings
16+
- Update Gettext to 0.26
1617

1718
### Fixed
1819

1920
- Updated `Timex.now/1` typespec to remove the `AmbiguousDateTime`
2021
- Corrected pluralization rules for bg/cs/he/id/ro/ru
2122
- Fixed documentation formatting of `Timex.TimezoneInfo.create/6`
2223
- Updated tzdata to fix issues with 2024b
24+
- Fix deprecation: Module.eval_quoted/4 is deprecated. Use Code.eval_quoted/3 instead
25+
- Fix deprecation: "min..max inside match is deprecated"
2326

2427
---
2528

lib/format/datetime/formatter.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,6 @@ defmodule Timex.Format.DateTime.Formatter do
890890
defp pad_char(:zeroes), do: <<?0>>
891891
defp pad_char(:spaces), do: <<32>>
892892

893-
defp width_spec(min..max), do: [min: min, max: max]
893+
defp width_spec(min..max//1), do: [min: min, max: max]
894894
defp width_spec(min, max), do: [min: min, max: max]
895895
end

lib/l10n/gettext.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
defmodule Timex.Gettext do
2-
use Gettext, otp_app: :timex, priv: "priv/translations"
2+
use Gettext.Backend, otp_app: :timex, priv: "priv/translations"
33
end

lib/l10n/translator.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
defmodule Timex.Translator do
2-
import Timex.Gettext
2+
use Gettext, backend: Timex.Gettext
33

44
defmacro with_locale(locale, do: block) do
55
quote do

lib/timex.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ defmodule Timex do
12021202
def day_to_num(unquote(atom)), do: unquote(day_num)
12031203
end
12041204

1205-
Module.eval_quoted(__MODULE__, day_quoted, [], __ENV__)
1205+
Code.eval_quoted(day_quoted, [], __ENV__)
12061206
end)
12071207

12081208
# Make an attempt at cleaning up the provided string
@@ -1300,7 +1300,7 @@ defmodule Timex do
13001300
end
13011301
end
13021302

1303-
Module.eval_quoted(__MODULE__, month_quoted, [], __ENV__)
1303+
Code.eval_quoted(month_quoted, [], __ENV__)
13041304
end)
13051305

13061306
# Make an attempt at cleaning up the provided string

lib/timezone/utils.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ defmodule Timex.Timezone.Utils do
1919
def to_olson(unquote(key)), do: unquote(value)
2020
end
2121

22-
Module.eval_quoted(__MODULE__, quoted, [], __ENV__)
22+
Code.eval_quoted(quoted, [], __ENV__)
2323
end)
2424

2525
def to_olson(_tz), do: nil
@@ -39,7 +39,7 @@ defmodule Timex.Timezone.Utils do
3939
def olson_to_win(unquote(key)), do: unquote(value)
4040
end
4141

42-
Module.eval_quoted(__MODULE__, quoted, [], __ENV__)
42+
Code.eval_quoted(quoted, [], __ENV__)
4343
end)
4444

4545
def olson_to_win(_tz), do: nil

mix.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ defmodule Timex.Mixfile do
5757
[
5858
{:tzdata, "~> 1.1"},
5959
{:combine, "~> 0.10"},
60-
{:gettext, "~> 0.20"},
60+
{:gettext, "~> 0.26"},
6161
{:ex_doc, "~> 0.13", only: [:docs]},
6262
{:benchfella, "~> 0.3", only: [:bench]},
6363
{:dialyxir, "~> 1.0", only: [:dev], runtime: false},
6464
{:excoveralls, "~> 0.4", only: [:test]},
65-
{:stream_data, "~> 0.4", only: [:test]}
65+
{:stream_data, "~> 1.1", only: [:test]}
6666
]
6767
end
6868

mix.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"},
2121
"parse_trans": {:hex, :parse_trans, "3.4.1", "6e6aa8167cb44cc8f39441d05193be6e6f4e7c2946cb2759f015f8c56b76e5ff", [:rebar3], [], "hexpm", "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"},
2222
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"},
23-
"stream_data": {:hex, :stream_data, "0.6.0", "e87a9a79d7ec23d10ff83eb025141ef4915eeb09d4491f79e52f2562b73e5f47", [:mix], [], "hexpm", "b92b5031b650ca480ced047578f1d57ea6dd563f5b57464ad274718c9c29501c"},
23+
"stream_data": {:hex, :stream_data, "1.2.0", "58dd3f9e88afe27dc38bef26fce0c84a9e7a96772b2925c7b32cd2435697a52b", [:mix], [], "hexpm", "eb5c546ee3466920314643edf68943a5b14b32d1da9fe01698dc92b73f89a9ed"},
2424
"tzdata": {:hex, :tzdata, "1.1.3", "b1cef7bb6de1de90d4ddc25d33892b32830f907e7fc2fccd1e7e22778ab7dfbc", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "d4ca85575a064d29d4e94253ee95912edfb165938743dbf002acdf0dcecb0c28"},
2525
"unicode_util_compat": {:hex, :unicode_util_compat, "0.7.1", "a48703a25c170eedadca83b11e88985af08d35f37c6f664d6dcfb106a97782fc", [:rebar3], [], "hexpm", "b3a917854ce3ae233619744ad1e0102e05673136776fb2fa76234f3e03b23642"},
2626
}

0 commit comments

Comments
 (0)