diff --git a/assessments/semiprimes/server/.formatter.exs b/assessments/semiprimes/server/.formatter.exs new file mode 100644 index 000000000..d2cda26ed --- /dev/null +++ b/assessments/semiprimes/server/.formatter.exs @@ -0,0 +1,4 @@ +# Used by "mix format" +[ + inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] +] diff --git a/assessments/semiprimes/server/.gitignore b/assessments/semiprimes/server/.gitignore new file mode 100644 index 000000000..db9704a85 --- /dev/null +++ b/assessments/semiprimes/server/.gitignore @@ -0,0 +1,24 @@ +# The directory Mix will write compiled artifacts to. +/_build/ + +# If you run "mix test --cover", coverage assets end up here. +/cover/ + +# The directory Mix downloads your dependencies sources to. +/deps/ + +# Where third-party dependencies like ExDoc output generated docs. +/doc/ + +# Ignore .fetch files in case you like to edit your project deps locally. +/.fetch + +# If the VM crashes, it generates a dump, let's ignore it too. +erl_crash.dump + +# Also ignore archive artifacts (built via "mix archive.build"). +*.ez + +# Ignore package tarball (built via "mix hex.build"). +server-*.tar + diff --git a/assessments/semiprimes/server/README.md b/assessments/semiprimes/server/README.md new file mode 100644 index 000000000..f5a7dad59 --- /dev/null +++ b/assessments/semiprimes/server/README.md @@ -0,0 +1,21 @@ +# Server + +**TODO: Add description** + +## Installation + +If [available in Hex](https://hex.pm/docs/publish), the package can be installed +by adding `server` to your list of dependencies in `mix.exs`: + +```elixir +def deps do + [ + {:server, "~> 0.1.0"} + ] +end +``` + +Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) +and published on [HexDocs](https://hexdocs.pm). Once published, the docs can +be found at [https://hexdocs.pm/server](https://hexdocs.pm/server). + diff --git a/assessments/semiprimes/server/lib/server.ex b/assessments/semiprimes/server/lib/server.ex new file mode 100644 index 000000000..7240fc342 --- /dev/null +++ b/assessments/semiprimes/server/lib/server.ex @@ -0,0 +1,18 @@ +defmodule Server do + @moduledoc """ + Documentation for `Server`. + """ + + @doc """ + Hello world. + + ## Examples + + iex> Server.hello() + :world + + """ + def hello do + :world + end +end diff --git a/assessments/semiprimes/server/mix.exs b/assessments/semiprimes/server/mix.exs new file mode 100644 index 000000000..0efb638e1 --- /dev/null +++ b/assessments/semiprimes/server/mix.exs @@ -0,0 +1,27 @@ +defmodule Server.MixProject do + use Mix.Project + + def project do + [ + app: :server, + version: "0.1.0", + elixir: "~> 1.10", + start_permanent: Mix.env() == :prod, + deps: deps() + ] + end + + # Run "mix help compile.app" to learn about applications. + def application do + [ + extra_applications: [:logger] + ] + end + + # Run "mix help deps" to learn about dependencies. + defp deps do + [ + {:cortex, "~> 0.1", only: [:dev, :test]} + ] + end +end diff --git a/assessments/semiprimes/server/mix.lock b/assessments/semiprimes/server/mix.lock new file mode 100644 index 000000000..066a7cadd --- /dev/null +++ b/assessments/semiprimes/server/mix.lock @@ -0,0 +1,4 @@ +%{ + "cortex": {:hex, :cortex, "0.6.0", "8094830fae266eb0ae34d1a58983c0c49484341f5044fb4dfb81746647bd2993", [:mix], [{:file_system, "~> 0.2", [hex: :file_system, repo: "hexpm", optional: false]}], "hexpm", "d0ef5a2b1269626149118684dc4ea77dbfbc67017f4b4065b71dcefa26cfcc49"}, + "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, +} diff --git a/assessments/semiprimes/server/test/server_test.exs b/assessments/semiprimes/server/test/server_test.exs new file mode 100644 index 000000000..4fa9b617b --- /dev/null +++ b/assessments/semiprimes/server/test/server_test.exs @@ -0,0 +1,8 @@ +defmodule ServerTest do + use ExUnit.Case + doctest Server + + test "greets the world" do + assert Server.hello() == :world + end +end diff --git a/assessments/semiprimes/server/test/test_helper.exs b/assessments/semiprimes/server/test/test_helper.exs new file mode 100644 index 000000000..869559e70 --- /dev/null +++ b/assessments/semiprimes/server/test/test_helper.exs @@ -0,0 +1 @@ +ExUnit.start()