From e3c73c112698d34a1c5eb3b27f9277f294e70249 Mon Sep 17 00:00:00 2001 From: Michael Williams Date: Fri, 1 Apr 2016 16:52:42 -0700 Subject: [PATCH 1/4] Don't document internal modules. --- lib/xe/fetcher.ex | 3 +-- lib/xe/parser.ex | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/xe/fetcher.ex b/lib/xe/fetcher.ex index 83164aa..e9f2da7 100644 --- a/lib/xe/fetcher.ex +++ b/lib/xe/fetcher.ex @@ -1,6 +1,5 @@ defmodule Xe.Fetcher do - @moduledoc ~S""" - """ + @moduledoc false # Make the base url we use to fetch rates from overridable so we can use mock # edpoints for end-to-end testing. diff --git a/lib/xe/parser.ex b/lib/xe/parser.ex index 5339e2b..3708a2f 100644 --- a/lib/xe/parser.ex +++ b/lib/xe/parser.ex @@ -1,6 +1,5 @@ defmodule Xe.Parser do - @moduledoc ~S""" - """ + @moduledoc false def parse(body) do body From e8ff4c1c80fb88832bff977ec909e9d8b48744f4 Mon Sep 17 00:00:00 2001 From: Michael Williams Date: Fri, 1 Apr 2016 16:54:09 -0700 Subject: [PATCH 2/4] Example rate is of USD/EUR rather than USR/BRL. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bb51e2a..4bc0db3 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Xe is a dead-simple way of converting between currencies. It uses real-time conv ## Example ```elixir - iex(1)> Xe.rates("USD", "BRL") + iex(1)> Xe.rates("USD", "EUR") {:ok, {1.00, 0.891482}} ``` From 4fda2dbf9437811293fbc4fab77146c07c31fb1d Mon Sep 17 00:00:00 2001 From: Michael Williams Date: Fri, 1 Apr 2016 16:54:32 -0700 Subject: [PATCH 3/4] Installation is easier than that! --- README.md | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4bc0db3..eb1821b 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,6 @@ Xe is a dead-simple way of converting between currencies. It uses real-time conv ## Installation -Standard routine: - 1. Add `xe` to your list of dependencies in `mix.exs`: ```elixir @@ -21,11 +19,6 @@ Standard routine: end ``` - 2. Ensure `xe` is started before your application: - - ```elixir - def application do - [applications: [:xe]] - end - ``` + 2. Drink your :tea: + 3. Enjoy! From 316b0653fccb0a9c9ebc86204d7103110028f993 Mon Sep 17 00:00:00 2001 From: Michael Williams Date: Fri, 1 Apr 2016 17:14:58 -0700 Subject: [PATCH 4/4] Setup Coveralls and InchCI. --- .gitignore | 3 +++ .travis.yml | 13 +++++++++++++ README.md | 5 +++++ mix.exs | 23 +++++++++++++++-------- mix.lock | 7 +++++++ 5 files changed, 43 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 1880b9e..99c2e21 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,9 @@ rel/ # Ignore coverage. cover/ +# Ignore documentation. +docs/ + # Ignore crash dumps. erl_crash.dump diff --git a/.travis.yml b/.travis.yml index 7c0e7fd..9d2b6fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,18 @@ +sudo: false language: elixir elixir: - 1.2.3 otp_release: - 18.2.1 +script: + - mix test +after_script: + - MIX_ENV=test mix coveralls.travis + - mix deps.get --only docs + - MIX_ENV=docs mix inch.report +notifications: + email: + recipients: + - m.t.williams@live.com + on_success: change + on_failure: change diff --git a/README.md b/README.md index eb1821b..15fa339 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # Xe +[![Continuous Integration](https://img.shields.io/travis/paulodiniz/xe/master.svg)](https://travis-ci.org/paulodiniz/xe) +[![Code Coverage](https://img.shields.io/coveralls/paulodiniz/xe/master.svg)](https://coveralls.io/github/paulodiniz/xe) +[![Documentation](http://inch-ci.org/github/paulodiniz/xe.svg)](http://inch-ci.org/github/paulodiniz/xe) +[![Package](https://img.shields.io/hexpm/dt/xe.svg)](https://hex.pm/packages/xe) + Xe is a dead-simple way of converting between currencies. It uses real-time conversion rates from [Xe.com](http://www.xe.com) ## Example diff --git a/mix.exs b/mix.exs index 530e6e1..f3ce5d9 100644 --- a/mix.exs +++ b/mix.exs @@ -15,7 +15,8 @@ defmodule Xe.Mixfile do deps: deps, escript: escript_config, package: package, - docs: docs] + docs: docs, + test_coverage: [tool: ExCoveralls]] end def application do @@ -42,13 +43,19 @@ defmodule Xe.Mixfile do defp elixirc_paths(_), do: elixirc_paths defp elixirc_paths, do: ~w(lib) - defp deps do - [{:decimal, "~> 1.0"}, - {:httpoison, "~> 0.8"}, - {:floki, "~> 0.7"}, - {:ex_doc, "~> 0.10", only: :docs}, - {:earmark, "~> 0.1", only: :docs}] - end + defp deps do [ + {:decimal, "~> 1.0"}, + {:httpoison, "~> 0.8"}, + {:floki, "~> 0.7"}, + + # Testing + {:excoveralls, "~> 0.4", only: :test}, + + # Documentation + {:ex_doc, "~> 0.10", only: :docs}, + {:earmark, "~> 0.1", only: :docs}, + {:inch_ex, ">= 0.0.0", only: :docs} + ] end defp escript_config do [main_module: Xe.CLI] diff --git a/mix.lock b/mix.lock index 21fc4c4..0108a3a 100644 --- a/mix.lock +++ b/mix.lock @@ -1,10 +1,17 @@ %{"certifi": {:hex, :certifi, "0.4.0"}, "decimal": {:hex, :decimal, "1.1.1"}, + "earmark": {:hex, :earmark, "0.2.1"}, + "ex_doc": {:hex, :ex_doc, "0.11.4"}, + "excoveralls": {:hex, :excoveralls, "0.5.1"}, + "exjsx": {:hex, :exjsx, "3.2.0"}, "floki": {:hex, :floki, "0.8.0"}, "hackney": {:hex, :hackney, "1.5.7"}, "httpoison": {:hex, :httpoison, "0.8.2"}, "idna": {:hex, :idna, "1.2.0"}, + "inch_ex": {:hex, :inch_ex, "0.5.1"}, + "jsx": {:hex, :jsx, "2.6.2"}, "metrics": {:hex, :metrics, "1.0.1"}, "mimerl": {:hex, :mimerl, "1.0.2"}, "mochiweb_html": {:hex, :mochiweb_html, "2.13.0"}, + "poison": {:hex, :poison, "2.1.0"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.0"}}