From 00f95dccf8e5bc88fc5953f14bdcd2bd41f8bbf3 Mon Sep 17 00:00:00 2001 From: Izel Nakri Date: Sun, 19 Jun 2016 20:29:19 +0200 Subject: [PATCH] init --- .gitignore | 5 +++ LICENSE.md | 8 +++++ README.md | 20 ++++++++++++ config/config.exs | 30 ++++++++++++++++++ lib/mix/tasks/papertrail/install.ex | 9 ++++++ lib/paper_trail.ex | 2 ++ mix.exs | 48 +++++++++++++++++++++++++++++ mix.lock | 7 +++++ test/paper_trail_test.exs | 8 +++++ test/test_helper.exs | 1 + 10 files changed, 138 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 config/config.exs create mode 100644 lib/mix/tasks/papertrail/install.ex create mode 100644 lib/paper_trail.ex create mode 100644 mix.exs create mode 100644 mix.lock create mode 100644 test/paper_trail_test.exs create mode 100644 test/test_helper.exs diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..755b6055 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/_build +/cover +/deps +erl_crash.dump +*.ez diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..69efc907 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,8 @@ +The MIT License (MIT) +Copyright (c) 2016 Izel Nakri + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 00000000..b9571266 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +# PaperTrail + +**TODO: Add description** + +## Installation + +If [available in Hex](https://hex.pm/docs/publish), the package can be installed as: + + 1. Add paper_trail to your list of dependencies in `mix.exs`: + + def deps do + [{:paper_trail, "~> 0.0.1"}] + end + + 2. Ensure paper_trail is started before your application: + + def application do + [applications: [:paper_trail]] + end + diff --git a/config/config.exs b/config/config.exs new file mode 100644 index 00000000..3e0640b3 --- /dev/null +++ b/config/config.exs @@ -0,0 +1,30 @@ +# This file is responsible for configuring your application +# and its dependencies with the aid of the Mix.Config module. +use Mix.Config + +# This configuration is loaded before any dependency and is restricted +# to this project. If another project depends on this project, this +# file won't be loaded nor affect the parent project. For this reason, +# if you want to provide default values for your application for +# 3rd-party users, it should be done in your "mix.exs" file. + +# You can configure for your application as: +# +# config :paper_trail, key: :value +# +# And access this configuration in your application as: +# +# Application.get_env(:paper_trail, :key) +# +# Or configure a 3rd-party app: +# +# config :logger, level: :info +# + +# It is also possible to import configuration files, relative to this +# directory. For example, you can emulate configuration per environment +# by uncommenting the line below and defining dev.exs, test.exs and such. +# Configuration from the imported file will override the ones defined +# here (which is why it is important to import them last). +# +# import_config "#{Mix.env}.exs" diff --git a/lib/mix/tasks/papertrail/install.ex b/lib/mix/tasks/papertrail/install.ex new file mode 100644 index 00000000..baedbccd --- /dev/null +++ b/lib/mix/tasks/papertrail/install.ex @@ -0,0 +1,9 @@ +defmodule Mix.Tasks.Papertrail.Install do + @shortdoc "my short doc" + + use Mix.Task + + def run(args) do + IO.puts "run called" + end +end diff --git a/lib/paper_trail.ex b/lib/paper_trail.ex new file mode 100644 index 00000000..f098b73b --- /dev/null +++ b/lib/paper_trail.ex @@ -0,0 +1,2 @@ +defmodule PaperTrail do +end diff --git a/mix.exs b/mix.exs new file mode 100644 index 00000000..d3ff3a3e --- /dev/null +++ b/mix.exs @@ -0,0 +1,48 @@ +defmodule PaperTrail.Mixfile do + use Mix.Project + + def project do + [app: :paper_trail, + version: "0.0.2", + elixir: "~> 1.2", + description: description, + build_embedded: Mix.env == :prod, + start_permanent: Mix.env == :prod, + package: package, + deps: deps] + end + + # Configuration for the OTP application + # + # Type "mix help compile.app" for more information + def application do + [] + end + + defp deps do + [ + {:postgrex, ">= 0.0.0"}, + {:ecto, "~> 2.0.0-rc.1"}, + {:poison, "2.1.0"} + ] + end + + defp description do + """ + PaperTrail lets you track and record all the changes in your database. + """ + end + + defp package do + [ + name: :paper_trail, + files: ["lib", "mix.exs", "README*", "LICENSE*"], + maintainers: ["Izel Nakri"], + licenses: ["MIT License"], + links: %{ + # "GitHub" => "https://github.com/ericmj/postgrex", + # "Docs" => "http://ericmj.github.io/postgrex/" + } + ] + end +end diff --git a/mix.lock b/mix.lock new file mode 100644 index 00000000..a89a3cc6 --- /dev/null +++ b/mix.lock @@ -0,0 +1,7 @@ +%{"connection": {:hex, :connection, "1.0.2", "f4a06dd3ecae4141aa66f94ce92ea4c4b8753069472814932f1cadbc3078ab80", [:mix], []}, + "db_connection": {:hex, :db_connection, "1.0.0-rc.1", "4d9ac0db8a6edf401103b85ad29b40188b70adc649ba2a028df6ff2207cfb250", [:mix], [{:sbroker, "~> 1.0.0-beta.2", [hex: :sbroker, optional: true]}, {:poolboy, "~> 1.5", [hex: :poolboy, optional: true]}, {:connection, "~> 1.0.2", [hex: :connection, optional: false]}]}, + "decimal": {:hex, :decimal, "1.1.2", "79a769d4657b2d537b51ef3c02d29ab7141d2b486b516c109642d453ee08e00c", [:mix], []}, + "ecto": {:hex, :ecto, "2.0.0-rc.6", "a207218470d8c6366a20940e33f6f9fcd2e9a34c8e9779b808fe100f88c05f5e", [:mix], [{:poison, "~> 1.5 or ~> 2.0", [hex: :poison, optional: true]}, {:sbroker, "~> 1.0-beta", [hex: :sbroker, optional: true]}, {:postgrex, "~> 0.11.2", [hex: :postgrex, optional: true]}, {:mariaex, "~> 0.7.7", [hex: :mariaex, optional: true]}, {:decimal, "~> 1.0", [hex: :decimal, optional: false]}, {:poolboy, "~> 1.5", [hex: :poolboy, optional: false]}]}, + "poison": {:hex, :poison, "2.1.0", "f583218ced822675e484648fa26c933d621373f01c6c76bd00005d7bd4b82e27", [:mix], []}, + "poolboy": {:hex, :poolboy, "1.5.1", "6b46163901cfd0a1b43d692657ed9d7e599853b3b21b95ae5ae0a777cf9b6ca8", [:rebar], []}, + "postgrex": {:hex, :postgrex, "0.11.2", "139755c1359d3c5c6d6e8b1ea72556d39e2746f61c6ddfb442813c91f53487e8", [:mix], [{:connection, "~> 1.0", [hex: :connection, optional: false]}, {:db_connection, "~> 1.0-rc", [hex: :db_connection, optional: false]}, {:decimal, "~> 1.0", [hex: :decimal, optional: false]}]}} diff --git a/test/paper_trail_test.exs b/test/paper_trail_test.exs new file mode 100644 index 00000000..317a8694 --- /dev/null +++ b/test/paper_trail_test.exs @@ -0,0 +1,8 @@ +defmodule PaperTrailTest do + use ExUnit.Case + doctest PaperTrail + + 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 00000000..869559e7 --- /dev/null +++ b/test/test_helper.exs @@ -0,0 +1 @@ +ExUnit.start()