Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix function call warning #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions lib/waffle/actions/url.ex
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ defmodule Waffle.Actions.Url do
defmacro __using__(_) do
quote do
def urls(file, options \\ []) do
Enum.into __MODULE__.__versions, %{}, fn(r) ->
Enum.into(__MODULE__.__versions(), %{}, fn r ->
{r, __MODULE__.url(file, r, options)}
end
end)
end

def url(file), do: url(file, nil)
Expand All @@ -100,8 +100,9 @@ defmodule Waffle.Actions.Url do
do: url(definition, file, Enum.at(definition.__versions, 0), options)

# Transform standalone file into a tuple of {file, scope}
def url(definition, file, version, options) when is_binary(file) or is_map(file) or is_nil(file),
do: url(definition, {file, nil}, version, options)
def url(definition, file, version, options)
when is_binary(file) or is_map(file) or is_nil(file),
do: url(definition, {file, nil}, version, options)

# Transform file-path into a map with a file_name key
def url(definition, {file, scope}, version, options) when is_binary(file) do
Expand All @@ -122,7 +123,9 @@ defmodule Waffle.Actions.Url do

defp build(definition, version, file_and_scope, options) do
case Versioning.resolve_file_name(definition, version, file_and_scope) do
nil -> nil
nil ->
nil

_ ->
definition.__storage.url(definition, version, file_and_scope, options)
end
Expand Down
Loading