diff --git a/.travis.yml b/.travis.yml index ac06c3c..00752d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,4 +13,6 @@ script: - MIX_ENV=test mix test after_script: - MIX_ENV=test mix coveralls.travis + - mix deps.get --only docs + - MIX_ENV=docs mix inch.report diff --git a/README.md b/README.md index 8cb7cfa..befa688 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Maxwell [![Build Status](https://travis-ci.org/zhongwencool/maxwell.svg?branch=master)](https://travis-ci.org/zhongwencool/maxwell) +[![Inline docs](http://inch-ci.org/github/zhongwencool/maxwell.svg?branch=master)](http://inch-ci.org/github/zhongwencool/maxwell) [![Coveralls Coverage](https://img.shields.io/coveralls/zhongwencool/maxwell.svg)](https://coveralls.io/github/zhongwencool/maxwell) Maxwell is an HTTP client that provides a common interface over many adapters (such as hackney, ibrowse) and embraces the concept of Rack middleware when processing the request/response cycle. diff --git a/lib/maxwell/multipart.ex b/lib/maxwell/multipart.ex index b89452e..19a11b2 100644 --- a/lib/maxwell/multipart.ex +++ b/lib/maxwell/multipart.ex @@ -188,7 +188,7 @@ defmodule Maxwell.Multipart do defp unique(size, acc\\"") defp unique(0, acc), do: acc defp unique(size, acc) do - random = ?a + :random.uniform(?z - ?a) + random = Enum.random(?a..?z) unique(size - 1, << acc::binary, random>>) end diff --git a/mix.exs b/mix.exs index 57731bd..7b87b11 100644 --- a/mix.exs +++ b/mix.exs @@ -38,7 +38,8 @@ defmodule Maxwell.Mixfile do {:excoveralls, "~> 0.5.1", only: :test}, {:ex_doc, ">= 0.11.4", only: [:dev]}, {:markdown, github: "devinus/markdown", only: [:dev]}, - {:cmark, "~> 0.6", only: [:dev]} + {:cmark, "~> 0.6", only: [:dev]}, + {:inch_ex, only: :docs}, ] end diff --git a/mix.lock b/mix.lock index b184f08..a2b6ddc 100644 --- a/mix.lock +++ b/mix.lock @@ -8,6 +8,7 @@ "hoedown": {:git, "https://github.com/hoedown/hoedown.git", "980b9c549b4348d50b683ecee6abee470b98acda", []}, "ibrowse": {:hex, :ibrowse, "4.2.2", "b32b5bafcc77b7277eff030ed32e1acc3f610c64e9f6aea19822abcadf681b4b", [:rebar3], []}, "idna": {:hex, :idna, "1.2.0", "ac62ee99da068f43c50dc69acf700e03a62a348360126260e87f2b54eced86b2", [:rebar3], []}, + "inch_ex": {:hex, :inch_ex, "0.5.5", "b63f57e281467bd3456461525fdbc9e158c8edbe603da6e3e4671befde796a3d", [:mix], [{:poison, "~> 1.5 or ~> 2.0 or ~> 3.0", [hex: :poison, optional: false]}]}, "jsx": {:hex, :jsx, "2.8.0", "749bec6d205c694ae1786d62cea6cc45a390437e24835fd16d12d74f07097727", [:mix, :rebar], []}, "markdown": {:git, "https://github.com/devinus/markdown.git", "38dc74c88d52fd7569ad4f63d32b344d35a7fcce", []}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], []},