Commit f7cd9cb2 authored by Stephane Bortzmeyer's avatar Stephane Bortzmeyer
Browse files

* Addition of a license

* Metadata for Hex
* Some Dialyzer cleanings
parent 4b70b91c
Copyright 2022 Stéphane Bortzmeyer
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
......@@ -17,7 +17,7 @@ defmodule InvalidBase45Error do
defexception message: "Invalid Base45 string"
end
defmodule IOError do
defmodule InputOutputError do
@moduledoc false
defexception message: "Input/output error"
end
......@@ -118,7 +118,7 @@ defmodule Base45 do
# which seems quite wrong, the documentation of binread clearly authorizes :all
data = IO.binread(file, :all)
case data do
{:error, reason} -> raise IOError, reason
{:error, _reason} -> raise InputOutputError
:eof -> ""
other -> Base45.encode(other)
end
......
......@@ -5,11 +5,13 @@ defmodule Base45.MixProject do
[
app: :base45,
name: "base45",
description: "Encode and decode data following the Base45 standard (RFC not yet published)",
version: "0.1.0",
elixir: "~> 1.9",
source_url: "https://framagit.org/base45",
homepage_url: "http://hexdocs.pm/TODO",
homepage_url: "http://hexdocs.pm/base45",
start_permanent: Mix.env() == :prod,
package: package(),
deps: deps()
]
end
......@@ -26,4 +28,12 @@ defmodule Base45.MixProject do
{:ex_doc, "~> 0.27", only: :dev, runtime: false} # For documentation https://github.com/elixir-lang/ex_doc
]
end
defp package do
[
files: ~w(lib test *.exs README.md LICENSE),
licenses: ["Apache-2.0"]
]
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment