diff --git a/README.md b/README.md index 539437f..7dd3634 100644 --- a/README.md +++ b/README.md @@ -1 +1,28 @@ -# poa-netstats \ No newline at end of file +# POAAgent + +**TODO: Add description** + +## Run + +POAAgent is an Elixir application, in order to run it first we need to fetch the dependencies and compile it. + +``` +mix deps.get +mix deps.compile +mix compile +``` + +## Run Tests + +In order to run the tests we have to run the command + +``` +mix test +``` + +`POAAgent` comes also with a code analysis tool [Credo](https://github.com/rrrene/credo) and a types checker tool [Dialyxir](https://github.com/jeremyjh/dialyxir). In order to run them we have to run + +``` +mix credo +mix dialyzer +``` \ No newline at end of file diff --git a/config/config.exs b/config/config.exs new file mode 100644 index 0000000..d2d855e --- /dev/null +++ b/config/config.exs @@ -0,0 +1 @@ +use Mix.Config diff --git a/lib/poa_agent.ex b/lib/poa_agent.ex new file mode 100644 index 0000000..464f9b4 --- /dev/null +++ b/lib/poa_agent.ex @@ -0,0 +1,9 @@ +defmodule POAAgent do + @moduledoc """ + Documentation for PoaAgent. + """ + + def hello do + :world + end +end diff --git a/mix.exs b/mix.exs new file mode 100644 index 0000000..aa2d0e2 --- /dev/null +++ b/mix.exs @@ -0,0 +1,26 @@ +defmodule POAAgent.MixProject do + use Mix.Project + + def project do + [ + app: :poa_agent, + version: "0.1.0", + elixir: "~> 1.6", + start_permanent: Mix.env() == :prod, + deps: deps() + ] + end + + def application do + [ + extra_applications: [:logger] + ] + end + + defp deps do + [ + {:credo, "~> 0.9", only: [:dev, :test], runtime: false}, + {:dialyxir, "~> 0.5", only: [:dev], runtime: false} + ] + end +end diff --git a/mix.lock b/mix.lock new file mode 100644 index 0000000..31fa6e1 --- /dev/null +++ b/mix.lock @@ -0,0 +1,6 @@ +%{ + "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [], [], "hexpm"}, + "credo": {:hex, :credo, "0.9.2", "841d316612f568beb22ba310d816353dddf31c2d94aa488ae5a27bb53760d0bf", [], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:poison, ">= 0.0.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"}, + "dialyxir": {:hex, :dialyxir, "0.5.1", "b331b091720fd93e878137add264bac4f644e1ddae07a70bf7062c7862c4b952", [], [], "hexpm"}, + "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [], [], "hexpm"}, +} diff --git a/test/poa_agent_test.exs b/test/poa_agent_test.exs new file mode 100644 index 0000000..ebd07af --- /dev/null +++ b/test/poa_agent_test.exs @@ -0,0 +1,8 @@ +defmodule POAAgentTest do + use ExUnit.Case + doctest POAAgent + + test "greets the world" do + assert POAAgent.hello() == :world + end +end diff --git a/test/test_helper.exs b/test/test_helper.exs new file mode 100644 index 0000000..869559e --- /dev/null +++ b/test/test_helper.exs @@ -0,0 +1 @@ +ExUnit.start()