diff options
author | kballou <kballou@devnulllabs.io> | 2016-10-30 21:45:46 -0600 |
---|---|---|
committer | kballou <kballou@devnulllabs.io> | 2016-10-30 21:45:46 -0600 |
commit | 34ad7d93000824dd764a7297a91cda831aa9e89a (patch) | |
tree | 3b66791929baf6d06f7de66f620403988b878e71 | |
download | octochat-34ad7d93000824dd764a7297a91cda831aa9e89a.tar.gz octochat-34ad7d93000824dd764a7297a91cda831aa9e89a.tar.xz |
Octochat: Initial commit
-rw-r--r-- | .gitignore | 17 | ||||
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | config/.credo.exs | 66 | ||||
-rw-r--r-- | config/config.exs | 1 | ||||
-rw-r--r-- | lib/octochat.ex | 5 | ||||
-rw-r--r-- | mix.exs | 44 | ||||
-rw-r--r-- | mix.lock | 5 | ||||
-rw-r--r-- | test/octochat_test.exs | 8 | ||||
-rw-r--r-- | test/test_helper.exs | 1 |
9 files changed, 159 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6e1db0f --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# 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 3rd-party dependencies like ExDoc output generated docs. +/doc + +# 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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..14f12ad --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# Octochat # + +Sample application for demonstrating hot code loading/upgrading. + +## LICENSE ## + +This code is released as free and open-source software, AS-IS, without warranty +under the terms and conditions of the GNU General Public License (version 3 or +later). For more information, please consult the included `LICENSE` file or +read the [license online][1]. + +[1]: http://www.gnu.org/licenses/gpl.html diff --git a/config/.credo.exs b/config/.credo.exs new file mode 100644 index 0000000..a9a53e4 --- /dev/null +++ b/config/.credo.exs @@ -0,0 +1,66 @@ +%{ + configs: [ + %{ + name: "default", + files: %{ + included: ["lib/", "src/", "web/", "apps/"], + excluded: [~r"/_build/", ~r"/deps/"] + }, + requires: [], + check_for_updates: false, + checks: [ + {Credo.Check.Consistency.ExceptionNames}, + {Credo.Check.Consistency.LineEndings}, + {Credo.Check.Consistency.SpaceAroundOperators}, + {Credo.Check.Consistency.SpaceInParentheses}, + {Credo.Check.Consistency.TabsOrSpaces}, + + {Credo.Check.Design.AliasUsage, priority: :low}, + + {Credo.Check.Design.DuplicatedCode, excluded_macros: []}, + + {Credo.Check.Design.TagTODO, exit_status: 2}, + {Credo.Check.Design.TagFIXME}, + + {Credo.Check.Readability.FunctionNames}, + {Credo.Check.Readability.LargeNumbers}, + {Credo.Check.Readability.MaxLineLength, priority: :low, max_length: 80}, + {Credo.Check.Readability.ModuleAttributeNames}, + {Credo.Check.Readability.ModuleDoc}, + {Credo.Check.Readability.ModuleNames}, + {Credo.Check.Readability.ParenthesesInCondition}, + {Credo.Check.Readability.PredicateFunctionNames}, + {Credo.Check.Readability.TrailingBlankLine}, + {Credo.Check.Readability.TrailingWhiteSpace}, + {Credo.Check.Readability.VariableNames}, + + {Credo.Check.Refactor.ABCSize}, + {Credo.Check.Refactor.CondStatements}, + {Credo.Check.Refactor.FunctionArity}, + {Credo.Check.Refactor.MatchInCondition}, + {Credo.Check.Refactor.PipeChainStart}, + {Credo.Check.Refactor.CyclomaticComplexity}, + {Credo.Check.Refactor.NegatedConditionsInUnless}, + {Credo.Check.Refactor.NegatedConditionsWithElse}, + {Credo.Check.Refactor.Nesting}, + {Credo.Check.Refactor.UnlessWithElse}, + + {Credo.Check.Warning.IExPry}, + {Credo.Check.Warning.IoInspect}, + {Credo.Check.Warning.NameRedeclarationByAssignment}, + {Credo.Check.Warning.NameRedeclarationByCase}, + {Credo.Check.Warning.NameRedeclarationByDef}, + {Credo.Check.Warning.NameRedeclarationByFn}, + {Credo.Check.Warning.OperationOnSameValues}, + {Credo.Check.Warning.BoolOperationOnSameValues}, + {Credo.Check.Warning.UnusedEnumOperation}, + {Credo.Check.Warning.UnusedKeywordOperation}, + {Credo.Check.Warning.UnusedListOperation}, + {Credo.Check.Warning.UnusedStringOperation}, + {Credo.Check.Warning.UnusedTupleOperation}, + {Credo.Check.Warning.OperationWithConstantResult}, + + ] + } + ] +} 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/octochat.ex b/lib/octochat.ex new file mode 100644 index 0000000..827089e --- /dev/null +++ b/lib/octochat.ex @@ -0,0 +1,5 @@ +defmodule Octochat do + @moduledoc """ + Demonstration application for hot swapping code + """ +end @@ -0,0 +1,44 @@ +defmodule Octochat.Mixfile do + use Mix.Project + + def project do + [app: :octochat, + description: "Demo Application for How Swapping Code", + package: package(), + version: "0.1.0", + elixir: "~> 1.3", + build_embedded: Mix.env == :prod, + start_permanent: Mix.env == :prod, + docs: docs(), + deps: deps()] + end + + def application do + [applications: [:logger]] + end + + defp deps do + [{:credo, "~> 0.5", only: :credo}, + {:distillery, "~> 0.10", only: [:dev, :prod]}, + {:earmark, "~> 0.2", only: :docs}, + {:ex_doc, "~> 0.12", only: :docs}] + end + + defp package do + [maintainers: ["Kenny Ballou"], + licenses: ["GPL-3.0"], + links: %{"Git" => "https://git.devnulllabs.io/octochat.git", + "GitHub" => "https://github.com/kennyballou/octochat"}, + files: ~w(mix.exs README.md LICENSE lib)] + end + + defp docs do + [extras: ["README.md" | get_markdown_files("docs")]] + end + + defp get_markdown_files(path) do + :filelib.fold_files(path, ".*", true, fn(file, acc) -> [file|acc] end, []) + |> Enum.filter(fn(file) -> String.ends_with?(file, ".md") end) + end + +end diff --git a/mix.lock b/mix.lock new file mode 100644 index 0000000..7cb196b --- /dev/null +++ b/mix.lock @@ -0,0 +1,5 @@ +%{"bunt": {:hex, :bunt, "0.1.6", "5d95a6882f73f3b9969fdfd1953798046664e6f77ec4e486e6fafc7caad97c6f", [:mix], []}, + "credo": {:hex, :credo, "0.5.1", "2395862b94628cadf0f5c68975c1440393f425b955f1e70ce1aea267e00187a1", [:mix], [{:bunt, "~> 0.1.6", [hex: :bunt, optional: false]}]}, + "distillery": {:hex, :distillery, "0.10.1", "14fccade4b8ab849b99e21c4bdfaa1092dbacdce8afd33f5c369c6e114385b0e", [:mix], []}, + "earmark": {:hex, :earmark, "0.2.1", "ba6d26ceb16106d069b289df66751734802777a3cbb6787026dd800ffeb850f3", [:mix], []}, + "ex_doc": {:hex, :ex_doc, "0.12.0", "b774aabfede4af31c0301aece12371cbd25995a21bb3d71d66f5c2fe074c603f", [:mix], [{:earmark, "~> 0.2", [hex: :earmark, optional: false]}]}} diff --git a/test/octochat_test.exs b/test/octochat_test.exs new file mode 100644 index 0000000..15ef0c7 --- /dev/null +++ b/test/octochat_test.exs @@ -0,0 +1,8 @@ +defmodule OctochatTest do + use ExUnit.Case + doctest Octochat + + test "the truth" do + assert 1 + 1 == 2 + 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() |