diff --git a/.travis.yml b/.travis.yml index f1b202b..5f2b450 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: elixir elixir: - - 1.4 - 1.5 - 1.6 - 1.7 @@ -20,12 +19,10 @@ matrix: otp_release: 19.3 - elixir: 1.8 otp_release: 19.3 - - elixir: 1.4 - otp_release: 21 - elixir: 1.5 - otp_release: 21 + otp_release: 21.0 - elixir: 1.6 - otp_release: 21 + otp_release: 21.0 before_script: - "export DISPLAY=:99.0" diff --git a/lib/hound/connection_server.ex b/lib/hound/connection_server.ex index 8d9c2ff..5db405c 100644 --- a/lib/hound/connection_server.ex +++ b/lib/hound/connection_server.ex @@ -1,5 +1,6 @@ defmodule Hound.ConnectionServer do @moduledoc false + use Agent def start_link(options \\ []) do driver = options[:driver] || Application.get_env(:hound, :driver, "selenium") diff --git a/lib/hound/session_server.ex b/lib/hound/session_server.ex index c8de347..1bf6e42 100644 --- a/lib/hound/session_server.ex +++ b/lib/hound/session_server.ex @@ -4,7 +4,7 @@ defmodule Hound.SessionServer do use GenServer @name __MODULE__ - def start_link do + def start_link(_options) do GenServer.start_link(__MODULE__, %{}, name: @name) end diff --git a/lib/hound/supervisor.ex b/lib/hound/supervisor.ex index 0ba3ca3..9927847 100644 --- a/lib/hound/supervisor.ex +++ b/lib/hound/supervisor.ex @@ -4,18 +4,18 @@ defmodule Hound.Supervisor do use Supervisor def start_link(options \\ []) do - :supervisor.start_link(__MODULE__, [options]) + Supervisor.start_link(__MODULE__, options, name: __MODULE__) end - - def init([options]) do + @impl true + def init(options) do children = [ - worker(Hound.ConnectionServer, [options]), - worker(Hound.SessionServer, []) + {Hound.ConnectionServer, options}, + Hound.SessionServer ] - # See http://elixir-lang.org/docs/stable/Supervisor.Behaviour.html + # See https://hexdocs.pm/elixir/master/Supervisor.html#content # for other strategies and supported options - supervise(children, strategy: :one_for_one) + Supervisor.init(children, strategy: :one_for_one) end end diff --git a/mix.exs b/mix.exs index 4831a49..d5590b6 100644 --- a/mix.exs +++ b/mix.exs @@ -6,7 +6,7 @@ defmodule Hound.Mixfile do def project do [ app: :hound, version: @version, - elixir: ">= 1.4.0", + elixir: ">= 1.5.0", description: "Webdriver library for integration testing and browser automation", source_url: "https://github.com/HashNuke/hound", deps: deps(),