diff --git a/lib/pinchflat/notifications/command_runner.ex b/lib/pinchflat/notifications/command_runner.ex new file mode 100644 index 0000000..5481c9d --- /dev/null +++ b/lib/pinchflat/notifications/command_runner.ex @@ -0,0 +1,13 @@ +defmodule Pinchflat.Notifications.CommandRunner do + @moduledoc """ + Runs apprise commands using the `System.cmd/3` function + """ + + require Logger + + @doc """ + # TODO + """ + def run do + end +end diff --git a/lib/pinchflat/yt_dlp/command_runner.ex b/lib/pinchflat/yt_dlp/command_runner.ex index 7512768..f0fcd37 100644 --- a/lib/pinchflat/yt_dlp/command_runner.ex +++ b/lib/pinchflat/yt_dlp/command_runner.ex @@ -7,9 +7,9 @@ defmodule Pinchflat.YtDlp.CommandRunner do alias Pinchflat.Utils.StringUtils alias Pinchflat.Filesystem.FilesystemHelpers, as: FSUtils - alias Pinchflat.YtDlp.BackendCommandRunner + alias Pinchflat.YtDlp.YtDlpCommandRunner - @behaviour BackendCommandRunner + @behaviour YtDlpCommandRunner @doc """ Runs a yt-dlp command and returns the string output. Saves the output to @@ -23,7 +23,7 @@ defmodule Pinchflat.YtDlp.CommandRunner do Returns {:ok, binary()} | {:error, output, status}. """ - @impl BackendCommandRunner + @impl YtDlpCommandRunner def run(url, command_opts, output_template, addl_opts \\ []) do # This approach lets us mock the command for testing command = backend_executable() @@ -48,7 +48,7 @@ defmodule Pinchflat.YtDlp.CommandRunner do end end - @impl BackendCommandRunner + @impl YtDlpCommandRunner def version do command = backend_executable() diff --git a/lib/pinchflat/yt_dlp/backend_command_runner.ex b/lib/pinchflat/yt_dlp/yt_dlp_command_runner.ex similarity index 90% rename from lib/pinchflat/yt_dlp/backend_command_runner.ex rename to lib/pinchflat/yt_dlp/yt_dlp_command_runner.ex index e09eaeb..9b46a32 100644 --- a/lib/pinchflat/yt_dlp/backend_command_runner.ex +++ b/lib/pinchflat/yt_dlp/yt_dlp_command_runner.ex @@ -1,4 +1,4 @@ -defmodule Pinchflat.YtDlp.BackendCommandRunner do +defmodule Pinchflat.YtDlp.YtDlpCommandRunner do @moduledoc """ A behaviour for running CLI commands against a downloader backend (yt-dlp). diff --git a/test/test_helper.exs b/test/test_helper.exs index bea0589..e5f74bb 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -1,4 +1,4 @@ -Mox.defmock(YtDlpRunnerMock, for: Pinchflat.YtDlp.BackendCommandRunner) +Mox.defmock(YtDlpRunnerMock, for: Pinchflat.YtDlp.YtDlpCommandRunner) Application.put_env(:pinchflat, :yt_dlp_runner, YtDlpRunnerMock) Mox.defmock(HTTPClientMock, for: Pinchflat.HTTP.HTTPBehaviour)