Skip to content

Commit

Permalink
Merge pull request basecamp#746 from igor-alexandrov/file-join
Browse files Browse the repository at this point in the history
Replaced string interpolations with File.join to build paths
  • Loading branch information
djmb authored Mar 29, 2024
2 parents 8bb596e + 511a182 commit 2562853
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/kamal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ module Kamal
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.
2 changes: 1 addition & 1 deletion lib/kamal/commands/auditor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def reveal
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)
Expand Down
2 changes: 1 addition & 1 deletion lib/kamal/commands/hook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ def hook_exists?(hook)

private
def hook_file(hook)
"#{config.hooks_path}/#{hook}"
File.join(config.hooks_path, hook)
end
end
2 changes: 1 addition & 1 deletion lib/kamal/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def asset_path


def host_env_directory
"#{run_directory}/env"
File.join(run_directory, "env")
end

def env
Expand Down
2 changes: 1 addition & 1 deletion lib/kamal/configuration/accessory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def remote_directories_as_volumes
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)
Expand Down

0 comments on commit 2562853

Please sign in to comment.