Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Coveralls and InchCI. #16

Merged
merged 4 commits into from
Apr 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ rel/
# Ignore coverage.
cover/

# Ignore documentation.
docs/

# Ignore crash dumps.
erl_crash.dump

Expand Down
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# 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

```elixir
iex(1)> Xe.rates("USD", "BRL")
iex(1)> Xe.rates("USD", "EUR")
{:ok, {1.00, 0.891482}}
```

## Installation

Standard routine:

1. Add `xe` to your list of dependencies in `mix.exs`:

```elixir
Expand All @@ -21,11 +24,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!
3 changes: 1 addition & 2 deletions lib/xe/fetcher.ex
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 1 addition & 2 deletions lib/xe/parser.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
defmodule Xe.Parser do
@moduledoc ~S"""
"""
@moduledoc false

def parse(body) do
body
Expand Down
23 changes: 15 additions & 8 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down
7 changes: 7 additions & 0 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -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"}}