Skip to content

Commit a9cbd66

Browse files
deprecate decimal version 1
1 parent 314fedb commit a9cbd66

File tree

3 files changed

+3
-16
lines changed

3 files changed

+3
-16
lines changed

lib/kaffy/resource_query.ex

-14
Original file line numberDiff line numberDiff line change
@@ -136,21 +136,7 @@ defmodule Kaffy.ResourceQuery do
136136

137137
{term, term_type} =
138138
case Decimal.parse(term) do
139-
{:ok, value} ->
140-
# this is the return value for the decimal package pre-2.0
141-
number = if value.exp >= 0, do: :integer, else: :decimal
142-
143-
case number do
144-
:integer ->
145-
v = Decimal.to_integer(value) |> to_string()
146-
{v, number}
147-
148-
:decimal ->
149-
{term, number}
150-
end
151-
152139
{value, ""} ->
153-
# this is the return value for the decimal package since 2.0
154140
number = if Decimal.integer?(value), do: :integer, else: :decimal
155141

156142
case number do

mix.exs

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ defmodule Kaffy.MixProject do
4242
{:mock, "~> 0.3.3", only: :test},
4343
{:ecto, "~> 3.0"},
4444
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
45-
{:jason, "~> 1.3", only: :test}
45+
{:jason, "~> 1.3", only: :test},
46+
{:decimal, "~> 2.2", optional: true}
4647
]
4748
end
4849

mix.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
%{
22
"castore": {:hex, :castore, "1.0.5", "9eeebb394cc9a0f3ae56b813459f990abb0a3dedee1be6b27fdb50301930502f", [:mix], [], "hexpm", "8d7c597c3e4a64c395980882d4bca3cebb8d74197c590dc272cfd3b6a6310578"},
3-
"decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},
3+
"decimal": {:hex, :decimal, "2.2.0", "df3d06bb9517e302b1bd265c1e7f16cda51547ad9d99892049340841f3e15836", [:mix], [], "hexpm", "af8daf87384b51b7e611fb1a1f2c4d4876b65ef968fa8bd3adf44cff401c7f21"},
44
"earmark_parser": {:hex, :earmark_parser, "1.4.33", "3c3fd9673bb5dcc9edc28dd90f50c87ce506d1f71b70e3de69aa8154bc695d44", [:mix], [], "hexpm", "2d526833729b59b9fdb85785078697c72ac5e5066350663e5be6a1182da61b8f"},
55
"ecto": {:hex, :ecto, "3.10.3", "eb2ae2eecd210b4eb8bece1217b297ad4ff824b4384c0e3fdd28aaf96edd6135", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "44bec74e2364d491d70f7e42cd0d690922659d329f6465e89feb8a34e8cd3433"},
66
"ex_doc": {:hex, :ex_doc, "0.30.6", "5f8b54854b240a2b55c9734c4b1d0dd7bdd41f71a095d42a70445c03cf05a281", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "bd48f2ddacf4e482c727f9293d9498e0881597eae6ddc3d9562bd7923375109f"},

0 commit comments

Comments
 (0)