From 4f3aa78d10176e6123df636269fa21f59189aa6b Mon Sep 17 00:00:00 2001 From: Thiago Dias Date: Fri, 9 Oct 2020 18:33:49 -0300 Subject: [PATCH] Initial commit --- .formatter.exs | 4 ++++ .gitignore | 8 ++++++++ README.md | 21 +++++++++++++++++++ lib/cassandrax.ex | 18 ++++++++++++++++ mix.exs | 44 ++++++++++++++++++++++++++++++++++++++++ mix.lock | 5 +++++ test/cassandrax_test.exs | 8 ++++++++ test/test_helper.exs | 1 + 8 files changed, 109 insertions(+) create mode 100644 .formatter.exs create mode 100644 .gitignore create mode 100644 README.md create mode 100644 lib/cassandrax.ex create mode 100644 mix.exs create mode 100644 mix.lock create mode 100644 test/cassandrax_test.exs create mode 100644 test/test_helper.exs diff --git a/.formatter.exs b/.formatter.exs new file mode 100644 index 0000000..d2cda26 --- /dev/null +++ b/.formatter.exs @@ -0,0 +1,4 @@ +# Used by "mix format" +[ + inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] +] diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2c214ff --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +/_build/ +/cover/ +/deps/ +/doc/ +/.fetch +erl_crash.dump +*.ez +cassandrax-*.tar diff --git a/README.md b/README.md new file mode 100644 index 0000000..470232d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# Cassandrax + +**TODO: Add description** + +## Installation + +If [available in Hex](https://hex.pm/docs/publish), the package can be installed +by adding `cassandrax` to your list of dependencies in `mix.exs`: + +```elixir +def deps do + [ + {:cassandrax, "~> 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/cassandrax](https://hexdocs.pm/cassandrax). + diff --git a/lib/cassandrax.ex b/lib/cassandrax.ex new file mode 100644 index 0000000..7971ccc --- /dev/null +++ b/lib/cassandrax.ex @@ -0,0 +1,18 @@ +defmodule Cassandrax do + @moduledoc """ + Documentation for `Cassandrax`. + """ + + @doc """ + Hello world. + + ## Examples + + iex> Cassandrax.hello() + :world + + """ + def hello do + :world + end +end diff --git a/mix.exs b/mix.exs new file mode 100644 index 0000000..f40ad0e --- /dev/null +++ b/mix.exs @@ -0,0 +1,44 @@ +defmodule Cassandrax.MixProject do + use Mix.Project + + @version "0.0.1" + @url "https://github.com/loopsocial/cassandrax" + @maintainers ["Thiago Dias"] + + def project do + [ + name: "Cassandrax", + app: :cassandrax, + version: @version, + elixir: "~> 1.10", + source_url: @url, + start_permanent: Mix.env() == :prod, + deps: deps(), + package: package(), + description: "An Elixir Cassandra ORM built on top of Xandra driver." + ] + 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 + [ + {:xandra, "~> 0.13"} + ] + end + + defp package do + [ + maintainers: @maintainers, + licenses: ["MIT"], + links: %{github: @url}, + files: ~w(lib) ++ ~w(CHANGELOG.md LICENSE mix.exs README.md) + ] + end +end diff --git a/mix.lock b/mix.lock new file mode 100644 index 0000000..863f8e5 --- /dev/null +++ b/mix.lock @@ -0,0 +1,5 @@ +%{ + "connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm", "4a0850c9be22a43af9920a71ab17c051f5f7d45c209e40269a1938832510e4d9"}, + "db_connection": {:hex, :db_connection, "2.2.2", "3bbca41b199e1598245b716248964926303b5d4609ff065125ce98bcd368939e", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm", "642af240d8a8affb93b4ba5a6fcd2bbcbdc327e1a524b825d383711536f8070c"}, + "xandra": {:hex, :xandra, "0.13.1", "f82866e6c47527f74f35dd3007b5311121852dd861a29ed1613e27ccfaba0102", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.7", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "a2efdb8921e3b694bf3505e40c5ec9d353d8fa3755cec946be7c18b8236d7230"}, +} diff --git a/test/cassandrax_test.exs b/test/cassandrax_test.exs new file mode 100644 index 0000000..7bcdbbd --- /dev/null +++ b/test/cassandrax_test.exs @@ -0,0 +1,8 @@ +defmodule CassandraxTest do + use ExUnit.Case + doctest Cassandrax + + test "greets the world" do + assert Cassandrax.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()