diff --git a/.formatter.exs b/.formatter.exs index 525446d..d2cda26 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -1,4 +1,4 @@ # Used by "mix format" [ - inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"] + inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] ] diff --git a/.gitignore b/.gitignore index 0b56156..861ca1d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ # The directory Mix downloads your dependencies sources to. /deps/ -# Where 3rd-party dependencies like ExDoc output generated docs. +# Where third-party dependencies like ExDoc output generated docs. /doc/ # Ignore .fetch files in case you like to edit your project deps locally. @@ -21,4 +21,6 @@ erl_crash.dump # Ignore package tarball (built via "mix hex.build"). thumbox-*.tar -thumbor + +# Temporary files, for example, from tests. +/tmp/ diff --git a/LICENSE b/LICENSE.md similarity index 96% rename from LICENSE rename to LICENSE.md index dfec824..deea435 100644 --- a/LICENSE +++ b/LICENSE.md @@ -1,4 +1,4 @@ -The MIT License (MIT) +# The MIT License (MIT) Copyright (c) 2018 Boris Kotov @@ -6,4 +6,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of 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. \ No newline at end of file +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 index ffdb74d..4715968 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,21 @@ # Thumbox -Generate secure [thumbor](http://thumbor.org) urls on the fly. +Generate secure [thumbor](http://thumbor.org) URLs on the fly. [![Build Status](https://travis-ci.org/webdeb/thumbox.svg?branch=master)](https://travis-ci.org/webdeb/thumbox) -[![HitCount](http://hits.dwyl.io/webdeb/thumbox.svg)](http://hits.dwyl.io/webdeb/thumbox) +[![Module Version](https://img.shields.io/hexpm/v/thumbox.svg)](https://hex.pm/packages/thumbox) +[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/thumbox/) +[![Total Download](https://img.shields.io/hexpm/dt/thumbox.svg)](https://hex.pm/packages/thumbox) +[![License](https://img.shields.io/hexpm/l/thumbox.svg)](https://github.com/webdeb/thumbox/blob/master/LICENSE) +[![Last Updated](https://img.shields.io/github/last-commit/webdeb/thumbox.svg)](https://github.com/webdeb/thumbox/commits/master) -#### The signature generation is tested against the original thumbor implemention. +#### The signature generation is tested against the original thumbor implementation. ## Installation -[available in Hex](https://hex.pm/packages/thumbox), the package can be installed -by adding `thumbox` to your list of dependencies in `mix.exs`: +The package can be installed by adding `:thumbox` to your list of dependencies +in `mix.exs`: ```elixir def deps do @@ -48,6 +52,9 @@ Thumbox.gen_url(:profile_avatar, "uploads/some-user-avatar.jpg") *opts: You can also pass any option from the config to the url generation on the fly.* -## License +## Copyright and License -MIT +Copyright (c) 2018 Boris Kotov + +This work is free. You can redistribute it and/or modify it under the +terms of the MIT License. See the [LICENSE.md](./LICENSE.md) file for more details. diff --git a/mix.exs b/mix.exs index e37ea8e..a6466d8 100644 --- a/mix.exs +++ b/mix.exs @@ -1,46 +1,58 @@ defmodule Thumbox.MixProject do use Mix.Project + @source_url "https://github.com/webdeb/thumbox" + @version "0.1.0" + def project do [ app: :thumbox, + name: "Thumbox", version: "0.1.0", elixir: "~> 1.6", start_permanent: Mix.env() == :prod, deps: deps(), - name: "Thumbox", - description: "Thumbor URL generator helper for elixir", - source_url: "https://github.com/webdeb/thumbox", - package: package(), - docs: [main: "Thumbox", extras: ["README.md"]] + docs: docs(), + package: package() ] end defp package() do [ - # This option is only needed when you don't want to use the OTP application name name: "thumbox", - # These are the default files included in the package + description: "Thumbor URL generator helper for elixir", files: ["lib", "mix.exs", "README*", "LICENSE"], maintainers: ["Boris Kotov"], licenses: ["MIT"], - links: %{"GitHub" => "https://github.com/webdeb/thumbox"} + links: %{"GitHub" => @source_url} ] 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 [ {:stream_data, "~> 0.1", only: :test}, {:jason, "~> 1.0", only: :test}, - {:ex_doc, "~> 0.16", only: :dev, runtime: false} + {:ex_doc, ">= 0.0.0", only: :dev, runtime: false} ] end + + defp docs do + [ + extras: [ + "LICENSE.md": [title: "License"], + "README.md": [title: "Overview"] + ], + main: "readme", + source_url: @source_url, + source_ref: "v#{@version}", + formatters: ["html"] + ] + end + end diff --git a/mix.lock b/mix.lock index 7b4ad5b..6072f64 100644 --- a/mix.lock +++ b/mix.lock @@ -1,6 +1,10 @@ %{ - "earmark": {:hex, :earmark, "1.2.5", "4d21980d5d2862a2e13ec3c49ad9ad783ffc7ca5769cf6ff891a4553fbaae761", [:mix], [], "hexpm"}, - "ex_doc": {:hex, :ex_doc, "0.18.3", "f4b0e4a2ec6f333dccf761838a4b253d75e11f714b85ae271c9ae361367897b7", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}], "hexpm"}, - "jason": {:hex, :jason, "1.0.0", "0f7cfa9bdb23fed721ec05419bcee2b2c21a77e926bce0deda029b5adc716fe2", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"}, - "stream_data": {:hex, :stream_data, "0.4.2", "fa86b78c88ec4eaa482c0891350fcc23f19a79059a687760ddcf8680aac2799b", [:mix], [], "hexpm"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.16", "607709303e1d4e3e02f1444df0c821529af1c03b8578dfc81bb9cf64553d02b9", [:mix], [], "hexpm", "69fcf696168f5a274dd012e3e305027010658b2d1630cef68421d6baaeaccead"}, + "ex_doc": {:hex, :ex_doc, "0.25.4", "2b71b3c7a65816141b52cdb628fd8bff938a7e3c90ab9272c89612a0efa1d3d5", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "5181186926c111a4ba3f3445b6f1ba790d80e2b4b39f8e9b51451f7a061e1c31"}, + "jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"}, + "makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"}, + "makeup_elixir": {:hex, :makeup_elixir, "0.15.2", "dc72dfe17eb240552857465cc00cce390960d9a0c055c4ccd38b70629227e97c", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "fd23ae48d09b32eff49d4ced2b43c9f086d402ee4fd4fcb2d7fad97fa8823e75"}, + "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.1.0", "3a6fca1550363552e54c216debb6a9e95bd8d32348938e13de5eda962c0d7f89", [:mix], [], "hexpm", "08eb32d66b706e913ff748f11694b17981c0b04a33ef470e33e11b3d3ac8f54b"}, + "stream_data": {:hex, :stream_data, "0.5.0", "b27641e58941685c75b353577dc602c9d2c12292dd84babf506c2033cd97893e", [:mix], [], "hexpm", "012bd2eec069ada4db3411f9115ccafa38540a3c78c4c0349f151fc761b9e271"}, }