Apply quokka pipes rule
This commit is contained in:
+1
-1
@@ -4,6 +4,6 @@
|
|||||||
plugins: [Phoenix.LiveView.HTMLFormatter, Quokka],
|
plugins: [Phoenix.LiveView.HTMLFormatter, Quokka],
|
||||||
inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"],
|
inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"],
|
||||||
quokka: [
|
quokka: [
|
||||||
only: [:module_directives]
|
only: [:module_directives, :pipes]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ defmodule LastFm.Session do
|
|||||||
doc
|
doc
|
||||||
end
|
end
|
||||||
|
|
||||||
defp first(node, path), do: node |> xpath(path) |> take_one
|
defp first(node, path), do: node |> xpath(path) |> take_one()
|
||||||
|
|
||||||
defp take_one([head | _]), do: head
|
defp take_one([head | _]), do: head
|
||||||
defp take_one(_), do: nil
|
defp take_one(_), do: nil
|
||||||
@@ -77,7 +77,7 @@ defmodule LastFm.Session do
|
|||||||
:xmerl_xpath.string(to_charlist(path), node)
|
:xmerl_xpath.string(to_charlist(path), node)
|
||||||
end
|
end
|
||||||
|
|
||||||
def text(node), do: node |> xpath(~c"./text()") |> extract_text
|
def text(node), do: node |> xpath(~c"./text()") |> extract_text()
|
||||||
|
|
||||||
defp extract_text([xmlText(value: value)]), do: List.to_string(value)
|
defp extract_text([xmlText(value: value)]), do: List.to_string(value)
|
||||||
defp extract_text(_x), do: nil
|
defp extract_text(_x), do: nil
|
||||||
|
|||||||
@@ -17,11 +17,10 @@ defmodule MusicLibraryWeb.Telemetry.Storage do
|
|||||||
|
|
||||||
metric_histories_map =
|
metric_histories_map =
|
||||||
metrics
|
metrics
|
||||||
|> Enum.map(fn metric ->
|
|> Map.new(fn metric ->
|
||||||
attach_handler(metric)
|
attach_handler(metric)
|
||||||
{metric, CircularBuffer.new(@history_buffer_size)}
|
{metric, CircularBuffer.new(@history_buffer_size)}
|
||||||
end)
|
end)
|
||||||
|> Map.new()
|
|
||||||
|
|
||||||
{:ok, metric_histories_map}
|
{:ok, metric_histories_map}
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user