Improve the docs for non temporary restart in Task.Supervisor

Closes #6247

defmodule Task.Supervisor do
  @moduledoc """
  A task supervisor.

  This module defines a supervisor which can be used to dynamically
  supervise tasks.

  `start_link/1` can be used to start the supervisor. See the `Task`
  module for more examples.

  ## Name registration

  A `Task.Supervisor` is bound to the same name registration rules as a
  `GenServer`. Read more about them in the `GenServer` docs.
  """

  @typedoc "Option values used by `start_link`"
  @type option :: Supervisor.option |
                  {:restart, :supervisor.restart} |
                  {:shutdown, :supervisor.shutdown}

  @doc false
  def child_spec(arg) do
    %{
      id: Task.Supervivsor,
      start: {Task.Supervisor, :start_link, [arg]},
      type: :supervisor
    }
  end

  @doc """
  Starts a new supervisor.

  The supported options are:

    * `:name` - used to register a supervisor name, the supported values are
      described under the `Name Registration` section in the `GenServer` module
      docs;

    * `:restart` - the restart strategy, may be `:temporary` (the default),
      `:transient` or `:permanent`. `:temporary` means the task is never
      restarted, `:transient` means it is restarted if the exit is not
      `:normal`, `:shutdown` or `{:shutdown, reason}`. A `:permanent` restart
      strategy means it is always restarted. It defaults to `:temporary` so
      tasks aren't automatically restarted when they complete nor in case of
      crashes. Note the `:async` functions in this module support only `:temporary`
      restarts;

    * `:shutdown` - `:brutal_kill` if the tasks must be killed directly on shutdown
      or an integer indicating the timeout value, defaults to 5000 milliseconds;

    * `:max_restarts` and `:max_seconds` - as specified in `Supervisor`;

  """
  @spec start_link([option]) :: Supervisor.on_start
  def start_link(opts \\ []) do
    {restart, opts}  = Keyword.pop(opts, :restart, :temporary)
    {shutdown, opts} = Keyword.pop(opts, :shutdown, 5000)
    child = %{
      id: Task.Supervised,
      start: {Task.Supervised, :start_link, []},
      restart: restart,
      shutdown: shutdown
    }
    Supervisor.start_link([child], [strategy: :simple_one_for_one] ++ opts)
  end

  @doc """
  Starts a task that can be awaited on.

  The `supervisor` must be a reference as defined in `Task.Supervisor`.
  The task will still be linked to the caller, see `Task.async/3` for
  more information and `async_nolink/2` for a non-linked variant.

  Note this function requires the task supervisor to have `:temporary`
  as the `:restart` option (the default), as `async/2` keeps a direct
  reference to the task which is lost if the task is restarted.
  """
  @spec async(Supervisor.supervisor, (() -> any)) :: Task.t
  def async(supervisor, fun) do
    async(supervisor, :erlang, :apply, [fun, []])
  end

  @doc """
  Starts a task that can be awaited on.

  The `supervisor` must be a reference as defined in `Task.Supervisor`.
  The task will still be linked to the caller, see `Task.async/3` for
  more information and `async_nolink/2` for a non-linked variant.

  Note this function requires the task supervisor to have `:temporary`
  as the `:restart` option (the default), as `async/4` keeps a direct
  reference to the task which is lost if the task is restarted.
  """
  @spec async(Supervisor.supervisor, module, atom, [term]) :: Task.t
  def async(supervisor, module, fun, args) do
    do_async(supervisor, :link, module, fun, args)
  end

  @doc """
  Starts a task that can be awaited on.

  The `supervisor` must be a reference as defined in `Task.Supervisor`.
  The task won't be linked to the caller, see `Task.async/3` for
  more information.

  Note this function requires the task supervisor to have `:temporary`
  as the `:restart` option (the default), as `async_nolink/2` keeps a
  direct reference to the task which is lost if the task is restarted.

  ## Compatibility with OTP behaviours

  If you create a task using `async_nolink` inside an OTP behaviour
  like `GenServer`, you should match on the message coming from the
  task inside your `c:GenServer.handle_info/2` callback.

  The reply sent by the task will be in the format `{ref, result}`,
  where `ref` is the monitor reference held by the task struct
  and `result` is the return value of the task function.

  Keep in mind that, regardless of how the task created with `async_nolink`
  terminates, the caller's process will always receive a `:DOWN` message
  with the same `ref` value that is held by the task struct. If the task
  terminates normally, the reason in the `:DOWN` message will be `:normal`.
  """
  @spec async_nolink(Supervisor.supervisor, (() -> any)) :: Task.t
  def async_nolink(supervisor, fun) do
    async_nolink(supervisor, :erlang, :apply, [fun, []])
  end

  @doc """
  Starts a task that can be awaited on.

  The `supervisor` must be a reference as defined in `Task.Supervisor`.
  The task won't be linked to the caller, see `Task.async/3` for
  more information.

  Note this function requires the task supervisor to have `:temporary`
  as the `:restart` option (the default), as `async_nolink/4` keeps a
  direct reference to the task which is lost if the task is restarted.
  """
  @spec async_nolink(Supervisor.supervisor, module, atom, [term]) :: Task.t
  def async_nolink(supervisor, module, fun, args) do
    do_async(supervisor, :nolink, module, fun, args)
  end

  @doc """
  Returns a stream that runs the given `module`, `function`, and `args`
  concurrently on each item in `enumerable`.

  Each item will be prepended to the given `args` and processed by its
  own task. The tasks will be spawned under the given `supervisor` and
  linked to the current process, similarly to `async/4`.

  When streamed, each task will emit `{:ok, value}` upon successful
  completion or `{:exit, reason, element}` if the caller is trapping
  exits, where `element` is the stream element. Results are emitted
  in the same order as the original `enumerable`.

  The level of concurrency can be controlled via the `:max_concurrency`
  option and defaults to `System.schedulers_online/0`. A timeout
  can also be given as an option representing the maximum amount of
  time to wait without a task reply.

  Note this function requires the task supervisor to have `:temporary`
  as the `:restart` option (the default), as `async_stream/6` keeps a
  direct reference to the task which is lost if the task is restarted.

  Finally, if you find yourself trapping exits to handle exits inside
  the async stream, consider using `async_stream_nolink/6` to start tasks
  that are not linked to the current process.

  ## Options

    * `:max_concurrency` - sets the maximum number of tasks to run
      at the same time. Defaults to `System.schedulers_online/0`.
    * `:ordered` - whether the results should be returned in the same order
      as the input stream. This option is useful when you have large
      streams and don't want to buffer results before they are delivered.
      Defaults to `true`.
    * `:timeout` - the maximum amount of time to wait (in milliseconds)
      without receiving a task reply (across all running tasks).
      Defaults to `5000`.
    * `:on_timeout` - what do to when a task times out. The possible
      values are:
      * `:exit` (default) - the process that spawned the tasks exits.
      * `:kill_task` - the task that timed out is killed. The value
        emitted for that task is `{:exit, :timeout, element}`, where
        `element` is the element it timed out on.

  ## Examples

  Let's build a stream and then enumerate it:

      stream = Task.Supervisor.async_stream(MySupervisor, collection, Mod, :expensive_fun, [])
      Enum.to_list(stream)

  """
  @spec async_stream(Supervisor.supervisor, Enumerable.t, module, atom, [term], keyword) ::
        Enumerable.t
  def async_stream(supervisor, enumerable, module, function, args, options \\ [])
      when is_atom(module) and is_atom(function) and is_list(args) do
    build_stream(supervisor, :link, enumerable, {module, function, args}, options)
  end

  @doc """
  Returns a stream that runs the given function `fun` concurrently
  on each item in `enumerable`.

  Each item in `enumerable` is passed as argument to the given function `fun`
  and processed by its own task. The tasks will be spawned under the given
  `supervisor` and linked to the current process, similarly to `async/2`.

  See `async_stream/6` for discussion, options, and examples.
  """
  @spec async_stream(Supervisor.supervisor, Enumerable.t, (term -> term), keyword) ::
        Enumerable.t
  def async_stream(supervisor, enumerable, fun, options \\ []) when is_function(fun, 1) do
    build_stream(supervisor, :link, enumerable, fun, options)
  end

  @doc """
  Returns a stream that runs the given `module`, `function`, and `args`
  concurrently on each item in `enumerable`.

  Each item in `enumerable` will be prepended to the given `args` and processed
  by its own task. The tasks will be spawned under the given `supervisor` and
  will not be linked to the current process, similarly to `async_nolink/4`.

  See `async_stream/6` for discussion, options, and examples.
  """
  @spec async_stream_nolink(Supervisor.supervisor, Enumerable.t, module, atom, [term], keyword) ::
        Enumerable.t
  def async_stream_nolink(supervisor, enumerable, module, function, args, options \\ [])
      when is_atom(module) and is_atom(function) and is_list(args) do
    build_stream(supervisor, :nolink, enumerable, {module, function, args}, options)
  end

  @doc """
  Returns a stream that runs the given `function` concurrently on each
  item in `enumerable`.

  Each item in `enumerable` is passed as argument to the given function `fun`
  and processed by its own task. The tasks will be spawned under the given
  `supervisor` and linked to the current process, similarly to `async_nolink/2`.

  See `async_stream/6` for discussion and examples.
  """
  @spec async_stream_nolink(Supervisor.supervisor, Enumerable.t, (term -> term), keyword) ::
        Enumerable.t
  def async_stream_nolink(supervisor, enumerable, fun, options \\ []) when is_function(fun, 1) do
    build_stream(supervisor, :nolink, enumerable, fun, options)
  end

  @doc """
  Terminates the child with the given `pid`.
  """
  @spec terminate_child(Supervisor.supervisor, pid) :: :ok
  def terminate_child(supervisor, pid) when is_pid(pid) do
    Supervisor.terminate_child(supervisor, pid)
  end

  @doc """
  Returns all children PIDs.
  """
  @spec children(Supervisor.supervisor) :: [pid]
  def children(supervisor) do
    for {_, pid, _, _} <- Supervisor.which_children(supervisor), is_pid(pid), do: pid
  end

  @doc """
  Starts a task as a child of the given `supervisor`.

  Note that the spawned process is not linked to the caller, but
  only to the supervisor. This command is useful in case the
  task needs to perform side-effects (like I/O) and does not need
  to report back to the caller.
  """
  @spec start_child(Supervisor.supervisor, (() -> any)) :: {:ok, pid}
  def start_child(supervisor, fun) do
    start_child(supervisor, :erlang, :apply, [fun, []])
  end

  @doc """
  Starts a task as a child of the given `supervisor`.

  Similar to `start_child/2` except the task is specified
  by the given `module`, `fun` and `args`.
  """
  @spec start_child(Supervisor.supervisor, module, atom, [term]) :: {:ok, pid}
  def start_child(supervisor, module, fun, args) when is_atom(fun) and is_list(args) do
    Supervisor.start_child(supervisor, [get_info(self()), {module, fun, args}])
  end

  defp get_info(self) do
    {node(),
     case Process.info(self, :registered_name) do
       {:registered_name, []} -> self
       {:registered_name, name} -> name
     end}
  end

  defp do_async(supervisor, link_type, module, fun, args) do
    owner = self()
    args = [owner, :monitor, get_info(owner), {module, fun, args}]
    {:ok, pid} = Supervisor.start_child(supervisor, args)
    if link_type == :link, do: Process.link(pid)
    ref = Process.monitor(pid)
    send pid, {owner, ref}
    %Task{pid: pid, ref: ref, owner: owner}
  end

  defp build_stream(supervisor, link_type, enumerable, fun, options) do
    &Task.Supervised.stream(enumerable, &1, &2, fun, options, fn owner, mfa ->
      args = [owner, :monitor, get_info(owner), mfa]
      {:ok, pid} = Supervisor.start_child(supervisor, args)
      if link_type == :link, do: Process.link(pid)
      {link_type, pid}
    end)
  end
end

defmodule Task.Supervisor do
  @moduledoc """
  A task supervisor.

  This module defines a supervisor which can be used to dynamically
  supervise tasks. Behind the scenes, this module is implemented as a
  `:simple_one_for_one` supervisor where the workers are temporary by
  default (that is, they are not restarted after they die; read the docs
  for `start_link/1` for more information on choosing the restart
  strategy).

  See the `Task` module for more information.

  ## Name registration

  A `Task.Supervisor` is bound to the same name registration rules as a
  `GenServer`. Read more about them in the `GenServer` docs.
  """

  @typedoc "Option values used by `start_link`"
  @type option :: Supervisor.option |
                  {:restart, :supervisor.restart} |
                  {:shutdown, :supervisor.shutdown}

  @doc false
  def child_spec(arg) do
    %{
      id: Task.Supervivsor,
      start: {Task.Supervisor, :start_link, [arg]},
      type: :supervisor
    }
  end

  @doc """
  Starts a new supervisor.

  The supported options are:

  * `:name` - used to register a supervisor name, the supported values are
    described under the `Name Registration` section in the `GenServer` module
    docs;

  * `:restart` - the restart strategy, may be `:temporary` (the default),
    `:transient` or `:permanent`. Check `Supervisor` for more info.
    Defaults to `:temporary` so tasks aren't automatically restarted when
    they complete nor in case of crashes;

  * `:shutdown` - `:brutal_kill` if the tasks must be killed directly on shutdown
    or an integer indicating the timeout value, defaults to 5000 milliseconds;

  * `:max_restarts` and `:max_seconds` - as specified in `Supervisor`;

  """
  @spec start_link([option]) :: Supervisor.on_start
  def start_link(opts \\ []) do
    {restart, opts}  = Keyword.pop(opts, :restart, :temporary)
    {shutdown, opts} = Keyword.pop(opts, :shutdown, 5000)
    child = %{
      id: Task.Supervised,
      start: {Task.Supervised, :start_link, []},
      restart: restart,
      shutdown: shutdown
    }
    Supervisor.start_link([child], [strategy: :simple_one_for_one] ++ opts)
  end

  @doc """
  Starts a task that can be awaited on.

  The `supervisor` must be a reference as defined in `Task.Supervisor`.
  The task will still be linked to the caller, see `Task.async/3` for
  more information and `async_nolink/2` for a non-linked variant.
  """
  @spec async(Supervisor.supervisor, (() -> any)) :: Task.t
  def async(supervisor, fun) do
    async(supervisor, :erlang, :apply, [fun, []])
  end

  @doc """
  Starts a task that can be awaited on.

  The `supervisor` must be a reference as defined in `Task.Supervisor`.
  The task will still be linked to the caller, see `Task.async/3` for
  more information and `async_nolink/2` for a non-linked variant.
  """
  @spec async(Supervisor.supervisor, module, atom, [term]) :: Task.t
  def async(supervisor, module, fun, args) do
    do_async(supervisor, :link, module, fun, args)
  end

  @doc """
  Starts a task that can be awaited on.

  The `supervisor` must be a reference as defined in `Task.Supervisor`.
  The task won't be linked to the caller, see `Task.async/3` for
  more information.

  ## Compatibility with OTP behaviours

  If you create a task using `async_nolink` inside an OTP behaviour
  like `GenServer`, you should match on the message coming from the
  task inside your `c:GenServer.handle_info/2` callback.

  The reply sent by the task will be in the format `{ref, result}`,
  where `ref` is the monitor reference held by the task struct
  and `result` is the return value of the task function.

  Keep in mind that, regardless of how the task created with `async_nolink`
  terminates, the caller's process will always receive a `:DOWN` message
  with the same `ref` value that is held by the task struct. If the task
  terminates normally, the reason in the `:DOWN` message will be `:normal`.
  """
  @spec async_nolink(Supervisor.supervisor, (() -> any)) :: Task.t
  def async_nolink(supervisor, fun) do
    async_nolink(supervisor, :erlang, :apply, [fun, []])
  end

  @doc """
  Starts a task that can be awaited on.

  The `supervisor` must be a reference as defined in `Task.Supervisor`.
  The task won't be linked to the caller, see `Task.async/3` for
  more information.
  """
  @spec async_nolink(Supervisor.supervisor, module, atom, [term]) :: Task.t
  def async_nolink(supervisor, module, fun, args) do
    do_async(supervisor, :nolink, module, fun, args)
  end

  @doc """
  Returns a stream that runs the given `module`, `function`, and `args`
  concurrently on each item in `enumerable`.

  Each item will be prepended to the given `args` and processed by its
  own task. The tasks will be spawned under the given `supervisor` and
  linked to the current process, similarly to `async/4`.

  When streamed, each task will emit `{:ok, value}` upon successful
  completion or `{:exit, reason, element}` if the caller is trapping
  exits, where `element` is the stream element. Results are emitted
  in the same order as the original `enumerable`.

  The level of concurrency can be controlled via the `:max_concurrency`
  option and defaults to `System.schedulers_online/0`. A timeout
  can also be given as an option representing the maximum amount of
  time to wait without a task reply.

  Finally, if you find yourself trapping exits to handle exits inside
  the async stream, consider using `async_stream_nolink/6` to start tasks
  that are not linked to the current process.

  ## Options

    * `:max_concurrency` - sets the maximum number of tasks to run
      at the same time. Defaults to `System.schedulers_online/0`.
    * `:ordered` - whether the results should be returned in the same order
      as the input stream. This option is useful when you have large
      streams and don't want to buffer results before they are delivered.
      Defaults to `true`.
    * `:timeout` - the maximum amount of time to wait (in milliseconds)
      without receiving a task reply (across all running tasks).
      Defaults to `5000`.
    * `:on_timeout` - what do to when a task times out. The possible
      values are:
      * `:exit` (default) - the process that spawned the tasks exits.
      * `:kill_task` - the task that timed out is killed. The value
        emitted for that task is `{:exit, :timeout, element}`, where
        `element` is the element it timed out on.

  ## Examples

  Let's build a stream and then enumerate it:

      stream = Task.Supervisor.async_stream(MySupervisor, collection, Mod, :expensive_fun, [])
      Enum.to_list(stream)

  """
  @spec async_stream(Supervisor.supervisor, Enumerable.t, module, atom, [term], keyword) ::
        Enumerable.t
  def async_stream(supervisor, enumerable, module, function, args, options \\ [])
      when is_atom(module) and is_atom(function) and is_list(args) do
    build_stream(supervisor, :link, enumerable, {module, function, args}, options)
  end

  @doc """
  Returns a stream that runs the given function `fun` concurrently
  on each item in `enumerable`.

  Each item in `enumerable` is passed as argument to the given function `fun`
  and processed by its own task. The tasks will be spawned under the given
  `supervisor` and linked to the current process, similarly to `async/2`.

  See `async_stream/6` for discussion, options, and examples.
  """
  @spec async_stream(Supervisor.supervisor, Enumerable.t, (term -> term), keyword) ::
        Enumerable.t
  def async_stream(supervisor, enumerable, fun, options \\ []) when is_function(fun, 1) do
    build_stream(supervisor, :link, enumerable, fun, options)
  end

  @doc """
  Returns a stream that runs the given `module`, `function`, and `args`
  concurrently on each item in `enumerable`.

  Each item in `enumerable` will be prepended to the given `args` and processed
  by its own task. The tasks will be spawned under the given `supervisor` and
  will not be linked to the current process, similarly to `async_nolink/4`.

  See `async_stream/6` for discussion, options, and examples.
  """
  @spec async_stream_nolink(Supervisor.supervisor, Enumerable.t, module, atom, [term], keyword) ::
        Enumerable.t
  def async_stream_nolink(supervisor, enumerable, module, function, args, options \\ [])
      when is_atom(module) and is_atom(function) and is_list(args) do
    build_stream(supervisor, :nolink, enumerable, {module, function, args}, options)
  end

  @doc """
  Returns a stream that runs the given `function` concurrently on each
  item in `enumerable`.

  Each item in `enumerable` is passed as argument to the given function `fun`
  and processed by its own task. The tasks will be spawned under the given
  `supervisor` and linked to the current process, similarly to `async_nolink/2`.

  See `async_stream/6` for discussion and examples.
  """
  @spec async_stream_nolink(Supervisor.supervisor, Enumerable.t, (term -> term), keyword) ::
        Enumerable.t
  def async_stream_nolink(supervisor, enumerable, fun, options \\ []) when is_function(fun, 1) do
    build_stream(supervisor, :nolink, enumerable, fun, options)
  end

  @doc """
  Terminates the child with the given `pid`.
  """
  @spec terminate_child(Supervisor.supervisor, pid) :: :ok
  def terminate_child(supervisor, pid) when is_pid(pid) do
    Supervisor.terminate_child(supervisor, pid)
  end

  @doc """
  Returns all children PIDs.
  """
  @spec children(Supervisor.supervisor) :: [pid]
  def children(supervisor) do
    for {_, pid, _, _} <- Supervisor.which_children(supervisor), is_pid(pid), do: pid
  end

  @doc """
  Starts a task as a child of the given `supervisor`.

  Note that the spawned process is not linked to the caller, but
  only to the supervisor. This command is useful in case the
  task needs to perform side-effects (like I/O) and does not need
  to report back to the caller.
  """
  @spec start_child(Supervisor.supervisor, (() -> any)) :: {:ok, pid}
  def start_child(supervisor, fun) do
    start_child(supervisor, :erlang, :apply, [fun, []])
  end

  @doc """
  Starts a task as a child of the given `supervisor`.

  Similar to `start_child/2` except the task is specified
  by the given `module`, `fun` and `args`.
  """
  @spec start_child(Supervisor.supervisor, module, atom, [term]) :: {:ok, pid}
  def start_child(supervisor, module, fun, args) when is_atom(fun) and is_list(args) do
    Supervisor.start_child(supervisor, [get_info(self()), {module, fun, args}])
  end

  defp get_info(self) do
    {node(),
     case Process.info(self, :registered_name) do
       {:registered_name, []} -> self
       {:registered_name, name} -> name
     end}
  end

  defp do_async(supervisor, link_type, module, fun, args) do
    owner = self()
    args = [owner, :monitor, get_info(owner), {module, fun, args}]
    {:ok, pid} = Supervisor.start_child(supervisor, args)
    if link_type == :link, do: Process.link(pid)
    ref = Process.monitor(pid)
    send pid, {owner, ref}
    %Task{pid: pid, ref: ref, owner: owner}
  end

  defp build_stream(supervisor, link_type, enumerable, fun, options) do
    &Task.Supervised.stream(enumerable, &1, &2, fun, options, fn owner, mfa ->
      args = [owner, :monitor, get_info(owner), mfa]
      {:ok, pid} = Supervisor.start_child(supervisor, args)
      if link_type == :link, do: Process.link(pid)
      {link_type, pid}
    end)
  end
end


Continue checking first for a mixfile before a rebarconfig

# This module is responsible for retrieving
# dependencies of a given project. This
# module and its functions are private to Mix.
defmodule Mix.Deps.Retriever do
  @moduledoc false

  @doc """
  Gets all direct children for the current Mix.Project
  as a `Mix.Dep` record.
  """
  def children() do
    # Don't run recursively for the top-level project
    scms = Mix.SCM.available
    from = current_source(:mix)
    (Mix.project[:deps] || []) |> Enum.map(update(&1, scms, from))
  end

  @doc """
  Gets all children for a given dependency.
  """
  def children(dep, config) do
    cond do
      Mix.Deps.available?(dep) and mixfile?(dep) ->
        Mix.Deps.in_dependency(dep, config, fn _ ->
          mix_children(config)
        end)

      Mix.Deps.available?(dep) and rebarconfig?(dep) ->
        Mix.Deps.in_dependency(dep, config, fn _ ->
          rebar_children(".")
        end)

      true ->
        []
    end
  end

  @doc """
  Receives a dependency and update its status.
  """
  def update(Mix.Dep[scm: scm, app: app, requirement: req, opts: opts,
                     manager: manager, from: from]) do
    update({ app, req, opts }, [scm], from, manager)
  end

  ## Helpers

  defp mix_children(config) do
    scms = Mix.SCM.available
    Mix.Project.recur(config, fn _ ->
      from = current_source(:mix)

      # The manager must be nil because mix supports mix,
      # rebar and make dependencies/managers.
      (Mix.project[:deps] || []) |> Enum.map(update(&1, scms, from))
    end) |> List.concat
  end

  defp rebar_children(dir) do
    scms = Mix.SCM.available
    Mix.Rebar.recur(dir, fn config ->
      from = current_source(:rebar)

      # Rebar dependencies are always managed by rebar.
      Mix.Rebar.deps(config) |> Enum.map(update(&1, scms, from, :rebar))
    end) |> List.concat
  end

  defp update(tuple, scms, from, manager // nil) do
    dep = with_scm_and_status(tuple, scms).from(from)

    if match?({ _, req, _ } when is_regex(req), tuple) and
        not String.ends_with?(from, "rebar.config") do
      Mix.shell.info("[WARNING] Regex version requirement for dependencies is " <>
        "deprecated, please use Mix.Version instead")
    end

    cond do
      # If it is not available, there is nothing we can do
      not Mix.Deps.available?(dep) ->
        dep

      # If the manager was already set to rebar, let's use it
      manager == :rebar ->
        rebar_dep(dep)

      mixfile?(dep) ->
        Mix.Deps.in_dependency(dep, fn project ->
          mix_dep(dep, project)
        end)

      rebarconfig?(dep) or rebarexec?(dep) ->
        rebar_dep(dep)

      makefile?(dep) ->
        make_dep(dep)

      true ->
        dep
    end
  end

  defp current_source(manager) do
    case manager do
      :mix   -> "mix.exs"
      :rebar -> "rebar.config"
    end |> Path.absname
  end

  defp mix_dep(Mix.Dep[manager: nil] = dep, project) do
    if match?({ :noappfile, _ }, dep.status) and Mix.Project.umbrella? do
      dep = dep.update_opts(Keyword.put(&1, :app, false))
               .status({ :ok, nil })
    end
    dep.manager(:mix).source(project)
  end

  defp mix_dep(dep, _project), do: dep

  defp rebar_dep(Mix.Dep[manager: nil, opts: opts] = dep) do
    config = Mix.Rebar.load_config(opts[:dest])
    dep.manager(:rebar).source(config)
  end

  defp rebar_dep(dep), do: dep

  defp make_dep(Mix.Dep[manager: nil] = dep) do
    dep.manager(:make)
  end

  defp make_dep(dep), do: dep

  defp with_scm_and_status({ app, opts }, scms) when is_atom(app) and is_list(opts) do
    with_scm_and_status({ app, nil, opts }, scms)
  end

  defp with_scm_and_status({ app, req, opts }, scms) when is_atom(app) and
      (is_binary(req) or is_regex(req) or req == nil) and is_list(opts) do

    path = Path.join(Mix.project[:deps_path], app)
    opts = Keyword.put(opts, :dest, path)

    { scm, opts } = Enum.find_value scms, fn(scm) ->
      (new = scm.accepts_options(opts)) && { scm, new }
    end

    if scm do
      Mix.Dep[
        scm: scm,
        app: app,
        requirement: req,
        status: status(scm, app, req, opts),
        opts: opts
      ]
    else
      supported = Enum.join scms, ", "
      raise Mix.Error, message: "did not specify a supported scm, expected one of: " <> supported
    end
  end

  defp with_scm_and_status(other, _scms) do
    raise Mix.Error, message: %b(dependency specified in the wrong format: #{inspect other}, ) <>
      %b(expected { :app, scm: "location" } | { :app, "requirement", scm: "location" })
  end

  defp status(scm, app, req, opts) do
    if scm.checked_out? opts do
      opts_app = opts[:app]

      if opts_app == false do
        { :ok, nil }
      else
        path = if is_binary(opts_app), do: opts_app, else: "ebin/#{app}.app"
        path = Path.join(opts[:dest], path)
        validate_app_file(path, app, req)
      end
    else
      { :unavailable, opts[:dest] }
    end
  end

  defp validate_app_file(app_path, app, req) do
    case :file.consult(app_path) do
      { :ok, [{ :application, ^app, config }] } ->
        case List.keyfind(config, :vsn, 0) do
          { :vsn, actual } ->
            actual = list_to_binary(actual)
            if vsn_match?(req, actual) do
              { :ok, actual }
            else
              { :invalidvsn, actual }
            end
          nil -> { :invalidvsn, nil }
        end
      { :ok, _ } -> { :invalidapp, app_path }
      { :error, _ } -> { :noappfile, app_path }
    end
  end

  defp vsn_match?(nil, _actual), do: true
  defp vsn_match?(req, actual) when is_regex(req),  do: actual =~ req
  defp vsn_match?(req, actual) when is_binary(req) do
    Mix.Version.match?(actual, req)
  end

  defp mixfile?(dep) do
    File.regular?(Path.join(dep.opts[:dest], "mix.exs"))
  end

  defp rebarexec?(dep) do
    File.regular?(Path.join(dep.opts[:dest], "rebar"))
  end

  defp rebarconfig?(dep) do
    Enum.any?(["rebar.config", "rebar.config.script"], fn file ->
      File.regular?(Path.join(dep.opts[:dest], file))
    end)
  end

  defp makefile?(dep) do
    File.regular? Path.join(dep.opts[:dest], "Makefile")
  end
end

# This module is responsible for retrieving
# dependencies of a given project. This
# module and its functions are private to Mix.
defmodule Mix.Deps.Retriever do
  @moduledoc false

  @doc """
  Gets all direct children for the current Mix.Project
  as a `Mix.Dep` record.
  """
  def children() do
    # Don't run recursively for the top-level project
    scms = Mix.SCM.available
    from = current_source(:mix)
    (Mix.project[:deps] || []) |> Enum.map(update(&1, scms, nil, from))
  end

  @doc """
  Gets all children for a given dependency.
  """
  def children(dep, config) do
    cond do
      Mix.Deps.available?(dep) and mixfile?(dep) ->
        Mix.Deps.in_dependency(dep, config, fn _ ->
          mix_children(config)
        end)

      Mix.Deps.available?(dep) and rebarconfig?(dep) ->
        Mix.Deps.in_dependency(dep, config, fn _ ->
          rebar_children(".")
        end)

      true ->
        []
    end
  end

  @doc """
  Receives a dependency and update its status.
  """
  def update(Mix.Dep[scm: scm, app: app, requirement: req, opts: opts,
                     manager: manager, from: from]) do
    update({ app, req, opts }, [scm], manager, from)
  end

  ## Helpers

  defp mix_children(config) do
    scms = Mix.SCM.available
    Mix.Project.recur(config, fn _ ->
      from = current_source(:mix)

      # The manager must be nil because mix supports mix,
      # rebar and make dependencies/managers.
      (Mix.project[:deps] || []) |> Enum.map(update(&1, scms, nil, from))
    end) |> List.concat
  end

  defp rebar_children(dir) do
    scms = Mix.SCM.available
    Mix.Rebar.recur(dir, fn config ->
      from = current_source(:rebar)

      # Rebar dependencies are always managed by rebar.
      Mix.Rebar.deps(config) |> Enum.map(update(&1, scms, :rebar, from))
    end) |> List.concat
  end

  defp update(tuple, scms, manager, from) do
    dep = with_scm_and_status(tuple, scms).from(from)

    if match?({ _, req, _ } when is_regex(req), tuple) and
        not String.ends_with?(from, "rebar.config") do
      Mix.shell.info("[WARNING] Regex version requirement for dependencies is " <>
        "deprecated, please use Mix.Version instead")
    end

    if Mix.Deps.available?(dep) do
      cond do
        # Force all dependencies of a rebar dependency to be managed by rebar
        manager == :rebar or rebarconfig?(dep) or rebarexec?(dep) ->
          rebar_dep(dep)

        mixfile?(dep) ->
          Mix.Deps.in_dependency(dep, fn project ->
            mix_dep(dep, project)
          end)

        makefile?(dep) ->
          make_dep(dep)

        true ->
          dep.manager(manager)
      end
    else
      dep
    end
  end

  defp current_source(manager) do
    case manager do
      :mix   -> "mix.exs"
      :rebar -> "rebar.config"
    end |> Path.absname
  end

  defp mix_dep(Mix.Dep[manager: nil] = dep, project) do
    if match?({ :noappfile, _ }, dep.status) and Mix.Project.umbrella? do
      dep = dep.update_opts(Keyword.put(&1, :app, false))
               .status({ :ok, nil })
    end
    dep.manager(:mix).source(project)
  end

  defp mix_dep(dep, _project), do: dep

  defp rebar_dep(Mix.Dep[manager: nil, opts: opts] = dep) do
    config = Mix.Rebar.load_config(opts[:dest])
    dep.manager(:rebar).source(config)
  end

  defp rebar_dep(dep), do: dep

  defp make_dep(Mix.Dep[manager: nil] = dep) do
    dep.manager(:make)
  end

  defp make_dep(dep), do: dep

  defp with_scm_and_status({ app, opts }, scms) when is_atom(app) and is_list(opts) do
    with_scm_and_status({ app, nil, opts }, scms)
  end

  defp with_scm_and_status({ app, req, opts }, scms) when is_atom(app) and
      (is_binary(req) or is_regex(req) or req == nil) and is_list(opts) do

    path = Path.join(Mix.project[:deps_path], app)
    opts = Keyword.put(opts, :dest, path)

    { scm, opts } = Enum.find_value scms, fn(scm) ->
      (new = scm.accepts_options(opts)) && { scm, new }
    end

    if scm do
      Mix.Dep[
        scm: scm,
        app: app,
        requirement: req,
        status: status(scm, app, req, opts),
        opts: opts
      ]
    else
      supported = Enum.join scms, ", "
      raise Mix.Error, message: "did not specify a supported scm, expected one of: " <> supported
    end
  end

  defp with_scm_and_status(other, _scms) do
    raise Mix.Error, message: %b(dependency specified in the wrong format: #{inspect other}, ) <>
      %b(expected { :app, scm: "location" } | { :app, "requirement", scm: "location" })
  end

  defp status(scm, app, req, opts) do
    if scm.checked_out? opts do
      opts_app = opts[:app]

      if opts_app == false do
        { :ok, nil }
      else
        path = if is_binary(opts_app), do: opts_app, else: "ebin/#{app}.app"
        path = Path.join(opts[:dest], path)
        validate_app_file(path, app, req)
      end
    else
      { :unavailable, opts[:dest] }
    end
  end

  defp validate_app_file(app_path, app, req) do
    case :file.consult(app_path) do
      { :ok, [{ :application, ^app, config }] } ->
        case List.keyfind(config, :vsn, 0) do
          { :vsn, actual } ->
            actual = list_to_binary(actual)
            if vsn_match?(req, actual) do
              { :ok, actual }
            else
              { :invalidvsn, actual }
            end
          nil -> { :invalidvsn, nil }
        end
      { :ok, _ } -> { :invalidapp, app_path }
      { :error, _ } -> { :noappfile, app_path }
    end
  end

  defp vsn_match?(nil, _actual), do: true
  defp vsn_match?(req, actual) when is_regex(req),  do: actual =~ req
  defp vsn_match?(req, actual) when is_binary(req) do
    Mix.Version.match?(actual, req)
  end

  defp mixfile?(dep) do
    File.regular?(Path.join(dep.opts[:dest], "mix.exs"))
  end

  defp rebarexec?(dep) do
    File.regular?(Path.join(dep.opts[:dest], "rebar"))
  end

  defp rebarconfig?(dep) do
    Enum.any?(["rebar.config", "rebar.config.script"], fn file ->
      File.regular?(Path.join(dep.opts[:dest], file))
    end)
  end

  defp makefile?(dep) do
    File.regular? Path.join(dep.opts[:dest], "Makefile")
  end
end


Send Stripe API error message to error view

defmodule CodeCorpsWeb.FallbackController do
  @moduledoc false
  use CodeCorpsWeb, :controller

  alias Ecto.Changeset

  require Logger

  @type supported_fallbacks :: {:error, Changeset.t} |
                               {:error, :not_authorized} |
                               {:error, :github} |
                               nil

  @doc ~S"""
  Default fallback for different `with` clause errors in controllers across the
  application.
  """
  @spec call(Conn.t, supported_fallbacks) :: Conn.t
  def call(%Conn{} = conn, {:error, %Changeset{} = changeset}) do
    conn
    |> put_status(:unprocessable_entity)
    |> render(CodeCorpsWeb.ChangesetView, "422.json", changeset: changeset)
  end
  def call(%Conn{} = conn, {:error, :not_authorized}) do
    conn
    |> put_status(403)
    |> render(CodeCorpsWeb.TokenView, "403.json", message: "You are not authorized to perform this action.")
  end
  def call(%Conn{} = conn, nil) do
    conn
    |> put_status(:not_found)
    |> render(CodeCorpsWeb.ErrorView, "404.json")
  end
  def call(%Conn{} = conn, {:error, :github}) do
    conn
    |> put_status(500)
    |> render(CodeCorpsWeb.ErrorView, "500.json", message: "An unknown error occurred with GitHub's API.")
  end
  def call(%Conn{} = conn, {:error, %Stripe.APIErrorResponse{message: message}}) do
    Logger.info message
    conn
    |> put_status(500)
    |> render(CodeCorpsWeb.ErrorView, "500.json", message: message)
  end
  def call(%Conn{} = conn, {:error, %CodeCorps.GitHub.APIError{message: message}}) do
    Logger.info message
    conn
    |> put_status(500)
    |> render(CodeCorpsWeb.ErrorView, "github-error.json", message: message)
  end
end

defmodule CodeCorpsWeb.FallbackController do
  @moduledoc false
  use CodeCorpsWeb, :controller

  alias Ecto.Changeset

  require Logger

  @type supported_fallbacks :: {:error, Changeset.t} |
                               {:error, :not_authorized} |
                               {:error, :github} |
                               nil

  @doc ~S"""
  Default fallback for different `with` clause errors in controllers across the
  application.
  """
  @spec call(Conn.t, supported_fallbacks) :: Conn.t
  def call(%Conn{} = conn, {:error, %Changeset{} = changeset}) do
    conn
    |> put_status(:unprocessable_entity)
    |> render(CodeCorpsWeb.ChangesetView, "422.json", changeset: changeset)
  end
  def call(%Conn{} = conn, {:error, :not_authorized}) do
    conn
    |> put_status(403)
    |> render(CodeCorpsWeb.TokenView, "403.json", message: "You are not authorized to perform this action.")
  end
  def call(%Conn{} = conn, nil) do
    conn
    |> put_status(:not_found)
    |> render(CodeCorpsWeb.ErrorView, "404.json")
  end
  def call(%Conn{} = conn, {:error, :github}) do
    conn
    |> put_status(500)
    |> render(CodeCorpsWeb.ErrorView, "500.json", message: "An unknown error occurred with GitHub's API.")
  end
  def call(%Conn{} = conn, {:error, %Stripe.APIErrorResponse{message: message}}) do
    Logger.info message
    conn
    |> put_status(500)
    |> render(CodeCorpsWeb.ErrorView, "500.json", message: "An unknown error occurred with Stripe's API.")
  end
  def call(%Conn{} = conn, {:error, %CodeCorps.GitHub.APIError{message: message}}) do
    Logger.info message
    conn
    |> put_status(500)
    |> render(CodeCorpsWeb.ErrorView, "github-error.json", message: message)
  end
end


Fix deploy

Fix deploy

# Import all plugins from `rel/plugins`
# They can then be used by adding `plugin MyPlugin` to
# either an environment, or release definition, where
# `MyPlugin` is the name of the plugin module.
["rel", "plugins", "*.exs"]
|> Path.join()
|> Path.wildcard()
|> Enum.map(&Code.eval_file(&1))

use Distillery.Releases.Config,
    # This sets the default release built by `mix release`
    default_release: :default,
    # This sets the default environment used by `mix release`
    default_environment: Mix.env()

# For a full list of config options for both releases
# and environments, visit https://hexdocs.pm/distillery/configuration.html

# You may define one or more environments in this file,
# an environment's settings will override those of a release
# when building in that environment, this combination of release
# and environment configuration is called a profile

environment :dev do
  # If you are running Phoenix, you should make sure that
  # server: true is set and the code reloader is disabled,
  # even in dev mode.
  # It is recommended that you build with MIX_ENV=prod and pass
  # the --env flag to Distillery explicitly if you want to use
  # dev mode.
  set dev_mode: true
  set include_erts: false
  set cookie: :"?Oxo8uJ@&D@Sw@`NN!<5rFxVDA)JO1r$OT{{Py79R9`C4&DRNM~%joji8B2%&TCe"
end

environment :prod do
  set include_erts: true
  set include_src: false
  set cookie: :";IXx6btpc8P4w2LQl*Zq4aD%.`*:k!^|,W=:_21,T?v!Bd0i=NfVv~3J>awv|7^$"
end

# You may define one or more releases in this file.
# If you have not set a default release, or selected one
# when running `mix release`, the first release in the file
# will be used by default

release :chess do
  set version: current_version(:chess)
  set applications: [
    :runtime_tools
  ]
end

# Import all plugins from `rel/plugins`
# They can then be used by adding `plugin MyPlugin` to
# either an environment, or release definition, where
# `MyPlugin` is the name of the plugin module.
["rel", "plugins", "*.exs"]
|> Path.join()
|> Path.wildcard()
|> Enum.map(&Code.eval_file(&1))

use Mix.Releases.Config,
    # This sets the default release built by `mix release`
    default_release: :default,
    # This sets the default environment used by `mix release`
    default_environment: Mix.env()

# For a full list of config options for both releases
# and environments, visit https://hexdocs.pm/distillery/configuration.html

# You may define one or more environments in this file,
# an environment's settings will override those of a release
# when building in that environment, this combination of release
# and environment configuration is called a profile

environment :dev do
  # If you are running Phoenix, you should make sure that
  # server: true is set and the code reloader is disabled,
  # even in dev mode.
  # It is recommended that you build with MIX_ENV=prod and pass
  # the --env flag to Distillery explicitly if you want to use
  # dev mode.
  set dev_mode: true
  set include_erts: false
  set cookie: :"?Oxo8uJ@&D@Sw@`NN!<5rFxVDA)JO1r$OT{{Py79R9`C4&DRNM~%joji8B2%&TCe"
end

environment :prod do
  set include_erts: true
  set include_src: false
  set cookie: :";IXx6btpc8P4w2LQl*Zq4aD%.`*:k!^|,W=:_21,T?v!Bd0i=NfVv~3J>awv|7^$"
end

# You may define one or more releases in this file.
# If you have not set a default release, or selected one
# when running `mix release`, the first release in the file
# will be used by default

release :chess do
  set version: current_version(:chess)
  set applications: [
    :runtime_tools
  ]
end


Update demo app

Update demo app

defmodule NervesDnssdDemo.Application do
  use Application

  @interface :eth0

  require Logger

  # See http://elixir-lang.org/docs/stable/elixir/Application.html
  # for more information on OTP Applications
  def start(_type, _args) do

    if Application.get_env(:nerves_dnssd_demo, :networking, true) do
      Nerves.Networking.setup @interface
    end

    announce_node()

    {:ok, self()}
  end

  def announce_node do
    Logger.info "Registering node as #{:erlang.node}"
    # We take the local port from whatever port the distribution protocol is listening on.
    {:ok, _local_name, local_ip} = :dnssd_epmd_stub.local_port_please()

    # Now register our service. This should tell other services where to find us.
    Nerves.Dnssd.register("Nerves.Dnssd example", "_epmd._tcp", local_ip, [{"node", :erlang.node}])
  end

end

defmodule NervesDnssdDemo.Application do
  use Application

  @interface :eth0

  require Logger

  # See http://elixir-lang.org/docs/stable/elixir/Application.html
  # for more information on OTP Applications
  def start(_type, _args) do

    if Application.get_env(:nerves_dnssd_demo, :networking, true) do
      Nerves.Networking.setup @interface
    end

    announce_node()

    {:ok, self()}
  end

  def announce_node do
    Logger.info "Registering node as #{:erlang.node}"
    {:ok, local_name, local_ip} = :dnssd_epmd_stub.local_port_please()
    :dnssd.register(local_name, "_epmd._tcp", local_ip, [{"node", :erlang.node}])
  end

end


Bump version number

Bump version number

defmodule Vutuv.Mixfile do
  use Mix.Project

  def project do
    [app: :vutuv,
     version: "1.0.38",
     elixir: "~> 1.0",
     elixirc_paths: elixirc_paths(Mix.env),
     compilers: [:phoenix, :gettext] ++ Mix.compilers,
     build_embedded: Mix.env == :prod,
     start_permanent: Mix.env == :prod,
     aliases: aliases,
     deps: deps]
  end

  # Configuration for the OTP application.
  #
  # Type `mix help compile.app` for more information.
  def application do
    [mod: {Vutuv, []},
     applications: [:phoenix,
                    :phoenix_pubsub,
                    :phoenix_html,
                    :cowboy,
                    :logger,
                    :gettext,
                    :phoenix_ecto,
                    :ex_machina,
                    :phoenix_html_simplified_helpers,
                    :bamboo,
                    :bamboo_smtp,
                    :mariaex,
                    :httpoison,
                    :slugger,
                    :timex_ecto,
                    :word_smith,
                    :arc,
                    :arc_ecto]]
  end

  # Specifies which paths to compile per environment.
  defp elixirc_paths(:test), do: ["lib", "web", "test/support"]
  defp elixirc_paths(_),     do: ["lib", "web"]

  # Specifies your project dependencies.
  #
  # Type `mix help deps` for examples and options.
  defp deps do
    [{:ecto, "~> 2.0.0", override: true},
     {:bamboo, "~> 0.6"},
     {:bamboo_smtp, "~> 1.1.0"},
     {:phoenix, "~> 1.2.0"},
     {:phoenix_ecto, "~> 3.0.0-rc"},
     {:phoenix_html, "~> 2.8"},
     {:phoenix_live_reload, "~> 1.0", only: :dev},
     {:gettext, "~> 0.12.1"},
     {:cowboy, "~> 1.0"},
     {:arc, "~> 0.5.3"},
     {:arc_ecto, "~> 0.4.2"},
     {:ex_machina, "~> 0.6.1"},
     {:phoenix_html_simplified_helpers, "~> 0.6.0"},
     {:mariaex, ">= 0.0.0"},
     {:word_smith, "~> 0.1.0"},
     {:slugger, "~> 0.1.0"},
     {:httpoison, "~> 0.9.0"},
     {:distillery, "~> 0.10"}]
  end

  # Aliases are shortcut or tasks specific to the current project.
  # For example, to create, migrate and run the seeds file at once:
  #
  #     $ mix ecto.setup
  #
  # See the documentation for `Mix` for more info on aliases.
  defp aliases do
    ["ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
     "ecto.reset": ["ecto.drop", "ecto.setup"],
     "test": ["ecto.create --quiet", "ecto.migrate", "test"]]
  end
end

defmodule Vutuv.Mixfile do
  use Mix.Project

  def project do
    [app: :vutuv,
     version: "1.0.37",
     elixir: "~> 1.0",
     elixirc_paths: elixirc_paths(Mix.env),
     compilers: [:phoenix, :gettext] ++ Mix.compilers,
     build_embedded: Mix.env == :prod,
     start_permanent: Mix.env == :prod,
     aliases: aliases,
     deps: deps]
  end

  # Configuration for the OTP application.
  #
  # Type `mix help compile.app` for more information.
  def application do
    [mod: {Vutuv, []},
     applications: [:phoenix,
                    :phoenix_pubsub,
                    :phoenix_html,
                    :cowboy,
                    :logger,
                    :gettext,
                    :phoenix_ecto,
                    :ex_machina,
                    :phoenix_html_simplified_helpers,
                    :bamboo,
                    :bamboo_smtp,
                    :mariaex,
                    :httpoison,
                    :slugger,
                    :timex_ecto,
                    :word_smith,
                    :arc,
                    :arc_ecto]]
  end

  # Specifies which paths to compile per environment.
  defp elixirc_paths(:test), do: ["lib", "web", "test/support"]
  defp elixirc_paths(_),     do: ["lib", "web"]

  # Specifies your project dependencies.
  #
  # Type `mix help deps` for examples and options.
  defp deps do
    [{:ecto, "~> 2.0.0", override: true},
     {:bamboo, "~> 0.6"},
     {:bamboo_smtp, "~> 1.1.0"},
     {:phoenix, "~> 1.2.0"},
     {:phoenix_ecto, "~> 3.0.0-rc"},
     {:phoenix_html, "~> 2.8"},
     {:phoenix_live_reload, "~> 1.0", only: :dev},
     {:gettext, "~> 0.12.1"},
     {:cowboy, "~> 1.0"},
     {:arc, "~> 0.5.3"},
     {:arc_ecto, "~> 0.4.2"},
     {:ex_machina, "~> 0.6.1"},
     {:phoenix_html_simplified_helpers, "~> 0.6.0"},
     {:mariaex, ">= 0.0.0"},
     {:word_smith, "~> 0.1.0"},
     {:slugger, "~> 0.1.0"},
     {:httpoison, "~> 0.9.0"},
     {:distillery, "~> 0.10"}]
  end

  # Aliases are shortcut or tasks specific to the current project.
  # For example, to create, migrate and run the seeds file at once:
  #
  #     $ mix ecto.setup
  #
  # See the documentation for `Mix` for more info on aliases.
  defp aliases do
    ["ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
     "ecto.reset": ["ecto.drop", "ecto.setup"],
     "test": ["ecto.create --quiet", "ecto.migrate", "test"]]
  end
end


add description

add description

defmodule Onartsipac.Mixfile do
  use Mix.Project

  def project do
    [app: :onartsipac,
     version: "0.1.0",
     elixir: "~> 1.4",
     build_embedded: Mix.env == :prod,
     start_permanent: Mix.env == :prod,
     deps: deps(),

     description: "Saithe9v mib4ahVe AeF9aihi eor5zuSh",
     package: package()
    ]
  end

  defp package do
    [maintainers: ["Thomas Stratmann"],
     licenses: ["MIT"],
     links: %{},
     files: ~w(mix.exs README.md lib)]
  end

  # Configuration for the OTP application
  #
  # Type "mix help compile.app" for more information
  def application do
    # Specify extra applications you'll use from Erlang/Elixir
    [extra_applications: [:logger]]
  end

  # Dependencies can be Hex packages:
  #
  #   {:my_dep, "~> 0.3.0"}
  #
  # Or git/path repositories:
  #
  #   {:my_dep, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}
  #
  # Type "mix help deps" for more examples and options
  defp deps do
    [{:ex_doc, ">= 0.0.0", only: :dev}]
  end
end

defmodule Onartsipac.Mixfile do
  use Mix.Project

  def project do
    [app: :onartsipac,
     version: "0.1.0",
     elixir: "~> 1.4",
     build_embedded: Mix.env == :prod,
     start_permanent: Mix.env == :prod,
     deps: deps(),

     description: "",
     package: package()
    ]
  end

  defp package do
    [maintainers: ["Thomas Stratmann"],
     licenses: ["MIT"],
     links: %{},
     files: ~w(mix.exs README.md lib)]
  end

  # Configuration for the OTP application
  #
  # Type "mix help compile.app" for more information
  def application do
    # Specify extra applications you'll use from Erlang/Elixir
    [extra_applications: [:logger]]
  end

  # Dependencies can be Hex packages:
  #
  #   {:my_dep, "~> 0.3.0"}
  #
  # Or git/path repositories:
  #
  #   {:my_dep, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}
  #
  # Type "mix help deps" for more examples and options
  defp deps do
    [{:ex_doc, ">= 0.0.0", only: :dev}]
  end
end


version 0.11.14

version 0.11.14

defmodule Wwwtech.MixProject do
  use Mix.Project

  def project do
    [
      app: :wwwtech,
      version: "0.11.14",
      elixir: "~> 1.7",
      elixirc_paths: elixirc_paths(Mix.env()),
      compilers: [:phoenix, :gettext] ++ Mix.compilers(),
      start_permanent: Mix.env() == :prod,
      aliases: aliases(),
      deps: deps()
    ]
  end

  # Configuration for the OTP application.
  #
  # Type `mix help compile.app` for more information.
  def application do
    [
      mod: {Wwwtech.Application, []},
      extra_applications: [:logger, :runtime_tools, :os_mon]
    ]
  end

  # Specifies which paths to compile per environment.
  defp elixirc_paths(:test), do: ["lib", "test/support"]
  defp elixirc_paths(_), do: ["lib"]

  # Specifies your project dependencies.
  #
  # Type `mix help deps` for examples and options.
  defp deps do
    [
      {:phoenix, "~> 1.5.0"},
      {:phoenix_pubsub, "~> 2.0"},
      {:phoenix_ecto, "~> 4.0"},
      {:ecto_sql, "~> 3.1"},
      {:postgrex, ">= 0.0.0"},
      {:phoenix_html, "~> 2.11"},
      {:phoenix_live_reload, "~> 1.2", only: :dev},
      {:gettext, "~> 0.11"},
      {:jason, "~> 1.0"},
      {:plug_cowboy, "~> 2.1"},
      {:argon2_elixir, "~> 2.0"},
      {:timex, "~> 3.5"},
      {:earmark, "~> 1.4"},
      {:xml_builder, "~> 2.1"},
      {:exexif, "~> 0.0.5"},
      {:mogrify, "~> 0.8.0"},
      {:microformats2, "~> 0.1"},
      {:webmentions, "~> 0.3"},
      {:floki, "~> 0.23"},
      {:swoosh, "~> 1.3"},
      {:gen_smtp, "~> 1.1"},
      {:phoenix_swoosh, "~> 0.3"},
      {:appsignal_phoenix, "~> 2.0.0"},
      {:tesla, "~> 1.3"},
      {:hackney, "~> 1.15"},
      {:phoenix_live_dashboard, "~> 0.1"},
      {:telemetry_poller, "~> 0.4"},
      {:telemetry_metrics, "~> 0.4"},
      {:gh_webhook_plug, "~> 0.0.5"}
    ]
  end

  # Aliases are shortcuts or tasks specific to the current project.
  # For example, to create, migrate and run the seeds file at once:
  #
  #     $ mix ecto.setup
  #
  # See the documentation for `Mix` for more info on aliases.
  defp aliases do
    [
      "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
      "ecto.reset": ["ecto.drop", "ecto.setup"],
      test: ["ecto.create --quiet", "ecto.migrate", "test"],
      build: "cmd ./.build/build",
      deploy: "cmd ./.build/deploy"
    ]
  end
end

defmodule Wwwtech.MixProject do
  use Mix.Project

  def project do
    [
      app: :wwwtech,
      version: "0.11.13",
      elixir: "~> 1.7",
      elixirc_paths: elixirc_paths(Mix.env()),
      compilers: [:phoenix, :gettext] ++ Mix.compilers(),
      start_permanent: Mix.env() == :prod,
      aliases: aliases(),
      deps: deps()
    ]
  end

  # Configuration for the OTP application.
  #
  # Type `mix help compile.app` for more information.
  def application do
    [
      mod: {Wwwtech.Application, []},
      extra_applications: [:logger, :runtime_tools, :os_mon]
    ]
  end

  # Specifies which paths to compile per environment.
  defp elixirc_paths(:test), do: ["lib", "test/support"]
  defp elixirc_paths(_), do: ["lib"]

  # Specifies your project dependencies.
  #
  # Type `mix help deps` for examples and options.
  defp deps do
    [
      {:phoenix, "~> 1.5.0"},
      {:phoenix_pubsub, "~> 2.0"},
      {:phoenix_ecto, "~> 4.0"},
      {:ecto_sql, "~> 3.1"},
      {:postgrex, ">= 0.0.0"},
      {:phoenix_html, "~> 2.11"},
      {:phoenix_live_reload, "~> 1.2", only: :dev},
      {:gettext, "~> 0.11"},
      {:jason, "~> 1.0"},
      {:plug_cowboy, "~> 2.1"},
      {:argon2_elixir, "~> 2.0"},
      {:timex, "~> 3.5"},
      {:earmark, "~> 1.4"},
      {:xml_builder, "~> 2.1"},
      {:exexif, "~> 0.0.5"},
      {:mogrify, "~> 0.8.0"},
      {:microformats2, "~> 0.1"},
      {:webmentions, "~> 0.3"},
      {:floki, "~> 0.23"},
      {:swoosh, "~> 1.3"},
      {:gen_smtp, "~> 1.1"},
      {:phoenix_swoosh, "~> 0.3"},
      {:appsignal_phoenix, "~> 2.0.0"},
      {:tesla, "~> 1.3"},
      {:hackney, "~> 1.15"},
      {:phoenix_live_dashboard, "~> 0.1"},
      {:telemetry_poller, "~> 0.4"},
      {:telemetry_metrics, "~> 0.4"},
      {:gh_webhook_plug, "~> 0.0.5"}
    ]
  end

  # Aliases are shortcuts or tasks specific to the current project.
  # For example, to create, migrate and run the seeds file at once:
  #
  #     $ mix ecto.setup
  #
  # See the documentation for `Mix` for more info on aliases.
  defp aliases do
    [
      "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
      "ecto.reset": ["ecto.drop", "ecto.setup"],
      test: ["ecto.create --quiet", "ecto.migrate", "test"],
      build: "cmd ./.build/build",
      deploy: "cmd ./.build/deploy"
    ]
  end
end


Bump version.

Bump version.

defmodule Wallaby.Mixfile do
  use Mix.Project

  @version "0.3.1"

  def project do
    [app: :wallaby,
     version: @version,
     elixir: "~> 1.2",
     elixirc_paths: elixirc_paths(Mix.env),
     build_embedded: Mix.env == :prod,
     start_permanent: Mix.env == :prod,
     package: package,
     description: "Concurrent feature tests for elixir",
     deps: deps,
     docs: docs
   ]
  end

  def application do
    [applications: [:logger, :httpoison], mod: {Wallaby, []}]
  end

  defp elixirc_paths(:test), do: ["lib", "web", "test/support"]
  defp elixirc_paths(_),     do: ["lib"]

  defp deps do
    [
      {:httpoison, "~> 0.8"},
      {:poison, ">= 1.4.0"},
      {:poolboy, "~> 1.5"},
      {:dialyze, "~> 0.2.0"},
      {:earmark, "~> 0.2", only: :dev},
      {:ex_doc, "~> 0.11", only: :dev},
    ]
  end

  defp package do
    [
      files: ["lib", "mix.exs", "README.md", "LICENSE.md", "priv"],
      maintainers: ["Chris Keathley", "Tommy Fisher", "Alex Daniel"],
      licenses: ["MIT"],
      links: %{"Github" => "https://github.com/keathley/wallaby"}
    ]
  end

  defp docs do
    [
      extras: ["README.md"],
      source_ref: "v#{@version}",
      source_url: "https://github.com/keathley/wallaby",
      main: "readme",
    ]
  end
end

defmodule Wallaby.Mixfile do
  use Mix.Project

  @version "0.3.0"

  def project do
    [app: :wallaby,
     version: @version,
     elixir: "~> 1.2",
     elixirc_paths: elixirc_paths(Mix.env),
     build_embedded: Mix.env == :prod,
     start_permanent: Mix.env == :prod,
     package: package,
     description: "Concurrent feature tests for elixir",
     deps: deps,
     docs: docs
   ]
  end

  def application do
    [applications: [:logger, :httpoison], mod: {Wallaby, []}]
  end

  defp elixirc_paths(:test), do: ["lib", "web", "test/support"]
  defp elixirc_paths(_),     do: ["lib"]

  defp deps do
    [
      {:httpoison, "~> 0.8"},
      {:poison, ">= 1.4.0"},
      {:poolboy, "~> 1.5"},
      {:dialyze, "~> 0.2.0"},
      {:earmark, "~> 0.2", only: :dev},
      {:ex_doc, "~> 0.11", only: :dev},
    ]
  end

  defp package do
    [
      files: ["lib", "mix.exs", "README.md", "LICENSE.md", "priv"],
      maintainers: ["Chris Keathley", "Tommy Fisher", "Alex Daniel"],
      licenses: ["MIT"],
      links: %{"Github" => "https://github.com/keathley/wallaby"}
    ]
  end

  defp docs do
    [
      extras: ["README.md"],
      source_ref: "v#{@version}",
      source_url: "https://github.com/keathley/wallaby",
      main: "readme",
    ]
  end
end


Download/verify source at the beginning of builds

This avoids the 30+ minute CI build failures due to a failed download.

defmodule NervesSystemRpi0.MixProject do
  use Mix.Project

  @github_organization "nerves-project"
  @app :nerves_system_rpi0
  @source_url "https://github.com/#{@github_organization}/#{@app}"
  @version Path.join(__DIR__, "VERSION")
           |> File.read!()
           |> String.trim()

  def project do
    [
      app: @app,
      version: @version,
      elixir: "~> 1.6",
      compilers: Mix.compilers() ++ [:nerves_package],
      nerves_package: nerves_package(),
      description: description(),
      package: package(),
      deps: deps(),
      aliases: [loadconfig: [&bootstrap/1], docs: ["docs", &copy_images/1]],
      docs: docs(),
      preferred_cli_env: %{
        docs: :docs,
        "hex.build": :docs,
        "hex.publish": :docs
      }
    ]
  end

  def application do
    []
  end

  defp bootstrap(args) do
    set_target()
    Application.start(:nerves_bootstrap)
    Mix.Task.run("loadconfig", args)
  end

  defp nerves_package do
    [
      type: :system,
      artifact_sites: [
        {:github_releases, "#{@github_organization}/#{@app}"}
      ],
      build_runner_opts: build_runner_opts(),
      platform: Nerves.System.BR,
      platform_config: [
        defconfig: "nerves_defconfig"
      ],
      # The :env key is an optional experimental feature for adding environment
      # variables to the crosscompile environment. These are intended for
      # llvm-based tooling that may need more precise processor information.
      env: [
        {"TARGET_ARCH", "arm"},
        {"TARGET_CPU", "arm1176jzf_s"},
        {"TARGET_OS", "linux"},
        {"TARGET_ABI", "gnueabihf"}
      ],
      checksum: package_files()
    ]
  end

  defp deps do
    [
      {:nerves, "~> 1.5.4 or ~> 1.6.0 or ~> 1.7.3", runtime: false},
      {:nerves_system_br, "1.16.4", runtime: false},
      {:nerves_toolchain_armv6_nerves_linux_gnueabihf, "~> 1.4.3", runtime: false},
      {:nerves_system_linter, "~> 0.4", only: [:dev, :test], runtime: false},
      {:ex_doc, "~> 0.22", only: :docs, runtime: false}
    ]
  end

  defp description do
    """
    Nerves System - Raspberry Pi Zero and Zero W
    """
  end

  defp docs do
    [
      extras: ["README.md", "CHANGELOG.md"],
      main: "readme",
      source_ref: "v#{@version}",
      source_url: @source_url,
      skip_undefined_reference_warnings_on: ["CHANGELOG.md"]
    ]
  end

  defp package do
    [
      files: package_files(),
      licenses: ["Apache 2.0"],
      links: %{"GitHub" => @source_url}
    ]
  end

  defp package_files do
    [
      "fwup_include",
      "rootfs_overlay",
      "CHANGELOG.md",
      "cmdline.txt",
      "config.txt",
      "fwup-revert.conf",
      "fwup.conf",
      "LICENSE",
      "linux-5.4.defconfig",
      "mix.exs",
      "nerves_defconfig",
      "post-build.sh",
      "post-createfs.sh",
      "ramoops.dts",
      "README.md",
      "VERSION"
    ]
  end

  # Copy the images referenced by docs, since ex_doc doesn't do this.
  defp copy_images(_) do
    File.cp_r("assets", "doc/assets")
  end

  defp build_runner_opts() do
    # Download source files first to get download errors right away.
    [make_args: primary_site() ++ ["source", "all"]]
  end

  defp primary_site() do
    case System.get_env("BR2_PRIMARY_SITE") do
      nil -> []
      primary_site -> ["BR2_PRIMARY_SITE=#{primary_site}"]
    end
  end

  defp set_target() do
    if function_exported?(Mix, :target, 1) do
      apply(Mix, :target, [:target])
    else
      System.put_env("MIX_TARGET", "target")
    end
  end
end

defmodule NervesSystemRpi0.MixProject do
  use Mix.Project

  @github_organization "nerves-project"
  @app :nerves_system_rpi0
  @source_url "https://github.com/#{@github_organization}/#{@app}"
  @version Path.join(__DIR__, "VERSION")
           |> File.read!()
           |> String.trim()

  def project do
    [
      app: @app,
      version: @version,
      elixir: "~> 1.6",
      compilers: Mix.compilers() ++ [:nerves_package],
      nerves_package: nerves_package(),
      description: description(),
      package: package(),
      deps: deps(),
      aliases: [loadconfig: [&bootstrap/1], docs: ["docs", &copy_images/1]],
      docs: docs(),
      preferred_cli_env: %{
        docs: :docs,
        "hex.build": :docs,
        "hex.publish": :docs
      }
    ]
  end

  def application do
    []
  end

  defp bootstrap(args) do
    set_target()
    Application.start(:nerves_bootstrap)
    Mix.Task.run("loadconfig", args)
  end

  defp nerves_package do
    [
      type: :system,
      artifact_sites: [
        {:github_releases, "#{@github_organization}/#{@app}"}
      ],
      build_runner_opts: build_runner_opts(),
      platform: Nerves.System.BR,
      platform_config: [
        defconfig: "nerves_defconfig"
      ],
      # The :env key is an optional experimental feature for adding environment
      # variables to the crosscompile environment. These are intended for
      # llvm-based tooling that may need more precise processor information.
      env: [
        {"TARGET_ARCH", "arm"},
        {"TARGET_CPU", "arm1176jzf_s"},
        {"TARGET_OS", "linux"},
        {"TARGET_ABI", "gnueabihf"}
      ],
      checksum: package_files()
    ]
  end

  defp deps do
    [
      {:nerves, "~> 1.5.4 or ~> 1.6.0 or ~> 1.7.3", runtime: false},
      {:nerves_system_br, "1.16.4", runtime: false},
      {:nerves_toolchain_armv6_nerves_linux_gnueabihf, "~> 1.4.3", runtime: false},
      {:nerves_system_linter, "~> 0.4", only: [:dev, :test], runtime: false},
      {:ex_doc, "~> 0.22", only: :docs, runtime: false}
    ]
  end

  defp description do
    """
    Nerves System - Raspberry Pi Zero and Zero W
    """
  end

  defp docs do
    [
      extras: ["README.md", "CHANGELOG.md"],
      main: "readme",
      source_ref: "v#{@version}",
      source_url: @source_url,
      skip_undefined_reference_warnings_on: ["CHANGELOG.md"]
    ]
  end

  defp package do
    [
      files: package_files(),
      licenses: ["Apache 2.0"],
      links: %{"GitHub" => @source_url}
    ]
  end

  defp package_files do
    [
      "fwup_include",
      "rootfs_overlay",
      "CHANGELOG.md",
      "cmdline.txt",
      "config.txt",
      "fwup-revert.conf",
      "fwup.conf",
      "LICENSE",
      "linux-5.4.defconfig",
      "mix.exs",
      "nerves_defconfig",
      "post-build.sh",
      "post-createfs.sh",
      "ramoops.dts",
      "README.md",
      "VERSION"
    ]
  end

  # Copy the images referenced by docs, since ex_doc doesn't do this.
  defp copy_images(_) do
    File.cp_r("assets", "doc/assets")
  end

  defp build_runner_opts() do
    case System.get_env("BR2_PRIMARY_SITE") do
      nil -> []
      primary_site -> [make_args: ["BR2_PRIMARY_SITE=#{primary_site}"]]
    end
  end

  defp set_target() do
    if function_exported?(Mix, :target, 1) do
      apply(Mix, :target, [:target])
    else
      System.put_env("MIX_TARGET", "target")
    end
  end
end


Bump version to 0.2.0

Bump version to 0.2.0

defmodule Credo.Mixfile do
  use Mix.Project

  def project do
    [
      app: :credo,
      version: "0.2.0",
      elixir: "~> 1.0",
      escript: [main_module: Credo.CLI],
      build_embedded: Mix.env == :prod,
      start_permanent: Mix.env == :prod,
      deps: deps,
      test_coverage: [tool: Coverex.Task],
      name: "Credo",
      description: "An opinionated analysis tool for Elixir with a strong focus on teaching",
      package: package
    ]
  end

  defp package do
    [
      files: ["lib", ".credo.exs", "mix.exs", "README.md", "LICENSE"],
      maintainers: ["René Föhring"],
      licenses: ["MIT"],
      links: %{"GitHub" => "https://github.com/rrrene/credo"},
    ]
  end

  def application do
    [mod: {Credo, []}, applications: [:bunt, :logger]]
  end

  defp deps do
    [
      {:bunt, "~> 0.1.4"},
      {:inch_ex, "~> 0.4.0", only: [:dev, :test]},
      {:coverex, "~> 1.4.1", only: :test}
    ]
  end
end

defmodule Credo.Mixfile do
  use Mix.Project

  def project do
    [
      app: :credo,
      version: "0.1.10",
      elixir: "~> 1.0",
      escript: [main_module: Credo.CLI],
      build_embedded: Mix.env == :prod,
      start_permanent: Mix.env == :prod,
      deps: deps,
      test_coverage: [tool: Coverex.Task],
      name: "Credo",
      description: "An opinionated analysis tool for Elixir with a strong focus on teaching",
      package: package
    ]
  end

  defp package do
    [
      files: ["lib", ".credo.exs", "mix.exs", "README.md", "LICENSE"],
      maintainers: ["René Föhring"],
      licenses: ["MIT"],
      links: %{"GitHub" => "https://github.com/rrrene/credo"},
    ]
  end

  def application do
    [mod: {Credo, []}, applications: [:bunt, :logger]]
  end

  defp deps do
    [
      {:bunt, "~> 0.1.4"},
      {:inch_ex, "~> 0.4.0", only: [:dev, :test]},
      {:coverex, "~> 1.4.1", only: :test}
    ]
  end
end


Bump verion

Bump verion

defmodule Vutuv.Mixfile do
  use Mix.Project

  def project do
    [app: :vutuv,
     version: "0.0.11",
     elixir: "~> 1.0",
     elixirc_paths: elixirc_paths(Mix.env),
     compilers: [:phoenix, :gettext] ++ Mix.compilers,
     build_embedded: Mix.env == :dev,
     start_permanent: Mix.env == :prod,
     aliases: aliases,
     deps: deps]
  end

  # Configuration for the OTP application.
  #
  # Type `mix help compile.app` for more information.
  def application do
    [mod: {Vutuv, []},
     applications: [:phoenix,
                    :phoenix_pubsub,
                    :phoenix_html,
                    :cowboy,
                    :logger,
                    :gettext,
                    :phoenix_ecto,
                    :ex_machina,
                    :phoenix_html_simplified_helpers,
                    :bamboo,
                    :bamboo_smtp,
                    :mariaex,
                    :httpoison,
                    :slugger,
                    :timex_ecto,
                    :word_smith,
                    :arc,
                    :arc_ecto]]
  end

  # Specifies which paths to compile per environment.
  defp elixirc_paths(:test), do: ["lib", "web", "test/support"]
  defp elixirc_paths(_),     do: ["lib", "web"]

  # Specifies your project dependencies.
  #
  # Type `mix help deps` for examples and options.
  defp deps do
    [{:ecto, "~> 2.0.0", override: true},
     {:bamboo, "~> 0.6"},
     {:bamboo_smtp, "~> 1.1.0"},
     {:phoenix, "~> 1.2.0"},
     {:phoenix_ecto, "~> 3.0.0-rc"},
     {:phoenix_html, "~> 2.3"},
     {:phoenix_live_reload, "~> 1.0", only: :dev},
     {:gettext, "~> 0.9"},
     {:cowboy, "~> 1.0"},
     {:arc, "~> 0.5.3"},
     {:arc_ecto, "~> 0.4.2"},
     {:ex_machina, "~> 0.6.1"},
     {:phoenix_html_simplified_helpers, "~> 0.6.0"},
     {:mariaex, ">= 0.0.0"},
     {:word_smith, "~> 0.1.0"},
     {:slugger, "~> 0.1.0"},
     {:httpoison, "~> 0.9.0"},
     {:distillery, "~> 0.10"}]
  end

  # Aliases are shortcut or tasks specific to the current project.
  # For example, to create, migrate and run the seeds file at once:
  #
  #     $ mix ecto.setup
  #
  # See the documentation for `Mix` for more info on aliases.
  defp aliases do
    ["ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
     "ecto.reset": ["ecto.drop", "ecto.setup"],
     "test": ["ecto.create --quiet", "ecto.migrate", "test"]]
  end
end

defmodule Vutuv.Mixfile do
  use Mix.Project

  def project do
    [app: :vutuv,
     version: "0.0.10",
     elixir: "~> 1.0",
     elixirc_paths: elixirc_paths(Mix.env),
     compilers: [:phoenix, :gettext] ++ Mix.compilers,
     build_embedded: Mix.env == :dev,
     start_permanent: Mix.env == :prod,
     aliases: aliases,
     deps: deps]
  end

  # Configuration for the OTP application.
  #
  # Type `mix help compile.app` for more information.
  def application do
    [mod: {Vutuv, []},
     applications: [:phoenix,
                    :phoenix_pubsub,
                    :phoenix_html,
                    :cowboy,
                    :logger,
                    :gettext,
                    :phoenix_ecto,
                    :ex_machina,
                    :phoenix_html_simplified_helpers,
                    :bamboo,
                    :bamboo_smtp,
                    :mariaex,
                    :httpoison,
                    :slugger,
                    :timex_ecto,
                    :word_smith,
                    :arc,
                    :arc_ecto]]
  end

  # Specifies which paths to compile per environment.
  defp elixirc_paths(:test), do: ["lib", "web", "test/support"]
  defp elixirc_paths(_),     do: ["lib", "web"]

  # Specifies your project dependencies.
  #
  # Type `mix help deps` for examples and options.
  defp deps do
    [{:ecto, "~> 2.0.0", override: true},
     {:bamboo, "~> 0.6"},
     {:bamboo_smtp, "~> 1.1.0"},
     {:phoenix, "~> 1.2.0"},
     {:phoenix_ecto, "~> 3.0.0-rc"},
     {:phoenix_html, "~> 2.3"},
     {:phoenix_live_reload, "~> 1.0", only: :dev},
     {:gettext, "~> 0.9"},
     {:cowboy, "~> 1.0"},
     {:arc, "~> 0.5.3"},
     {:arc_ecto, "~> 0.4.2"},
     {:ex_machina, "~> 0.6.1"},
     {:phoenix_html_simplified_helpers, "~> 0.6.0"},
     {:mariaex, ">= 0.0.0"},
     {:word_smith, "~> 0.1.0"},
     {:slugger, "~> 0.1.0"},
     {:httpoison, "~> 0.9.0"},
     {:distillery, "~> 0.10"}]
  end

  # Aliases are shortcut or tasks specific to the current project.
  # For example, to create, migrate and run the seeds file at once:
  #
  #     $ mix ecto.setup
  #
  # See the documentation for `Mix` for more info on aliases.
  defp aliases do
    ["ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
     "ecto.reset": ["ecto.drop", "ecto.setup"],
     "test": ["ecto.create --quiet", "ecto.migrate", "test"]]
  end
end


0.2.3

defmodule ExPhaxio.Mixfile do
  use Mix.Project

  def project do
    [
      app: :ex_phaxio,
      name: "ExPhaxio",
      source_url: "https://github.com/bnns/ex_phaxio",
      description: "A simple Phaxio client.",
      version: "0.2.3",
      elixir: "~> 1.5",
      start_permanent: Mix.env == :prod,
      deps: deps(),
      docs: docs(),
      package: package()
    ]
  end

  def application do
    [
      extra_applications: [:logger, :httpoison, :poison]
    ]
  end

  defp deps do
    [
      {:httpoison, "~> 1.5.0"},
      {:poison, "~> 4.0.1"},
      {:credo, "~> 1.0.3", only: [:dev, :test]},
      {:ex_doc, ">= 0.19.3", only: [:dev, :test]},
    ]
  end

  defp docs do
    [
      readme: "README.md",
      main: ExPhaxio
    ]
  end

  defp package do
    [
      name: :ex_phaxio,
      maintainers: ["Dennis Yao"],
      licenses: ["Apache 2.0"],
      links: %{"Github" => "https://github.com/bnns/ex_phaxio"}
    ]
  end
end

defmodule ExPhaxio.Mixfile do
  use Mix.Project

  def project do
    [
      app: :ex_phaxio,
      name: "ExPhaxio",
      source_url: "https://github.com/bnns/ex_phaxio",
      description: "A simple Phaxio client.",
      version: "0.2.2",
      elixir: "~> 1.5",
      start_permanent: Mix.env == :prod,
      deps: deps(),
      docs: docs(),
      package: package()
    ]
  end

  def application do
    [
      extra_applications: [:logger, :httpoison, :poison]
    ]
  end

  defp deps do
    [
      {:httpoison, "~> 1.5.0"},
      {:poison, "~> 4.0.1"},
      {:credo, "~> 1.0.3", only: [:dev, :test]},
      {:ex_doc, ">= 0.19.3", only: [:dev, :test]},
    ]
  end

  defp docs do
    [
      readme: "README.md",
      main: ExPhaxio
    ]
  end

  defp package do
    [
      name: :ex_phaxio,
      maintainers: ["Dennis Yao"],
      licenses: ["Apache 2.0"],
      links: %{"Github" => "https://github.com/bnns/ex_phaxio"}
    ]
  end
end


Version bump

Version bump

defmodule CSV.Mixfile do
  use Mix.Project

  def project do
    [
        app: :csv,
        version: "2.1.0",
        elixir: "~> 1.1",
        deps: deps(),
        package: package(),
        docs: &docs/0,
        name: "CSV",
        consolidate_protocols: true,
        source_url: "https://github.com/beatrichartz/csv",
        description: "CSV Decoding and Encoding for Elixir",
        elixirc_paths: elixirc_paths(),
        test_coverage: [tool: ExCoveralls],
        preferred_cli_env: ["coveralls": :test, "coveralls.detail": :test, "coveralls.post": :test]
    ]
  end

  defp elixirc_paths do
    if Mix.env == :test do
      ["lib", "test/support"]
    else
      ["lib"]
    end
  end

  def application do
    [applications: [:parallel_stream]]
  end

  defp package do
    [
        maintainers: ["Beat Richartz"],
        licenses: ["MIT"],
        links: %{github: "https://github.com/beatrichartz/csv" }
    ]
  end

  defp deps do
    [
      {:parallel_stream, "~> 1.0.4"},
      {:excoveralls, "~> 0.6", only: :test},
      {:benchfella, ">= 0.0.0", only: :bench},
      {:ex_csv, ">= 0.0.0", only: :bench},
      {:csvlixir, ">= 0.0.0", only: :bench},
      {:cesso, ">= 0.0.0", only: :bench},
      {:ex_doc, "~> 0.16", only: :docs},
      {:inch_ex, "~> 0.5", only: :docs},
      {:earmark, "~> 1.2", only: :docs}
    ]
  end

  defp docs do
    {ref, 0} = System.cmd("git", ["rev-parse", "--verify", "--quiet", "HEAD"])

    [
        source_ref: ref,
        main: "overview"
    ]
  end
end

defmodule CSV.Mixfile do
  use Mix.Project

  def project do
    [
        app: :csv,
        version: "2.0.0",
        elixir: "~> 1.1",
        deps: deps(),
        package: package(),
        docs: &docs/0,
        name: "CSV",
        consolidate_protocols: true,
        source_url: "https://github.com/beatrichartz/csv",
        description: "CSV Decoding and Encoding for Elixir",
        elixirc_paths: elixirc_paths(),
        test_coverage: [tool: ExCoveralls],
        preferred_cli_env: ["coveralls": :test, "coveralls.detail": :test, "coveralls.post": :test]
    ]
  end

  defp elixirc_paths do
    if Mix.env == :test do
      ["lib", "test/support"]
    else
      ["lib"]
    end
  end

  def application do
    [applications: [:parallel_stream]]
  end

  defp package do
    [
        maintainers: ["Beat Richartz"],
        licenses: ["MIT"],
        links: %{github: "https://github.com/beatrichartz/csv" }
    ]
  end

  defp deps do
    [
      {:parallel_stream, "~> 1.0.4"},
      {:excoveralls, "~> 0.6", only: :test},
      {:benchfella, ">= 0.0.0", only: :bench},
      {:ex_csv, ">= 0.0.0", only: :bench},
      {:csvlixir, ">= 0.0.0", only: :bench},
      {:cesso, ">= 0.0.0", only: :bench},
      {:ex_doc, "~> 0.16", only: :docs},
      {:inch_ex, "~> 0.5", only: :docs},
      {:earmark, "~> 1.2", only: :docs}
    ]
  end

  defp docs do
    {ref, 0} = System.cmd("git", ["rev-parse", "--verify", "--quiet", "HEAD"])

    [
        source_ref: ref,
        main: "overview"
    ]
  end
end


v0.2.0

defmodule ChaosSpawn.Mixfile do
  use Mix.Project

  def project do
    [app: :chaos_spawn,
     name: "Chaos Spawn",
     package: [
       maintainers: ["Steve Brazier"],
       licenses: ["MIT"],
       links: %{"GitHub" => "https://github.com/meadsteve/chaos-spawn"},
     ],
     version: "0.2.0",
     elixir: "~> 1.0",
     build_embedded: Mix.env == :prod,
     start_permanent: Mix.env == :prod,
     deps: deps]
  end

  # Configuration for the OTP application
  #
  # Type `mix help compile.app` for more information
  def application do
    [applications: [:logger], mod: {ChaosSpawn, []}]
  end

  # Dependencies can be Hex packages:
  #
  #   {:mydep, "~> 0.3.0"}
  #
  # Or git/path repositories:
  #
  #   {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag: "0.1.0"}
  #
  # Type `mix help deps` for more examples and options
  defp deps do
    [
      {:timex, "0.19.5"},
      {:dogma, "0.0.9", only: [:dev, :test]},
      {:earmark, "~> 0.1", only: :dev},
      {:ex_doc, "~> 0.8", only: :dev}
    ]
  end
end

defmodule ChaosSpawn.Mixfile do
  use Mix.Project

  def project do
    [app: :chaos_spawn,
     name: "Chaos Spawn",
     package: [
       maintainers: ["Steve Brazier"],
       licenses: ["MIT"],
       links: %{"GitHub" => "https://github.com/meadsteve/chaos-spawn"},
     ],
     version: "0.1.0",
     elixir: "~> 1.0",
     build_embedded: Mix.env == :prod,
     start_permanent: Mix.env == :prod,
     deps: deps]
  end

  # Configuration for the OTP application
  #
  # Type `mix help compile.app` for more information
  def application do
    [applications: [:logger], mod: {ChaosSpawn, []}]
  end

  # Dependencies can be Hex packages:
  #
  #   {:mydep, "~> 0.3.0"}
  #
  # Or git/path repositories:
  #
  #   {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag: "0.1.0"}
  #
  # Type `mix help deps` for more examples and options
  defp deps do
    [
      {:timex, "0.19.5"},
      {:dogma, "0.0.9", only: [:dev, :test]},
      {:earmark, "~> 0.1", only: :dev},
      {:ex_doc, "~> 0.8", only: :dev}
    ]
  end
end


cleans up mixfile

cleans up mixfile

defmodule Geolix.Mixfile do
  use Mix.Project

  @url_github "https://github.com/elixir-geolix/geolix"

  def project do
    [
      app: :geolix,
      name: "Geolix",
      version: "0.16.0-dev",
      elixir: "~> 1.3",
      deps: deps(),
      description: "MaxMind GeoIP2 database reader/decoder",
      docs: docs(),
      elixirc_paths: elixirc_paths(Mix.env()),
      package: package(),
      preferred_cli_env: [
        coveralls: :test,
        "coveralls.detail": :test,
        "coveralls.travis": :test
      ],
      test_coverage: [tool: ExCoveralls]
    ]
  end

  def application do
    [
      applications: [:logger, :poolboy],
      included_applications: [:mmdb2_decoder],
      mod: {Geolix, []}
    ]
  end

  defp deps do
    [
      {:ex_doc, ">= 0.0.0", only: :dev},
      {:excoveralls, "~> 0.7", only: :test},
      {:hackney, "~> 1.0", only: :test},
      {:mmdb2_decoder, "~> 0.1.0"},
      {:poolboy, "~> 1.0"}
    ]
  end

  defp docs do
    [
      extras: ["CHANGELOG.md", "README.md"],
      main: "readme",
      source_ref: "master",
      source_url: @url_github
    ]
  end

  defp elixirc_paths(:test), do: ["lib", "test/helpers"]
  defp elixirc_paths(_), do: ["lib"]

  defp package do
    %{
      files: ["CHANGELOG.md", "LICENSE", "mix.exs", "README.md", "lib"],
      licenses: ["Apache 2.0"],
      links: %{"GitHub" => @url_github},
      maintainers: ["Marc Neudert"]
    }
  end
end

defmodule Geolix.Mixfile do
  use Mix.Project

  @url_github "https://github.com/elixir-geolix/geolix"

  def project do
    [
      app: :geolix,
      name: "Geolix",
      version: "0.16.0-dev",
      elixir: "~> 1.3",
      deps: deps(),
      elixirc_paths: elixirc_paths(Mix.env()),
      build_embedded: Mix.env() == :prod,
      start_permanent: Mix.env() == :prod,
      preferred_cli_env: [
        coveralls: :test,
        "coveralls.detail": :test,
        "coveralls.travis": :test
      ],
      description: "MaxMind GeoIP2 database reader/decoder",
      docs: docs(),
      package: package(),
      test_coverage: [tool: ExCoveralls]
    ]
  end

  def application do
    [
      applications: [:logger, :poolboy],
      included_applications: [:mmdb2_decoder],
      mod: {Geolix, []}
    ]
  end

  defp deps do
    [
      {:ex_doc, ">= 0.0.0", only: :dev},
      {:excoveralls, "~> 0.7", only: :test},
      {:hackney, "~> 1.0", only: :test},
      {:mmdb2_decoder, "~> 0.1.0"},
      {:poolboy, "~> 1.0"}
    ]
  end

  defp docs do
    [
      extras: ["CHANGELOG.md", "README.md"],
      main: "readme",
      source_ref: "master",
      source_url: @url_github
    ]
  end

  defp elixirc_paths(:test), do: ["lib", "test/helpers"]
  defp elixirc_paths(_), do: ["lib"]

  defp package do
    %{
      files: ["CHANGELOG.md", "LICENSE", "mix.exs", "README.md", "lib"],
      licenses: ["Apache 2.0"],
      links: %{"GitHub" => @url_github},
      maintainers: ["Marc Neudert"]
    }
  end
end


Added parentheses to remove ambiguity

Added parentheses to remove ambiguity

This reduces compiler warnings

defmodule ExTwiml.Mixfile do
  use Mix.Project

  def project do
    [app: :ex_twiml,
     description: "Generate TwiML with Elixir",
     version: "2.1.2",
     elixir: "~> 1.0",
     deps: deps(),
     dialyzer: [
       plt_file: "#{System.get_env("HOME")}/#{plt_filename()}",
       flags: ["--no_native", "-Wno_match", "-Wno_return"]
     ],
     package: package()]
  end

  # Configuration for the OTP application
  #
  # Type `mix help compile.app` for more information
  def application do
    [applications: [:logger]]
  end

  # Dependencies can be Hex packages:
  #
  #   {:mydep, "~> 0.3.0"}
  #
  # Or git/path repositories:
  #
  #   {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag: "0.1.0"}
  #
  # Type `mix help deps` for more examples and options
  defp deps do
    [
      {:ex_doc, ">= 0.0.0", only: [:dev, :docs]},
      {:inch_ex, ">= 0.0.0", only: :docs}
    ]
  end

  defp package do
    [
      files: ["lib", "mix.exs", "README.md", "CHANGELOG.md", "SIGNED.md", "LICENSE"],
      maintainers: ["Daniel Berkompas"],
      licenses: ["MIT"],
      links: %{
        "Github" => "https://github.com/danielberkompas/ex_twiml"
      }
    ]
  end

  defp plt_filename do
    "elixir-#{System.version}_#{otp_release()}.plt"
  end

  defp otp_release do
    case System.get_env("TRAVIS_OTP_RELEASE") do
      nil     -> :erlang.system_info(:otp_release)
      release -> release
    end
  end
end

defmodule ExTwiml.Mixfile do
  use Mix.Project

  def project do
    [app: :ex_twiml,
     description: "Generate TwiML with Elixir",
     version: "2.1.2",
     elixir: "~> 1.0",
     deps: deps,
     dialyzer: [
       plt_file: "#{System.get_env("HOME")}/#{plt_filename}",
       flags: ["--no_native", "-Wno_match", "-Wno_return"]
     ],
     package: package]
  end

  # Configuration for the OTP application
  #
  # Type `mix help compile.app` for more information
  def application do
    [applications: [:logger]]
  end

  # Dependencies can be Hex packages:
  #
  #   {:mydep, "~> 0.3.0"}
  #
  # Or git/path repositories:
  #
  #   {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag: "0.1.0"}
  #
  # Type `mix help deps` for more examples and options
  defp deps do
    [
      {:ex_doc, ">= 0.0.0", only: [:dev, :docs]},
      {:inch_ex, ">= 0.0.0", only: :docs}
    ]
  end

  defp package do
    [
      files: ["lib", "mix.exs", "README.md", "CHANGELOG.md", "SIGNED.md", "LICENSE"],
      maintainers: ["Daniel Berkompas"],
      licenses: ["MIT"],
      links: %{
        "Github" => "https://github.com/danielberkompas/ex_twiml"
      }
    ]
  end

  defp plt_filename do
    "elixir-#{System.version}_#{otp_release}.plt"
  end

  defp otp_release do
    case System.get_env("TRAVIS_OTP_RELEASE") do
      nil     -> :erlang.system_info(:otp_release)
      release -> release
    end
  end
end


set extra_applications and runtime false

defmodule HttpProxy.Mixfile do
  use Mix.Project

  def project do
    [app: :http_proxy,
     version: "1.2.2",
     elixir: "~> 1.4",
     name: "ExHttpProxy",
     source_url: "https://github.com/KazuCocoa/http_proxy",
     description: "Multi port HTTP Proxy and support record/play request.",
     build_embedded: Mix.env == :prod,
     start_permanent: Mix.env == :prod,
     deps: deps(),
     package: package(),
     aliases: aliases(),
     test_coverage: [tool: ExCoveralls],
     preferred_cli_env: ["coveralls": :test, "coveralls.detail": :test, "coveralls.post": :test, "coveralls.html": :test],
     preferred_cli_env: [
          vcr: :test, "vcr.delete": :test, "vcr.check": :test, "vcr.show": :test
        ],
     docs: docs()
    ]
  end

  def application do
    [
      extra_applications: [:logger],
      mod: {HttpProxy, []}
    ]
  end

  defp aliases do
    [
      proxy: ["run --no-halt"],
      test: ["coveralls"]
    ]
  end

  defp deps do
    [
      {:cowboy, "~> 1.1.2"},
      {:plug, "~> 1.3.0"},
      {:hackney, "1.6.5"},
      {:exjsx, "~> 4.0.0", runtime: false},
      {:earmark, "~> 1.0", only: :dev, runtime: false},
      {:ex_doc, "~> 0.13", only: :dev, runtime: false},
      {:ex_parameterized, "~> 1.0", only: :test, runtime: false},
      {:credo, "~> 0.3", only: [:dev, :test], runtime: false},
      {:dialyxir, "~> 0.3", only: :dev, runtime: false},
      {:excoveralls, "~> 0.7.0", only: :test, runtime: false}
    ]
  end

  defp package do
    [
      files: ~w(lib mix.exs README.md LICENSE),
      maintainers: ["Kazuaki Matsuo"],
      licenses: ["MIT"],
      links: %{"GitHub" => "https://github.com/KazuCocoa/http_proxy"}
    ]
  end

  defp docs do
    [
      extras: [
        "CHANGELOG.md",
        "README.md"
      ]
    ]
  end
end

defmodule HttpProxy.Mixfile do
  use Mix.Project

  def project do
    [app: :http_proxy,
     version: "1.2.1",
     elixir: "~> 1.4",
     name: "ExHttpProxy",
     source_url: "https://github.com/KazuCocoa/http_proxy",
     description: "Multi port HTTP Proxy and support record/play request.",
     build_embedded: Mix.env == :prod,
     start_permanent: Mix.env == :prod,
     deps: deps(),
     package: package(),
     aliases: aliases(),
     test_coverage: [tool: ExCoveralls],
     preferred_cli_env: ["coveralls": :test, "coveralls.detail": :test, "coveralls.post": :test, "coveralls.html": :test],
     preferred_cli_env: [
          vcr: :test, "vcr.delete": :test, "vcr.check": :test, "vcr.show": :test
        ],
     docs: docs()
    ]
  end

  def application do
    [
      applications: [:logger, :cowboy, :plug, :hackney],
      mod: {HttpProxy, []}
    ]
  end

  defp aliases do
    [
      proxy: ["run --no-halt"],
      test: ["coveralls"]
    ]
  end

  defp deps do
    [
      {:cowboy, "~> 1.1.2" },
      {:plug, "~> 1.3.0"},
      {:hackney, "1.6.5"},
      {:exjsx, "~> 4.0.0"},
      {:earmark, "~> 1.0", only: :dev},
      {:ex_doc, "~> 0.13", only: :dev},
      {:ex_parameterized, "~> 1.0", only: :test},
      {:credo, "~> 0.3", only: [:dev, :test]},
      {:dialyxir, "~> 0.3", only: :dev},
      {:excoveralls, "~> 0.7.0", only: :test}
    ]
  end

  defp package do
    [
      files: ~w(lib mix.exs README.md LICENSE),
      maintainers: ["Kazuaki Matsuo"],
      licenses: ["MIT"],
      links: %{"GitHub" => "https://github.com/KazuCocoa/http_proxy"}
    ]
  end

  defp docs do
    [
      extras: [
        "CHANGELOG.md",
        "README.md"
      ]
    ]
  end
end


v1.0.3 release

v1.0.3 release

defmodule ElixirAle.MixProject do
  use Mix.Project

  def project do
    [
      app: :elixir_ale,
      version: "1.0.3",
      elixir: "~> 1.2",
      name: "elixir_ale",
      description: description(),
      package: package(),
      source_url: "https://github.com/fhunleth/elixir_ale",
      compilers: [:elixir_make] ++ Mix.compilers(),
      make_clean: ["clean"],
      docs: [extras: ["README.md"]],
      aliases: [docs: ["docs", &copy_images/1]],
      build_embedded: Mix.env() == :prod,
      start_permanent: Mix.env() == :prod,
      deps: deps()
    ]
  end

  def application, do: []

  defp description do
    "Elixir access to hardware GPIO, I2C, and SPI interfaces."
  end

  defp package do
    %{
      files: [
        "lib",
        "src/*.[ch]",
        "src/linux/i2c-dev.h",
        "mix.exs",
        "README.md",
        "LICENSE",
        "Makefile"
      ],
      maintainers: ["Frank Hunleth"],
      licenses: ["Apache-2.0"],
      links: %{"GitHub" => "https://github.com/fhunleth/elixir_ale"}
    }
  end

  defp deps do
    [
      {:elixir_make, "~> 0.4", runtime: false},
      {:ex_doc, "~> 0.11", only: :dev}
    ]
  end

  # Copy the images referenced by docs, since ex_doc doesn't do this.
  defp copy_images(_) do
    File.cp_r("assets", "doc/assets")
  end
end

defmodule ElixirAle.MixProject do
  use Mix.Project

  def project do
    [
      app: :elixir_ale,
      version: "1.0.3-dev",
      elixir: "~> 1.2",
      name: "elixir_ale",
      description: description(),
      package: package(),
      source_url: "https://github.com/fhunleth/elixir_ale",
      compilers: [:elixir_make] ++ Mix.compilers(),
      make_clean: ["clean"],
      docs: [extras: ["README.md"]],
      aliases: [docs: ["docs", &copy_images/1]],
      build_embedded: Mix.env() == :prod,
      start_permanent: Mix.env() == :prod,
      deps: deps()
    ]
  end

  def application, do: []

  defp description do
    "Elixir access to hardware GPIO, I2C, and SPI interfaces."
  end

  defp package do
    %{
      files: [
        "lib",
        "src/*.[ch]",
        "src/linux/i2c-dev.h",
        "mix.exs",
        "README.md",
        "LICENSE",
        "Makefile"
      ],
      maintainers: ["Frank Hunleth"],
      licenses: ["Apache-2.0"],
      links: %{"GitHub" => "https://github.com/fhunleth/elixir_ale"}
    }
  end

  defp deps do
    [
      {:elixir_make, "~> 0.4", runtime: false},
      {:ex_doc, "~> 0.11", only: :dev}
    ]
  end

  # Copy the images referenced by docs, since ex_doc doesn't do this.
  defp copy_images(_) do
    File.cp_r("assets", "doc/assets")
  end
end


bump to 1.1.2

bump to 1.1.2

defmodule Closex.Mixfile do
  use Mix.Project

  def project do
    [
      app: :closex,
      version: "1.1.2",
      build_path: "_build",
      config_path: "config/config.exs",
      deps_path: "deps",
      lockfile: "mix.lock",
      elixirc_paths: elixirc_paths(Mix.env()),
      elixir: "~> 1.6",
      description: description(),
      package: package(),
      deps: deps(),
      test_coverage: [tool: ExCoveralls],
      preferred_cli_env: [
        coveralls: :test,
        "coveralls.detail": :test,
        "coveralls.post": :test,
        "coveralls.html": :test
      ],
      start_permanent: Mix.env() == :prod
    ]
  end

  def application do
    [mod: {Closex.Application, []}]
  end

  defp elixirc_paths(:test), do: ["lib", "test/support"]
  defp elixirc_paths(_), do: ["lib"]

  defp deps do
    [
      {:jason, ">= 1.0.0"},
      {:httpoison, ">= 0.0.0"},
      {:exvcr, ">= 0.8.0", only: :test, optional: true},
      {:ex_doc, ">= 0.0.0", only: :dev, optional: true},
      {:excoveralls, ">= 0.4.0", only: :test, optional: true},
      {:dialyxir, ">= 0.0.0", runtime: false, optional: true},
      {:mix_test_watch, ">= 0.3.0", only: :dev, runtime: false, optional: true}
    ]
  end

  defp description() do
    "Close.io HTTP client for Elixir"
  end

  defp package() do
    [
      files: ["lib", "mix.exs", "README.md"],
      maintainers: [
        "Sam Davies",
        "Darren Oakley",
        "Morgan Sadr-Hashemi",
        "Adam Lancaster",
        "Ed Saunders"
      ],
      licenses: ["MIT"],
      source_url: "https://github.com/nested-tech/closex",
      homepage_url: "https://github.com/nested-tech/closex",
      links: %{
        "Nested" => "https://nested.com",
        "Close.io" => "https://close.io",
        "GitHub" => "https://github.com/nested-tech/closex"
      }
    ]
  end
end

defmodule Closex.Mixfile do
  use Mix.Project

  def project do
    [
      app: :closex,
      version: "1.1.1",
      build_path: "_build",
      config_path: "config/config.exs",
      deps_path: "deps",
      lockfile: "mix.lock",
      elixirc_paths: elixirc_paths(Mix.env()),
      elixir: "~> 1.6",
      description: description(),
      package: package(),
      deps: deps(),
      test_coverage: [tool: ExCoveralls],
      preferred_cli_env: [
        coveralls: :test,
        "coveralls.detail": :test,
        "coveralls.post": :test,
        "coveralls.html": :test
      ],
      start_permanent: Mix.env() == :prod
    ]
  end

  def application do
    [mod: {Closex.Application, []}]
  end

  defp elixirc_paths(:test), do: ["lib", "test/support"]
  defp elixirc_paths(_), do: ["lib"]

  defp deps do
    [
      {:jason, ">= 1.0.0"},
      {:httpoison, ">= 0.0.0"},
      {:exvcr, ">= 0.8.0", only: :test, optional: true},
      {:ex_doc, ">= 0.0.0", only: :dev, optional: true},
      {:excoveralls, ">= 0.4.0", only: :test, optional: true},
      {:dialyxir, ">= 0.0.0", runtime: false, optional: true},
      {:mix_test_watch, ">= 0.3.0", only: :dev, runtime: false, optional: true}
    ]
  end

  defp description() do
    "Close.io HTTP client for Elixir"
  end

  defp package() do
    [
      files: ["lib", "mix.exs", "README.md"],
      maintainers: [
        "Sam Davies",
        "Darren Oakley",
        "Morgan Sadr-Hashemi",
        "Adam Lancaster",
        "Ed Saunders"
      ],
      licenses: ["MIT"],
      source_url: "https://github.com/nested-tech/closex",
      homepage_url: "https://github.com/nested-tech/closex",
      links: %{
        "Nested" => "https://nested.com",
        "Close.io" => "https://close.io",
        "GitHub" => "https://github.com/nested-tech/closex"
      }
    ]
  end
end