diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e295565c..a685ac71f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ -## v0.4.2 +## v0.4.2 (2014-08-31) * Enhancements * Add task `hex.user whoami` that prints the locally authorized user + * Add task `hex.user deauth` to deauthorize the local user * Rename environment variable `HEX_URL` to `HEX_API` to not confuse it with `HEX_CDN` * Bug fixes diff --git a/lib/hex/registry.ex b/lib/hex/registry.ex index 5537e1371..79f8dfa84 100644 --- a/lib/hex/registry.ex +++ b/lib/hex/registry.ex @@ -119,7 +119,7 @@ defmodule Hex.Registry do case :ets.lookup(get_tid(), {package, version}) do [] -> nil - [{{^package, ^version}, [_, checksum | _]}] when is_nil(checksum) or is_binary(checksum) -> + [{{^package, ^version}, [_, checksum | _]}] when nil?(checksum) or is_binary(checksum) -> checksum end end diff --git a/lib/hex/util.ex b/lib/hex/util.ex index 0c8f23d0d..773ec721d 100644 --- a/lib/hex/util.ex +++ b/lib/hex/util.ex @@ -191,7 +191,7 @@ defmodule Hex.Util do do: binary defp binarify(number) when is_number(number), do: number - defp binarify(atom) when is_nil(atom) or is_boolean(atom), + defp binarify(atom) when nil?(atom) or is_boolean(atom), do: atom defp binarify(atom) when is_atom(atom), do: Atom.to_string(atom) diff --git a/lib/mix/tasks/hex/user.ex b/lib/mix/tasks/hex/user.ex index 2ea8a4e18..7b1f4ba24 100644 --- a/lib/mix/tasks/hex/user.ex +++ b/lib/mix/tasks/hex/user.ex @@ -22,10 +22,16 @@ defmodule Mix.Tasks.Hex.User do `mix hex.user auth` - ### Update user options + ### Deauthorize the user - `mix hex.user update` + Deauthorizes the user from the local machine by removing the API key from the + hex config. + + `mix hex.user deauth` + ### Update user configuration + + `mix hex.user update` """ @switches [clean_pass: :boolean] @@ -89,7 +95,7 @@ defmodule Mix.Tasks.Hex.User do new_email = Mix.shell.prompt("Email:") |> String.strip |> nillify new_password = Util.password_get("Password:", clean?) |> String.strip |> nillify - unless is_nil(new_password) do + unless nil?(new_password) do confirm = Util.password_get("Password (confirm):", clean?) |> String.strip |> nillify if password != confirm do Mix.raise "Entered passwords do not match" @@ -118,7 +124,7 @@ defmodule Mix.Tasks.Hex.User do email = Mix.shell.prompt("Email:") |> String.strip password = Util.password_get("Password:", clean?) |> String.strip - unless is_nil(password) do + unless nil?(password) do confirm = Util.password_get("Password (confirm):", clean?) |> String.strip if password != confirm do Mix.raise "Entered passwords do not match" diff --git a/mix.exs b/mix.exs index fdf33898c..125e339da 100644 --- a/mix.exs +++ b/mix.exs @@ -3,8 +3,8 @@ defmodule Hex.Mixfile do def project do [app: :hex, - version: "0.4.2-dev", - elixir: "~> 1.0.0-rc1", + version: "0.4.2", + elixir: "~> 0.15.0 or ~> 1.0.0-rc1", aliases: aliases, deps: deps] end