-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Deprecate Ruby 2.6 and Drop support for Ruby 2.5 (#132)
* fix: print deprecation warning if using ruby < 2.7 * chore: continue testing 2.5 and 2.6 * drop support for 2.5 and deprecate 2.6
- Loading branch information
Showing
6 changed files
with
63 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
|
||
module DatadogBackup | ||
module Deprecations | ||
def self.check | ||
if RUBY_VERSION < '2.7' | ||
LOGGER.warn "ruby-#{RUBY_VERSION} is deprecated. Ruby 2.7 or higher will be required to use this gem after datadog_backup@v3" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe DatadogBackup::Deprecations do | ||
let(:logger) { double } | ||
|
||
before do | ||
stub_const('LOGGER', logger) | ||
allow(logger).to receive(:warn) | ||
end | ||
|
||
%w[2.4.10 2.5.9 2.6.8].each do |ruby_version| | ||
describe "#check#{ruby_version}" do | ||
subject { described_class.check } | ||
|
||
it 'does warn' do | ||
stub_const('RUBY_VERSION', ruby_version) | ||
expect(logger).to receive(:warn).with(/ruby-#{ruby_version} is deprecated./) | ||
subject | ||
end | ||
end | ||
end | ||
|
||
%w[2.7.4 3.0.4 3.1.2 3.2.0-preview1].each do |ruby_version| | ||
describe "#check#{ruby_version}" do | ||
subject { described_class.check } | ||
|
||
it 'does not warn' do | ||
stub_const('RUBY_VERSION', ruby_version) | ||
expect(logger).to_not receive(:warn).with(/ruby-#{ruby_version} is deprecated./) | ||
subject | ||
end | ||
end | ||
end | ||
end |