From 5f9f70b1a03c48f43337daa9a708ea627ca413b6 Mon Sep 17 00:00:00 2001 From: Nick Pezza Date: Tue, 8 Oct 2024 10:28:54 -0400 Subject: [PATCH] Update to be able to run on 3.4 with frozen strings --- .github/workflows/ci.yml | 6 ++++++ lib/kamal/commands/base.rb | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4fa1e801..187cb4753 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,7 @@ jobs: - "3.1" - "3.2" - "3.3" + - "3.4.0-preview2" gemfile: - Gemfile - gemfiles/rails_edge.gemfile @@ -41,6 +42,9 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Remove gemfile.lock + run: rm Gemfile.lock + - name: Install Ruby uses: ruby/setup-ruby@v1 with: @@ -49,3 +53,5 @@ jobs: - name: Run tests run: bin/test + env: + RUBYOPT: ${{ matrix.ruby-version == '3.4.0-preview2' && '--enable=frozen-string-literal' || '' }} diff --git a/lib/kamal/commands/base.rb b/lib/kamal/commands/base.rb index 7521780ad..94a04a39c 100644 --- a/lib/kamal/commands/base.rb +++ b/lib/kamal/commands/base.rb @@ -11,13 +11,13 @@ def initialize(config) end def run_over_ssh(*command, host:) - "ssh".tap do |cmd| + "ssh".then do |cmd| if config.ssh.proxy && config.ssh.proxy.is_a?(Net::SSH::Proxy::Jump) - cmd << " -J #{config.ssh.proxy.jump_proxies}" + cmd = "#{cmd} -J #{config.ssh.proxy.jump_proxies}" elsif config.ssh.proxy && config.ssh.proxy.is_a?(Net::SSH::Proxy::Command) - cmd << " -o ProxyCommand='#{config.ssh.proxy.command_line_template}'" + cmd = "#{cmd} -o ProxyCommand='#{config.ssh.proxy.command_line_template}'" end - cmd << " -t #{config.ssh.user}@#{host} -p #{config.ssh.port} '#{command.join(" ").gsub("'", "'\\\\''")}'" + "#{cmd} -t #{config.ssh.user}@#{host} -p #{config.ssh.port} '#{command.join(" ").gsub("'", "'\\\\''")}'" end end