From 511a18253942a19aaf9d7b61f4e5a12390e0670f Mon Sep 17 00:00:00 2001 From: Igor Alexandrov Date: Thu, 28 Mar 2024 20:25:24 +0400 Subject: [PATCH] Replaced string interpolations with to build paths --- lib/kamal.rb | 2 +- lib/kamal/commands/auditor.rb | 2 +- lib/kamal/commands/hook.rb | 2 +- lib/kamal/configuration.rb | 2 +- lib/kamal/configuration/accessory.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/kamal.rb b/lib/kamal.rb index f5f53805..6b4800a7 100644 --- a/lib/kamal.rb +++ b/lib/kamal.rb @@ -5,6 +5,6 @@ require "active_support" require "zeitwerk" loader = Zeitwerk::Loader.for_gem -loader.ignore("#{__dir__}/kamal/sshkit_with_ext.rb") +loader.ignore(File.join(__dir__, "kamal", "sshkit_with_ext.rb")) loader.setup loader.eager_load # We need all commands loaded. diff --git a/lib/kamal/commands/auditor.rb b/lib/kamal/commands/auditor.rb index ad9c4d16..3e1a71a7 100644 --- a/lib/kamal/commands/auditor.rb +++ b/lib/kamal/commands/auditor.rb @@ -21,7 +21,7 @@ class Kamal::Commands::Auditor < Kamal::Commands::Base def audit_log_file file = [ config.service, config.destination, "audit.log" ].compact.join("-") - "#{config.run_directory}/#{file}" + File.join(config.run_directory, file) end def audit_tags(**details) diff --git a/lib/kamal/commands/hook.rb b/lib/kamal/commands/hook.rb index 679021b2..66fe8b8c 100644 --- a/lib/kamal/commands/hook.rb +++ b/lib/kamal/commands/hook.rb @@ -9,6 +9,6 @@ class Kamal::Commands::Hook < Kamal::Commands::Base private def hook_file(hook) - "#{config.hooks_path}/#{hook}" + File.join(config.hooks_path, hook) end end diff --git a/lib/kamal/configuration.rb b/lib/kamal/configuration.rb index 483ca770..a61e2e55 100644 --- a/lib/kamal/configuration.rb +++ b/lib/kamal/configuration.rb @@ -222,7 +222,7 @@ class Kamal::Configuration def host_env_directory - "#{run_directory}/env" + File.join(run_directory, "env") end def env diff --git a/lib/kamal/configuration/accessory.rb b/lib/kamal/configuration/accessory.rb index 1477031e..42b7754f 100644 --- a/lib/kamal/configuration/accessory.rb +++ b/lib/kamal/configuration/accessory.rb @@ -134,7 +134,7 @@ class Kamal::Configuration::Accessory end def expand_host_path(host_path) - absolute_path?(host_path) ? host_path : "#{service_data_directory}/#{host_path}" + absolute_path?(host_path) ? host_path : File.join(service_data_directory, host_path) end def absolute_path?(path)