Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions deps/rabbitmq_cli/lib/rabbitmq/cli/core/command_modules.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defmodule RabbitMQ.CLI.Core.CommandModules do

import RabbitMQ.CLI.Core.CodePath

@commands_ns ~r/RabbitMQ.CLI.(.*).Commands/
@commands_ns ~S"RabbitMQ.CLI.(.*).Commands"

def module_map(opts \\ %{}) do
Application.get_env(:rabbitmqctl, :commands) || load(opts)
Expand Down Expand Up @@ -130,7 +130,7 @@ defmodule RabbitMQ.CLI.Core.CommandModules do
end

defp make_module_map(modules, scope) when modules != nil do
commands_ns = Regex.recompile!(@commands_ns)
commands_ns = Regex.compile!(@commands_ns)

modules
|> Enum.filter(fn mod ->
Expand Down Expand Up @@ -212,7 +212,7 @@ defmodule RabbitMQ.CLI.Core.CommandModules do
defp command_scopes(cmd) do
case CommandBehaviour.scopes(cmd) do
nil ->
Regex.recompile!(@commands_ns)
Regex.compile!(@commands_ns)
|> Regex.run(to_string(cmd), capture: :all_but_first)
|> List.first()
|> to_snake_case
Expand Down
4 changes: 2 additions & 2 deletions deps/rabbitmq_cli/lib/rabbitmq/cli/core/os_pid.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
defmodule RabbitMQ.CLI.Core.OsPid do
@external_process_check_interval 1000

@pid_regex ~r/^\s*(?<pid>\d+)/
@pid_regex ~S"^\s*(?<pid>\d+)"

#
# API
Expand All @@ -27,7 +27,7 @@ defmodule RabbitMQ.CLI.Core.OsPid do
def read_pid_from_file(pidfile_path, should_wait) do
case {:file.read_file(pidfile_path), should_wait} do
{{:ok, contents}, _} ->
pid_regex = Regex.recompile!(@pid_regex)
pid_regex = Regex.compile!(@pid_regex)

case Regex.named_captures(pid_regex, contents)["pid"] do
# e.g. the file is empty
Expand Down