Remove support for Ruby 2.6 (#21477)
As pointed out by https://github.com/mastodon/mastodon/pull/21297#discussion_r1028372193 at least one of our dependencies already dropped support for Ruby 2.6, and we had removed Ruby 2.6 tests from the CI over a year ago (#16861). So stop advertising Ruby 2.6 support, bump targeted version, and drop some compatibility code.main
parent
47f0d7021e
commit
098ced7420
@ -1,26 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
module Enumerable
|
|
||||||
# TODO: Remove this once stop to support Ruby 2.6
|
|
||||||
if RUBY_VERSION < '2.7.0'
|
|
||||||
def filter_map
|
|
||||||
if block_given?
|
|
||||||
result = []
|
|
||||||
each do |element|
|
|
||||||
res = yield element
|
|
||||||
result << res if res
|
|
||||||
end
|
|
||||||
result
|
|
||||||
else
|
|
||||||
Enumerator.new do |yielder|
|
|
||||||
result = []
|
|
||||||
each do |element|
|
|
||||||
res = yielder.yield element
|
|
||||||
result << res if res
|
|
||||||
end
|
|
||||||
result
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Reference in new issue