Skip to content

Commit

Permalink
Drop support for Elixir v1.2
Browse files Browse the repository at this point in the history
lexmag committed Apr 27, 2020
1 parent 0b0dad2 commit 17842ab
Showing 3 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -21,4 +21,4 @@ jobs:
- otp_release: 20.3
elixir: 1.6
- otp_release: 21.0
elixir: 1.7
elixir: 1.7
15 changes: 2 additions & 13 deletions lib/fluxter/conn.ex
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ defmodule Fluxter.Conn do
defstruct [:sock, :header]

def new(host, port) when is_binary(host) do
new(string_to_charlist(host), port)
new(String.to_charlist(host), port)
end

def new(host, port) when is_list(host) or is_tuple(host) do
@@ -25,12 +25,7 @@ defmodule Fluxter.Conn do

def write(worker, name, tags, fields)
when (is_binary(name) or is_list(name)) and is_list(tags) and is_list(fields) do
# TODO: Remove `try` wrapping when we depend on Elixir ~> 1.3
try do
GenServer.cast(worker, {:write, name, tags, fields})
catch
_, _ -> :ok
end
GenServer.cast(worker, {:write, name, tags, fields})
end

def init(conn) do
@@ -58,10 +53,4 @@ defmodule Fluxter.Conn do

{:noreply, conn}
end

if Version.match?(System.version(), ">= 1.3.0") do
defp string_to_charlist(string), do: String.to_charlist(string)
else
defp string_to_charlist(string), do: String.to_char_list(string)
end
end
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ defmodule Fluxter.Mixfile do
app: :fluxter,
name: "Fluxter",
version: "0.8.1",
elixir: "~> 1.2",
elixir: "~> 1.3",
package: package(),
description: desc(),
deps: deps()

0 comments on commit 17842ab

Please sign in to comment.