Current section

22 Versions

Jump to

Compare versions

4 files changed
+21 additions
-31 deletions
  @@ -1,21 +1,21 @@
1 - {<<"app">>,<<"uxid">>}.
2 - {<<"build_tools">>,[<<"mix">>]}.
3 - {<<"description">>,
4 - <<"Generates identifiers like: cus_01EPEY1JMKXVBT and txn_01EPEY2P06TR1RTV07XA82ZGJJ. Includes Ecto type.">>}.
5 - {<<"elixir">>,<<"~> 1.8">>}.
6 - {<<"files">>,
7 - [<<"lib">>,<<"lib/uxid.ex">>,<<"lib/uxid">>,<<"lib/uxid/encoder.ex">>,
8 - <<"lib/uxid/ecto.ex">>,<<".formatter.exs">>,<<"mix.exs">>,<<"README.md">>,
9 - <<"LICENSE">>,<<"CHANGELOG.md">>]}.
10 - {<<"licenses">>,[<<"MIT">>]}.
11 1 {<<"links">>,
12 2 [{<<"GitHub">>,<<"https://github.com/riddler/uxid-ex">>},
13 3 {<<"UXID Project">>,<<"https://github.com/riddler/uxid">>}]}.
14 4 {<<"name">>,<<"uxid">>}.
5 + {<<"version">>,<<"1.0.0">>}.
6 + {<<"description">>,
7 + <<"Generates identifiers like: cus_01EPEY1JMKXVBT and txn_01EPEY2P06TR1RTV07XA82ZGJJ. Includes Ecto type.">>}.
8 + {<<"elixir">>,<<"~> 1.8">>}.
9 + {<<"app">>,<<"uxid">>}.
10 + {<<"licenses">>,[<<"MIT">>]}.
15 11 {<<"requirements">>,
16 - [[{<<"app">>,<<"ecto">>},
17 - {<<"name">>,<<"ecto">>},
12 + [[{<<"name">>,<<"ecto">>},
13 + {<<"app">>,<<"ecto">>},
18 14 {<<"optional">>,true},
19 - {<<"repository">>,<<"hexpm">>},
20 - {<<"requirement">>,<<"~> 3.5">>}]]}.
21 - {<<"version">>,<<"0.2.3">>}.
15 + {<<"requirement">>,<<"~> 3.12">>},
16 + {<<"repository">>,<<"hexpm">>}]]}.
17 + {<<"files">>,
18 + [<<"lib">>,<<"lib/uxid.ex">>,<<"lib/uxid">>,<<"lib/uxid/encoder.ex">>,
19 + <<"lib/uxid/ecto.ex">>,<<".formatter.exs">>,<<"mix.exs">>,<<"README.md">>,
20 + <<"LICENSE">>,<<"CHANGELOG.md">>]}.
21 + {<<"build_tools">>,[<<"mix">>]}.
  @@ -64,8 +64,8 @@ defmodule UXID do
64 64 {:ok, %__MODULE__{string: string}} ->
65 65 {:ok, string}
66 66
67 - {:error, error} ->
68 - {:error, error}
67 + _other ->
68 + {:error, "Unknown error"}
69 69 end
70 70 end
71 71
  @@ -97,16 +97,6 @@ defmodule UXID do
97 97 time: timestamp
98 98 }
99 99 |> Encoder.process()
100 - |> case do
101 - {:ok, %__MODULE__{string: string} = struct} when not is_nil(string) ->
102 - {:ok, struct}
103 -
104 - {:error, error} ->
105 - {:error, error}
106 -
107 - :error ->
108 - {:error, "Unknown error occurred"}
109 - end
110 100 end
111 101
112 102 # Define additional functions for custom Ecto type if Ecto is loaded
  @@ -16,7 +16,7 @@ if Code.ensure_loaded?(Ecto) do
16 16 end
17 17
18 18 def init(opts) do
19 - Logger.warn(
19 + Logger.warning(
20 20 "Ecto.UXID is deprecated and will be removed in a future version. Please use UXID istead."
21 21 )
22 22
  @@ -36,7 +36,7 @@ if Code.ensure_loaded?(Ecto) do
36 36 end
37 37
38 38 def autogenerate(opts) do
39 - Logger.warn(
39 + Logger.warning(
40 40 "Ecto.UXID is deprecated and will be removed in a future version. Please use UXID istead."
41 41 )
  @@ -4,13 +4,13 @@ defmodule UXID.MixProject do
4 4 @name "UXID"
5 5 @app :uxid
6 6 @description "Generates identifiers like: cus_01EPEY1JMKXVBT and txn_01EPEY2P06TR1RTV07XA82ZGJJ. Includes Ecto type."
7 - @version "0.2.3"
7 + @version "1.0.0"
8 8
9 9 @deps [
10 10 # Required
11 11
12 12 # Optional
13 - {:ecto, "~> 3.5", optional: true},
13 + {:ecto, "~> 3.12", optional: true},
14 14
15 15 # Development, Documentation, Testing, ...
16 16 {:ex_doc, "~> 0.23", only: :dev},