From 6f5f99c341454b6fc91b5e639d5cca666fd9a989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Fazekas?= Date: Tue, 17 Feb 2026 06:23:52 +0100 Subject: [PATCH 1/6] Use net-ssh 7.3.1.rc1 to fix frozen string literal CI failures Drop EOL Ruby 2.3-2.5 from CI matrix (net-ssh 7.x requires >= 2.6). --- .github/workflows/ci.yml | 2 +- Gemfile | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ef7dbe..b591a28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4', 'ruby-head'] + ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4', 'ruby-head'] continue-on-error: ${{ matrix.ruby-version == 'ruby-head' }} steps: - uses: actions/checkout@v3 diff --git a/Gemfile b/Gemfile index 3062d28..2a61d8c 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,8 @@ source 'https://rubygems.org' # Specify your gem's dependencies in mygem.gemspec gemspec +gem "net-ssh", ">= 7.3.1.rc1" + # TODO: add to gemspec gem "bundler", ">= 1.11" gem "rake", ">= 12.0" From de69d1dd33f50c2049c79b2c8ce92f5e2b286663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Fazekas?= Date: Tue, 17 Feb 2026 06:55:15 +0100 Subject: [PATCH 2/6] Make rdoc/task optional for Ruby 4.0+ compatibility rdoc was removed from default gems in Ruby 4.0. --- Rakefile | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/Rakefile b/Rakefile index d0daedc..f33b836 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,10 @@ require "rubygems" require "rake" require "rake/clean" -require "rdoc/task" +begin + require "rdoc/task" +rescue LoadError +end require "bundler/gem_tasks" desc "When releasing make sure NET_SSH_BUILDGEM_SIGNED is set" @@ -67,17 +70,19 @@ Rake::TestTask.new do |t| end extra_files = %w[LICENSE.txt THANKS.txt CHANGES.txt ] -RDoc::Task.new do |rdoc| - rdoc.rdoc_dir = "rdoc" - rdoc.title = "#{name} #{version}" - rdoc.generator = 'hanna' # gem install hanna-nouveau - rdoc.main = 'README.md' - rdoc.rdoc_files.include("README*") - rdoc.rdoc_files.include("bin/*.rb") - rdoc.rdoc_files.include("lib/**/*.rb") - extra_files.each { |file| - rdoc.rdoc_files.include(file) if File.exist?(file) - } +if defined?(RDoc::Task) + RDoc::Task.new do |rdoc| + rdoc.rdoc_dir = "rdoc" + rdoc.title = "#{name} #{version}" + rdoc.generator = 'hanna' # gem install hanna-nouveau + rdoc.main = 'README.md' + rdoc.rdoc_files.include("README*") + rdoc.rdoc_files.include("bin/*.rb") + rdoc.rdoc_files.include("lib/**/*.rb") + extra_files.each { |file| + rdoc.rdoc_files.include(file) if File.exist?(file) + } + end end def change_version(&block) From 654a391411c9d84ce830b1d71596e1c0135499d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Fazekas?= Date: Sat, 14 Mar 2026 18:11:38 +0100 Subject: [PATCH 3/6] Use net-ssh 7.3.1 final (was rc1) Co-Authored-By: Claude Sonnet 4.6 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 2a61d8c..5eba9d8 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source 'https://rubygems.org' # Specify your gem's dependencies in mygem.gemspec gemspec -gem "net-ssh", ">= 7.3.1.rc1" +gem "net-ssh", ">= 7.3.1" # TODO: add to gemspec gem "bundler", ">= 1.11" From 025a1bf189707f8b4499dff2edff710d54c19f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Fazekas?= Date: Sat, 16 May 2026 12:54:53 +0200 Subject: [PATCH 4/6] Retrigger CI From 5faceef98da64f8775beefe0031cf1f46013aab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Fazekas?= Date: Sat, 16 May 2026 16:35:03 +0200 Subject: [PATCH 5/6] Fix frozen string error in error_string initialization Use mutable string (+''} for channel[:error_string] so appending error messages works with frozen_string_literal enabled. --- lib/net/scp.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net/scp.rb b/lib/net/scp.rb index fdbc745..5b04d98 100644 --- a/lib/net/scp.rb +++ b/lib/net/scp.rb @@ -360,7 +360,7 @@ def start_command(mode, local, remote, options={}, &callback) channel[:buffer ] = Net::SSH::Buffer.new channel[:state ] = "#{mode}_start" channel[:stack ] = [] - channel[:error_string] = '' + channel[:error_string] = +'' channel.on_close do # If we got an exit-status and it is not 0, something went wrong From 931791fa0d16e898f4ce93d2f296466f5a1b7b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Fazekas?= Date: Sat, 16 May 2026 16:56:18 +0200 Subject: [PATCH 6/6] Add logger and rdoc to Gemfile for Ruby 4.0+ compatibility --- Gemfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index 5eba9d8..7d11b77 100644 --- a/Gemfile +++ b/Gemfile @@ -4,10 +4,12 @@ source 'https://rubygems.org' gemspec gem "net-ssh", ">= 7.3.1" +gem "logger" # no longer a default gem in Ruby 4.0+ # TODO: add to gemspec gem "bundler", ">= 1.11" gem "rake", ">= 12.0" +gem "rdoc" gem 'byebug', group: %i[development test] if !Gem.win_platform? && RUBY_ENGINE == "ruby"