Skip to content

Commit 2cda5bb

Browse files
committed
Fixes #38115 - Drop Ruby 2.7 support
We no longer have deployment targets with these versions and it's holding back use of the latest libraries.
1 parent 0705f4d commit 2cda5bb

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

.github/matrix.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"postgresql": ["13"],
3-
"ruby": ["2.7", "3.0"],
3+
"ruby": ["3.0"],
44
"node": ["18"]
55
}

app/models/subnet.rb

+2-8
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,14 @@ def ipaddr
208208
def cidr
209209
return if mask.nil?
210210
IPAddr.new(mask).to_i.to_s(2).count("1")
211-
rescue invalid_address_error
211+
rescue IPAddr::InvalidAddressError
212212
nil
213213
end
214214

215215
def cidr=(cidr)
216216
return if cidr.nil?
217217
self[:mask] = IPAddr.new(in_mask, family).mask(cidr).to_s
218-
rescue invalid_address_error
218+
rescue IPAddr::InvalidAddressError
219219
nil
220220
end
221221

@@ -438,10 +438,4 @@ def new_network_type(args)
438438
raise ::Foreman::Exception.new N_("unknown network_type")
439439
end
440440
end
441-
442-
def invalid_address_error
443-
# IPAddr::InvalidAddressError is undefined for ruby 1.9
444-
return IPAddr::InvalidAddressError if IPAddr.const_defined?('InvalidAddressError')
445-
ArgumentError
446-
end
447441
end

config/application.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class Application < Rails::Application
161161
# Disable fieldWithErrors divs
162162
config.action_view.field_error_proc = proc { |html_tag, instance| html_tag.to_s.html_safe }
163163

164-
# Configure the default encoding used in templates for Ruby 1.9.
164+
# Configure the default encoding used in templates
165165
config.encoding = "utf-8"
166166

167167
# Configure sensitive parameters which will be filtered from the log file.

config/boot.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
unless File.exist?(File.expand_path('../Gemfile.in', __dir__))
44
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
5-
# Set up boootsnap on Ruby 2.7+ in development and test env with Bundler enabled and development/test group
5+
# Set up boootsnap in development and test env with Bundler enabled and development/test group
66
early_env = ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development"
77
require 'active_support/dependencies'
88
require('bootsnap/setup') if %w[development test].include?(early_env) && File.exist?(ENV['BUNDLE_GEMFILE']) && !Gem::Specification.stubs_for("bootsnap").empty?

0 commit comments

Comments
 (0)