Current section
13 Versions
Jump to
Current section
13 Versions
Compare versions
5
files changed
+12
additions
-11
deletions
| @@ -80,7 +80,7 @@ for a list of all functions, and detailed info about how they behave. | |
| 80 80 | 1. Add maxwell to your list of dependencies in `mix.exs`: |
| 81 81 | ```ex |
| 82 82 | def deps do |
| 83 | - [{:maxwell, "~> 2.2.1"}] |
| 83 | + [{:maxwell, "~> 2.2.2"}] |
| 84 84 | end |
| 85 85 | ``` |
| 86 86 | 2. Ensure maxwell has started before your application: |
| @@ -42,4 +42,4 @@ | |
| 42 42 | {<<"name">>,<<"ibrowse">>}, |
| 43 43 | {<<"optional">>,true}, |
| 44 44 | {<<"requirement">>,<<"~> 4.2">>}]]}. |
| 45 | - {<<"version">>,<<"2.2.1">>}. |
| 45 | + {<<"version">>,<<"2.2.2">>}. |
| @@ -39,17 +39,17 @@ defmodule Maxwell.Conn do | |
| 39 39 | @type file_body_t :: {:file, Path.t} |
| 40 40 | @type t :: %__MODULE__{ |
| 41 41 | state: :unsent | :sending | :sent | :error, |
| 42 | - method: Atom.t, |
| 42 | + method: atom, |
| 43 43 | url: String.t, |
| 44 44 | path: String.t, |
| 45 | - query_string: Map.t, |
| 45 | + query_string: map, |
| 46 46 | opts: Keyword.t, |
| 47 47 | req_headers: %{binary => binary}, |
| 48 | - req_body: iodata | Map.t | Maxwell.Multipart.t | file_body_t | Stream.t, |
| 48 | + req_body: iodata | map | Maxwell.Multipart.t | file_body_t | Enumerable.t, |
| 49 49 | status: non_neg_integer | nil, |
| 50 50 | resp_headers: %{binary => binary}, |
| 51 | - resp_body: iodata | Map.t, |
| 52 | - private: Map.t |
| 51 | + resp_body: iodata | map, |
| 52 | + private: map |
| 53 53 | } |
| 54 54 | |
| 55 55 | defstruct state: :unsent, |
| @@ -324,7 +324,7 @@ defmodule Maxwell.Conn do | |
| 324 324 | iex> put_req_body(new(), "new body") |
| 325 325 | %Maxwell.Conn{req_body: "new_body"} |
| 326 326 | """ |
| 327 | - @spec put_req_body(t, Stream.t | binary()) :: t | no_return |
| 327 | + @spec put_req_body(t, Enumerable.t | binary()) :: t | no_return |
| 328 328 | def put_req_body(%Conn{state: :unsent} = conn, req_body) do |
| 329 329 | %{conn | req_body: req_body} |
| 330 330 | end |
| @@ -429,7 +429,7 @@ defmodule Maxwell.Conn do | |
| 429 429 | |> put_private(:user_id, "zhongwencool") |
| 430 430 | %Maxwell.Conn{private: %{user_id: "zhongwencool"}} |
| 431 431 | """ |
| 432 | - @spec put_private(t, Atom.t, term()) :: t |
| 432 | + @spec put_private(t, atom, term()) :: t |
| 433 433 | def put_private(%Conn{private: private} = conn, key, value) do |
| 434 434 | new_private = Map.put(private, key, value) |
| 435 435 | %{conn | private: new_private} |
| @@ -444,7 +444,7 @@ defmodule Maxwell.Conn do | |
| 444 444 | |> get_private(:user_id) |
| 445 445 | "zhongwencool" |
| 446 446 | """ |
| 447 | - @spec get_private(t, Atom.t) :: term() |
| 447 | + @spec get_private(t, atom) :: term() |
| 448 448 | def get_private(%Conn{private: private}, key) do |
| 449 449 | Map.get(private, key) |
| 450 450 | end |
| @@ -8,6 +8,7 @@ defmodule Maxwell.Error do | |
| 8 8 | """ |
| 9 9 | defexception [:url, :status, :method, :reason, :message, :conn] |
| 10 10 | |
| 11 | + @spec exception({module, atom | binary, Maxwell.Conn.t}) :: Exception.t |
| 11 12 | def exception({module, reason, conn}) do |
| 12 13 | %Maxwell.Conn{url: url, status: status, method: method, path: path} = conn |
| 13 14 | message = """ |
| @@ -3,7 +3,7 @@ defmodule Maxwell.Mixfile do | |
| 3 3 | |
| 4 4 | def project do |
| 5 5 | [app: :maxwell, |
| 6 | - version: "2.2.1", |
| 6 | + version: "2.2.2", |
| 7 7 | elixir: "~> 1.3", |
| 8 8 | build_embedded: Mix.env == :prod, |
| 9 9 | start_permanent: Mix.env == :prod, |