diff --git a/.gitignore b/.gitignore index 062f098..9607671 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -_build/ -ebin/ -deps/ -mix.lock +/_build +/deps +erl_crash.dump +*.ez diff --git a/.travis.yml b/.travis.yml index 45f276e..4ec2cf2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,12 @@ language: erlang otp_release: - 17.1 - - 17.0 -env: - - BUILD_TYPE=rebar REBAR_ENV=test ELIXIR_VERSION=stable - - BUILD_TYPE=mix MIX_ENV=test ELIXIR_VERSION=stable - - BUILD_TYPE=rebar REBAR_ENV=test ELIXIR_VERSION=v0.14.3 - - BUILD_TYPE=mix MIX_ENV=test ELIXIR_VERSION=v0.14.3 - -install: "./.travis_install" -script: "./.travis_build" +before_install: + - wget https://github.com/elixir-lang/elixir/releases/download/v1.0.5/Precompiled.zip + - unzip -d elixir Precompiled.zip +before_script: + - "export PATH=`pwd`/elixir/bin:$PATH" + - mix local.hex --force +script: "MIX_ENV=test mix do deps.get, test" +after_success: + - "mix compile && mix coveralls.travis" diff --git a/.travis_build b/.travis_build deleted file mode 100755 index fa50269..0000000 --- a/.travis_build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -if [ "${BUILD_TYPE}" = "rebar" ]; then - rebar get-deps - rebar compile - rebar compile - rebar skip_deps=true exunit -elif [ "${BUILD_TYPE}" = "mix" ]; then - export PATH="${PWD}/elixir/bin:${PATH}" - mix deps.get - mix deps.compile - mix compile - mix test -fi diff --git a/.travis_install b/.travis_install deleted file mode 100755 index 9b98b4d..0000000 --- a/.travis_install +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -if [ "${BUILD_TYPE}" = "mix" ]; then - git clone --branch ${ELIXIR_VERSION:-stable} git://github.com/elixir-lang/elixir - cd elixir - make - cd .. -fi diff --git a/config/config.exs b/config/config.exs new file mode 100644 index 0000000..6dfa82f --- /dev/null +++ b/config/config.exs @@ -0,0 +1,24 @@ +# This file is responsible for configuring your application +# and its dependencies with the aid of the Mix.Config module. +use Mix.Config + +# This configuration is loaded before any dependency and is restricted +# to this project. If another project depends on this project, this +# file won't be loaded nor affect the parent project. For this reason, +# if you want to provide default values for your application for third- +# party users, it should be done in your mix.exs file. + +# Sample configuration: +# +# config :logger, :console, +# level: :info, +# format: "$date $time [$level] $metadata$message\n", +# metadata: [:user_id] + +# It is also possible to import configuration files, relative to this +# directory. For example, you can emulate configuration per environment +# by uncommenting the line below and defining dev.exs, test.exs and such. +# Configuration from the imported file will override the ones defined +# here (which is why it is important to import them last). +# +# import_config "#{Mix.env}.exs" diff --git a/lib/quaff.ex b/lib/quaff.ex new file mode 100644 index 0000000..6c4e934 --- /dev/null +++ b/lib/quaff.ex @@ -0,0 +1,2 @@ +defmodule Quaff do +end diff --git a/lib/constants.ex b/lib/quaff/constants.ex similarity index 98% rename from lib/constants.ex rename to lib/quaff/constants.ex index e19d675..5dd7e62 100644 --- a/lib/constants.ex +++ b/lib/quaff/constants.ex @@ -21,8 +21,8 @@ defmodule Quaff.Constants do file = opts[:file] || "" line = opts[:line] || -1 msg = opts[:message] || - String.from_char_list!(:io_lib.format( opts[:format], opts[:items] )) - msg = msg <> String.from_char_list!(:io_lib.format( "~n at ~s line ~p", [file,line] )) + List.to_string(:io_lib.format( opts[:format], opts[:items] )) + msg = msg <> "\n at #{file} line #{line}" %__MODULE__{message: msg} end end diff --git a/lib/debug.ex b/lib/quaff/debug.ex similarity index 99% rename from lib/debug.ex rename to lib/quaff/debug.ex index 76943d1..3db731e 100644 --- a/lib/debug.ex +++ b/lib/quaff/debug.ex @@ -66,4 +66,4 @@ defmodule Quaff.Debug do false -> :int.i(arg) end end -end \ No newline at end of file +end diff --git a/mix.exs b/mix.exs index bfad71c..317659d 100644 --- a/mix.exs +++ b/mix.exs @@ -2,23 +2,32 @@ defmodule Quaff.Mixfile do use Mix.Project def project do - [ app: :quaff, - version: "0.0.1", - deps: deps(Mix.env) - ] + [app: :quaff, + version: "0.0.1", + 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 [] end - defp deps(:test) do - [ { :meck, git: "https://github.com/eproxus/meck.git", branch: "master" } | - deps(:prod) ] + # 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 + [{:aleppo, compile: "rebar compile", github: "ChicagoBoss/aleppo", branch: "master"}, + {:meck, "~> 0.8.2"}] end - defp deps(_) do - [ { :aleppo, compile: "rebar compile", - git: "https://github.com/ChicagoBoss/aleppo.git", branch: "master" }, - ] - end -end \ No newline at end of file +end diff --git a/mix.lock b/mix.lock new file mode 100644 index 0000000..c833d46 --- /dev/null +++ b/mix.lock @@ -0,0 +1,2 @@ +%{"aleppo": {:git, "git://github.com/ChicagoBoss/aleppo.git", "d64056219e248f24314dbbd08e3acb636e4f4b81", [branch: "master"]}, + "meck": {:hex, :meck, "0.8.3"}} diff --git a/rebar.config.script b/rebar.config.script deleted file mode 100644 index d2aeb2d..0000000 --- a/rebar.config.script +++ /dev/null @@ -1,29 +0,0 @@ -ElixirVersion = case os:getenv("ELIXIR_VERSION") of - false -> {branch, "stable"}; - V -> V - end, -MainDeps = -[ { elixir, ".*", - {git, "git://github.com/elixir-lang/elixir", ElixirVersion}}, - {aleppo, ".*", - {git, "https://github.com/ChicagoBoss/aleppo.git", {branch, "master"}}}, - { rebar_elixir_plugin, ".*", - {git, "git://github.com/qhool/rebar_elixir_plugin", {branch, "elixir_0.15"}}} -], -Env = case os:getenv("REBAR_ENV") of - false -> dev; - E -> list_to_atom(E) - end, -Deps = case Env of - test -> - [ {meck, ".*", - {git, "https://github.com/eproxus/meck.git", {branch, "master"}}} | MainDeps ]; - _ -> MainDeps - end, -[ {deps, Deps}, - %% get access to mark_keywords in aleppo - {plugins, [rebar_elixir_compiler] ++ case Env of - test -> [rebar_exunit]; - _ -> [] - end}, - {lib_dirs, ["deps/elixir/lib"]} ]. diff --git a/src/quaff.app.src b/src/quaff.app.src deleted file mode 100644 index 62228ff..0000000 --- a/src/quaff.app.src +++ /dev/null @@ -1,6 +0,0 @@ -{application,quaff, - [ - { description, "Quaff the Elixir" }, - { vsn, "0.0.1" }, - { modules, [ 'Elixir.Quaff.Constants' ] } -] }. diff --git a/test/constants_test.exs b/test/constants_test.exs index 5582603..1f5084b 100644 --- a/test/constants_test.exs +++ b/test/constants_test.exs @@ -48,4 +48,4 @@ defmodule Quaff.Constants.Test do assert is_integer(@_SIZEOF_CHAR) assert is_integer(@_SIZEOF_INT) end -end \ No newline at end of file +end diff --git a/test/debug_test.exs b/test/debug_test.exs index 50e6d26..0ae6b6b 100644 --- a/test/debug_test.exs +++ b/test/debug_test.exs @@ -100,4 +100,4 @@ defmodule Quaff.Debug.Test do false end end -end \ No newline at end of file +end diff --git a/test/dummy.ex b/test/dummy.ex index af4e414..5b8ab57 100644 --- a/test/dummy.ex +++ b/test/dummy.ex @@ -12,4 +12,4 @@ defmodule Dummy2 do def x() do 1 end -end \ No newline at end of file +end diff --git a/test/test_helper.exs b/test/test_helper.exs index 8516c83..4b8b246 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -1 +1 @@ -ExUnit.start \ No newline at end of file +ExUnit.start