drewkerrigan/riak-elixir-client — pull request #6 by j-mcnally (2014-09-28 07:26:50+00:00)
Title: Update for Elixir 1.0.0

Updates for compatability with elixir 1.0.0

Also i reworked the way the OTP application works. It can now be included in a consumers application and automatically started and configured by the consuming applications supervisor. I took the approach from Ecto, but i am very new to elixir so this may be the wrong way to do things.

In my app I use it like this

```
defmodule RiakClient do
use Riak

def conf do
host = System.get_env("RIAK_HOST") || "127.0.0.1"
port = System.get_env("RIAK_PORT") || "8087"
host = to_char_list(host)
port = elem(Integer.parse(port), 0)
Riak.configure(host: host, port: port)
end

end
```

And in my supervisor
```
defmodule Struct do
use Application

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

children = [worker(Repo, []), worker(RiakClient, [])]

opts = [strategy: :one_for_one, name: Struct.Supervisor]
Supervisor.start_link(children, opts)
end
end
```

let me know about the downfalls of this.