Skip to content

Commit

Permalink
Hide undocumented functions in Plug.Debugger (#999)
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach authored Dec 21, 2020
1 parent 81f9fae commit d6f8a8b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/plug/debugger.ex
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ defmodule Plug.Debugger do
end
end

@doc false
def run_action(%Plug.Conn{} = conn) do
with %Plug.Conn{body_params: params} <- fetch_body_params(conn),
{:ok, {module, function, args}} <-
Expand All @@ -245,6 +246,7 @@ defmodule Plug.Debugger do
end
end

@doc false
def encoded_actions_for_exception(exception, conn) do
exception_implementation = Plug.Exception.impl_for(exception)

Expand All @@ -265,10 +267,10 @@ defmodule Plug.Debugger do
end
end

def actions_redirect_path(%Plug.Conn{method: "GET", request_path: request_path}),
defp actions_redirect_path(%Plug.Conn{method: "GET", request_path: request_path}),
do: request_path

def actions_redirect_path(conn) do
defp actions_redirect_path(conn) do
case get_req_header(conn, "referer") do
[referer] -> referer
[] -> "/"
Expand Down Expand Up @@ -387,7 +389,7 @@ defmodule Plug.Debugger do
end
end

def has_docs?(module, name, arity) do
defp has_docs?(module, name, arity) do
case Code.fetch_docs(module) do
{:docs_v1, _, _, _, module_doc, _, docs} when module_doc != :hidden ->
Enum.any?(docs, has_doc_matcher?(name, arity))
Expand Down

0 comments on commit d6f8a8b

Please sign in to comment.