mirror of
https://github.com/rjNemo/docker_examples
synced 2026-06-06 02:26:45 +00:00
simple elixir example
This commit is contained in:
parent
f1742ce075
commit
4bc60f8d3e
9 changed files with 3 additions and 78 deletions
|
|
@ -1,4 +0,0 @@
|
|||
# Used by "mix format"
|
||||
[
|
||||
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
|
||||
]
|
||||
18
elixir/.gitignore
vendored
18
elixir/.gitignore
vendored
|
|
@ -1,26 +1,10 @@
|
|||
# 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").
|
||||
example-*.tar
|
||||
|
||||
# Temporary files, for example, from tests.
|
||||
/tmp/
|
||||
.elixir_ls
|
||||
|
|
@ -1 +0,0 @@
|
|||
IEx.after_spawn(fn -> Example.hello() |> IO.puts() end)
|
||||
|
|
@ -4,4 +4,4 @@ WORKDIR /app
|
|||
|
||||
COPY . .
|
||||
|
||||
CMD ["iex", "-S", "mix"]
|
||||
CMD ["elixir", "hello.exs"]
|
||||
1
elixir/hello.exs
Normal file
1
elixir/hello.exs
Normal file
|
|
@ -0,0 +1 @@
|
|||
IO.puts("Hello, World!")
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
defmodule Example do
|
||||
@moduledoc """
|
||||
Documentation for `Example`.
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Hello world.
|
||||
|
||||
## Examples
|
||||
|
||||
iex> Example.hello()
|
||||
:world
|
||||
|
||||
"""
|
||||
def hello do
|
||||
:world
|
||||
end
|
||||
end
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
defmodule Example.MixProject do
|
||||
use Mix.Project
|
||||
|
||||
def project do
|
||||
[
|
||||
app: :example,
|
||||
version: "0.1.0",
|
||||
elixir: "~> 1.13",
|
||||
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
|
||||
[
|
||||
# {:dep_from_hexpm, "~> 0.3.0"},
|
||||
# {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}
|
||||
]
|
||||
end
|
||||
end
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
defmodule ExampleTest do
|
||||
use ExUnit.Case
|
||||
doctest Example
|
||||
|
||||
test "greets the world" do
|
||||
assert Example.hello() == :world
|
||||
end
|
||||
end
|
||||
|
|
@ -1 +0,0 @@
|
|||
ExUnit.start()
|
||||
Loading…
Reference in a new issue