Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for Ruby 2.0, 2.1, 2.2, 2.3, and 2.4 #549

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

mattbrictson
Copy link
Member

@mattbrictson mattbrictson commented Jan 12, 2025

Already, the latest version of the sshkit gem is no longer installable on Ruby 2.2 or older. See #548.

Rather than add workarounds to the sshkit code to restore compatibility with old versions of Ruby, we've decided to officially drop support for them.

This PR drops support for Ruby 2.0, 2.1, 2.2, 2.3, and 2.4. For reference, Ruby 2.4 was officially EOL'd 4 years and 9 months ago (31 Mar 2020), so it is not unreasonable for us to drop support in 2025.

If users wish to use the sshkit gem on an old version of Ruby, they can still do so by installing an older version. For example, 1.22.0 works on Ruby 2.2.

gem install sshkit -v 1.22.0

@mattbrictson mattbrictson added the ⚠️ Breaking Introduces a backwards-incompatible change label Jan 12, 2025
@@ -77,7 +49,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ["2.0", "ruby"]
ruby: ["2.5", "ruby"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗒️ Run slow functional tests on the oldest Ruby we support (2.5) and the latest Ruby.

@@ -18,12 +18,12 @@ Style/ClassAndModuleChildren:
Enabled: false
Style/DoubleNegation:
Enabled: false
Style/FileName:
Naming/FileName:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗒️ I had to upgrade the rubocop gem to support TargetRubyVersion: 2.5. The new version migrated the names of some cops, hence the changes in these configs.

@@ -1,8 +1,3 @@
source 'https://rubygems.org'

gemspec

# public_suffix 3+ requires ruby 2.1+
if Gem::Requirement.new('< 2.1').satisfied_by?(Gem::Version.new(RUBY_VERSION))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗒️ No longer needed, since we no longer support Ruby < 2.1.

@@ -1,5 +1,4 @@
require "monitor"
require "thread"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗒️ RuboCop flagged this as an unnecessary require (the Thread constant is always available without needing to require it.)

@@ -131,7 +131,7 @@ def test_execute_raises_on_non_zero_exit_status_and_captures_stdout_and_stderr

def test_test_does_not_raise_on_non_zero_exit_status
Netssh.new(a_host) do |_host|
test :false
test :false # rubocop:disable Lint/BooleanSymbol
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗒️ RuboCop thinks this is a typo, and that we mean false and not :false. However in this case :false is the name of a command we are executing via SSH, not a boolean value.

@mattbrictson mattbrictson marked this pull request as ready for review January 12, 2025 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️ Breaking Introduces a backwards-incompatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant