From 796520d6f4eceea26319001b602f231f7923037d Mon Sep 17 00:00:00 2001 From: Jamil Bou Kheir Date: Mon, 4 May 2020 22:14:05 -0700 Subject: [PATCH] Add cf_vpn app for great good --- apps/cf_vpn/.formatter.exs | 4 ++++ apps/cf_vpn/.gitignore | 24 +++++++++++++++++++ apps/cf_vpn/README.md | 21 +++++++++++++++++ apps/cf_vpn/lib/cf_vpn.ex | 18 ++++++++++++++ apps/cf_vpn/lib/cf_vpn/application.ex | 19 +++++++++++++++ apps/cf_vpn/mix.exs | 34 +++++++++++++++++++++++++++ apps/cf_vpn/test/cf_vpn_test.exs | 8 +++++++ apps/cf_vpn/test/test_helper.exs | 1 + 8 files changed, 129 insertions(+) create mode 100644 apps/cf_vpn/.formatter.exs create mode 100644 apps/cf_vpn/.gitignore create mode 100644 apps/cf_vpn/README.md create mode 100644 apps/cf_vpn/lib/cf_vpn.ex create mode 100644 apps/cf_vpn/lib/cf_vpn/application.ex create mode 100644 apps/cf_vpn/mix.exs create mode 100644 apps/cf_vpn/test/cf_vpn_test.exs create mode 100644 apps/cf_vpn/test/test_helper.exs diff --git a/apps/cf_vpn/.formatter.exs b/apps/cf_vpn/.formatter.exs new file mode 100644 index 000000000..d2cda26ed --- /dev/null +++ b/apps/cf_vpn/.formatter.exs @@ -0,0 +1,4 @@ +# Used by "mix format" +[ + inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] +] diff --git a/apps/cf_vpn/.gitignore b/apps/cf_vpn/.gitignore new file mode 100644 index 000000000..d53754fbd --- /dev/null +++ b/apps/cf_vpn/.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"). +cf_vpn-*.tar + diff --git a/apps/cf_vpn/README.md b/apps/cf_vpn/README.md new file mode 100644 index 000000000..02a6afa2a --- /dev/null +++ b/apps/cf_vpn/README.md @@ -0,0 +1,21 @@ +# CfVpn + +**TODO: Add description** + +## Installation + +If [available in Hex](https://hex.pm/docs/publish), the package can be installed +by adding `cf_vpn` to your list of dependencies in `mix.exs`: + +```elixir +def deps do + [ + {:cf_vpn, "~> 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/cf_vpn](https://hexdocs.pm/cf_vpn). + diff --git a/apps/cf_vpn/lib/cf_vpn.ex b/apps/cf_vpn/lib/cf_vpn.ex new file mode 100644 index 000000000..45940c157 --- /dev/null +++ b/apps/cf_vpn/lib/cf_vpn.ex @@ -0,0 +1,18 @@ +defmodule CfVpn do + @moduledoc """ + Documentation for `CfVpn`. + """ + + @doc """ + Hello world. + + ## Examples + + iex> CfVpn.hello() + :world + + """ + def hello do + :world + end +end diff --git a/apps/cf_vpn/lib/cf_vpn/application.ex b/apps/cf_vpn/lib/cf_vpn/application.ex new file mode 100644 index 000000000..3d6d5f577 --- /dev/null +++ b/apps/cf_vpn/lib/cf_vpn/application.ex @@ -0,0 +1,19 @@ +defmodule CfVpn.Application do + # See https://hexdocs.pm/elixir/Application.html + # for more information on OTP Applications + @moduledoc false + + use Application + + def start(_type, _args) do + children = [ + # Starts a worker by calling: CfVpn.Worker.start_link(arg) + # {CfVpn.Worker, arg} + ] + + # See https://hexdocs.pm/elixir/Supervisor.html + # for other strategies and supported options + opts = [strategy: :one_for_one, name: CfVpn.Supervisor] + Supervisor.start_link(children, opts) + end +end diff --git a/apps/cf_vpn/mix.exs b/apps/cf_vpn/mix.exs new file mode 100644 index 000000000..794a8a5b8 --- /dev/null +++ b/apps/cf_vpn/mix.exs @@ -0,0 +1,34 @@ +defmodule CfVpn.MixProject do + use Mix.Project + + def project do + [ + app: :cf_vpn, + version: "0.1.0", + build_path: "../../_build", + config_path: "../../config/config.exs", + deps_path: "../../deps", + lockfile: "../../mix.lock", + 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], + mod: {CfVpn.Application, []} + ] + 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"}, + # {:sibling_app_in_umbrella, in_umbrella: true} + ] + end +end diff --git a/apps/cf_vpn/test/cf_vpn_test.exs b/apps/cf_vpn/test/cf_vpn_test.exs new file mode 100644 index 000000000..ebfc8157a --- /dev/null +++ b/apps/cf_vpn/test/cf_vpn_test.exs @@ -0,0 +1,8 @@ +defmodule CfVpnTest do + use ExUnit.Case + doctest CfVpn + + test "greets the world" do + assert CfVpn.hello() == :world + end +end diff --git a/apps/cf_vpn/test/test_helper.exs b/apps/cf_vpn/test/test_helper.exs new file mode 100644 index 000000000..869559e70 --- /dev/null +++ b/apps/cf_vpn/test/test_helper.exs @@ -0,0 +1 @@ +ExUnit.start()