Skip to content

Commit

Permalink
Release v0.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmj committed Aug 31, 2014
1 parent 6188bab commit 9af4e1e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/hex/registry.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/hex/util.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 10 additions & 4 deletions lib/mix/tasks/hex/user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9af4e1e

Please sign in to comment.