Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertDober committed Jul 5, 2024
1 parent 85db491 commit 8dd4437
Show file tree
Hide file tree
Showing 9 changed files with 203 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Used by "mix format"
[
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
]
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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").
ex_aequo_colors-*.tar

# Temporary files, for example, from tests.
/tmp/
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
DO NOT EDIT THIS FILE
It has been generated from the template `README.md.eex` by Extractly (https://github.com/RobertDober/extractly.git)
and any changes you make in this file will most likely be lost
-->

[![CI](https://github.com/RobertDober/ex_aequo_colors/actions/workflows/elixir.yml/badge.svg)](https://github.com/RobertDober/ex_aequo_colors/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/RobertDober/ex_aequo_colors/badge.svg?branch=master)](https://coveralls.io/github/RobertDober/ex_aequo_colors?branch=master)
[![Hex.pm](https://img.shields.io/hexpm/v/ex_aequo_colors.svg)](https://hex.pm/packages/ex_aequo_colors)
[![Hex.pm](https://img.shields.io/hexpm/dw/ex_aequo_colors.svg)](https://hex.pm/packages/ex_aequo_colors)
[![Hex.pm](https://img.shields.io/hexpm/dt/ex_aequo_colors.svg)](https://hex.pm/packages/ex_aequo_colors)

# ExAequoColors

- Use ANSI colors at will

- Install the `colorize` escript to colorize texts (like for help)

- And that's about it

## Author

Copyright © 2024 Robert Dober [email protected]

# LICENSE

GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 or later. Please refer to [LICENSE](LICENSE) for details.
<!--SPDX-License-Identifier: AGPL-3.0-or-later-->
24 changes: 24 additions & 0 deletions README.md.eex
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<%= xtra.do_not_edit_warning template: template %>

[![CI](https://github.com/RobertDober/ex_aequo_colors/actions/workflows/elixir.yml/badge.svg)](https://github.com/RobertDober/ex_aequo_colors/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/RobertDober/ex_aequo_colors/badge.svg?branch=master)](https://coveralls.io/github/RobertDober/ex_aequo_colors?branch=master)
[![Hex.pm](https://img.shields.io/hexpm/v/ex_aequo_colors.svg)](https://hex.pm/packages/ex_aequo_colors)
[![Hex.pm](https://img.shields.io/hexpm/dw/ex_aequo_colors.svg)](https://hex.pm/packages/ex_aequo_colors)
[![Hex.pm](https://img.shields.io/hexpm/dt/ex_aequo_colors.svg)](https://hex.pm/packages/ex_aequo_colors)

# ExAequoColors

- Use ANSI colors at will

- Install the `colorize` escript to colorize texts (like for help)

- And that's about it

## Author

Copyright © 2024 Robert Dober [email protected]

# LICENSE

GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 or later. Please refer to [LICENSE](LICENSE) for details.
<!--SPDX-License-Identifier: AGPL-3.0-or-later-->
18 changes: 18 additions & 0 deletions lib/ex_aequo_colors.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
defmodule ExAequoColors do
@moduledoc """
Documentation for `ExAequoColors`.
"""

@doc """
Hello world.
## Examples
iex> ExAequoColors.hello()
:world
"""
def hello do
:world
end
end
87 changes: 87 additions & 0 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
defmodule SimpleArgs.MixProject do
use Mix.Project
@version "0.1.0"
@url "https://github.com/RobertDober/ex_aequo_colors"

def project do
[
app: :ex_aequo_colors,
version: @version,
elixir: "~> 1.17",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
deps: deps(),
description: "Extracting all color related code and colorize escript from ex_aequo",
package: package(),
preferred_cli_env: [
coveralls: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test
],
test_coverage: [tool: ExCoveralls],
aliases: [docs: &build_docs/1]
]
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
[
{:dialyxir, "~> 1.4.3", only: [:dev], runtime: false},
{:excoveralls, "~> 0.18.1", only: [:test]},
{:extractly, "~> 0.5.4", only: [:dev]},
]
end

defp package do
[
files: [
"lib",
"mix.exs",
"README.md",
"LICENSE"
],
maintainers: [
"Robert Dober <[email protected]>"
],
licenses: [
"AGPL-3.0-or-later"
],
links: %{
"GitHub" => @url
}
]
end

defp elixirc_paths(:test), do: ["lib", "examples", "test/support"]
defp elixirc_paths(:dev), do: ["lib", "examples", "dev"]
defp elixirc_paths(_), do: ["lib"]

@module "ExAequoColors"

defp build_docs(_) do
Mix.Task.run("compile")
ex_doc = Path.join(Mix.path_for(:escripts), "ex_doc")
Mix.shell().info("Using escript: #{ex_doc} to build the docs")

unless File.exists?(ex_doc) do
raise "cannot build docs because escript for ex_doc is not installed, " <>
"make sure to run `mix escript.install hex ex_doc` before"
end

args = [@module, @version, Mix.Project.compile_path()]
opts = ~w[--main #{@module} --source-ref v#{@version} --source-url #{@url}]

Mix.shell().info("Running: #{ex_doc} #{inspect(args ++ opts)}")
System.cmd(ex_doc, args ++ opts)
Mix.shell().info("Docs built successfully")
end
end
# SPDX-License-Identifier: AGPL-3.0-or-later
7 changes: 7 additions & 0 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
%{
"dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"},
"erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
"excoveralls": {:hex, :excoveralls, "0.18.1", "a6f547570c6b24ec13f122a5634833a063aec49218f6fff27de9df693a15588c", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "d65f79db146bb20399f23046015974de0079668b9abb2f5aac074d078da60b8d"},
"extractly": {:hex, :extractly, "0.5.4", "22ff3a624d814227ba842a2b59a38b1298df5531dbd4772dcbe9b97e05627145", [:mix], [], "hexpm", "612e16920317b2fb963b2da013019a614ba12b928d535a053a1efb21ddaa6268"},
"jason": {:hex, :jason, "1.4.3", "d3f984eeb96fe53b85d20e0b049f03e57d075b5acda3ac8d465c969a2536c17b", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "9a90e868927f7c777689baa16d86f4d0e086d968db5c05d917ccff6d443e58a3"},
}
8 changes: 8 additions & 0 deletions test/ex_aequo_colors_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
defmodule ExAequoColorsTest do
use ExUnit.Case
doctest ExAequoColors

test "greets the world" do
assert ExAequoColors.hello() == :world
end
end
1 change: 1 addition & 0 deletions test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ExUnit.start()

0 comments on commit 8dd4437

Please sign in to comment.