Skip to content

Elixir  #371

@wdiechmann

Description

@wdiechmann

May I suggest .ex and .exs providing support for Elixir?

# ./lib/taskrr/repo.ex
defmodule Taskrr.Repo do
  use Ecto.Repo, otp_app: :taskrr

  @doc """
  Dynamically loads the repository url from the
  DATABASE_URL environment variable.
  """
  def init(_, opts) do
    {:ok, Keyword.put(opts, :url, System.get_env("DATABASE_URL"))}
  end
end

# ./mix.exs
defmodule Taskrr.Mixfile do
  use Mix.Project

  def project do
    [app: :taskrr,
     version: "0.0.1",
     elixir: "~> 1.4",
     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: {Taskrr.Application, []},
     extra_applications: [:logger, :runtime_tools]]
  end
end

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions