Skip to content

Commit

Permalink
Merge pull request #2750 from fluent/drop-ruby-2.1-2.2-2.3
Browse files Browse the repository at this point in the history
Drop ruby 2.1/2.2/2.3 support
  • Loading branch information
repeatedly authored Jan 6, 2020
2 parents 5ef1c03 + 8e6eb93 commit c809788
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 45 deletions.
14 changes: 0 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ cache: bundler
# See here for osx_image -> OSX versions: https://docs.travis-ci.com/user/languages/objective-c
matrix:
include:
- rvm: 2.1.10
os: linux
- rvm: 2.2.10
os: linux
- rvm: 2.2.10
os: linux-ppc64le
- rvm: 2.4.9
os: linux
- rvm: 2.4.9
Expand All @@ -31,19 +25,13 @@ matrix:
os: linux
- rvm: ruby-head
os: linux-ppc64le
- rvm: 2.1.10
os: osx
osx_image: xcode8.3 # OSX 10.12
- rvm: 2.4.6
os: osx
osx_image: xcode8.3 # OSX 10.12
- rvm: ruby-head
os: osx
osx_image: xcode8.3 # OSX 10.12
allow_failures:
- rvm: 2.1.10
os: osx
osx_image: xcode8.3
- rvm: 2.4.6
os: osx
osx_image: xcode8.3
Expand All @@ -56,8 +44,6 @@ matrix:
branches:
only:
- master
- v0.12
- v0.14

sudo: false
dist: trusty # for TLSv1.2 support
Expand Down
5 changes: 1 addition & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ source 'https://rubygems.org/'

gemspec

# https://github.com/socketry/async-io/blob/v1.23.1/async-io.gemspec#L21
if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create('2.3.0')
gem 'async-http', '~> 0.42'
end
gem 'async-http', '~> 0.42'

local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
if File.exist?(local_gemfile)
Expand Down
3 changes: 1 addition & 2 deletions fluentd.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]
gem.license = "Apache-2.0"

gem.required_ruby_version = '>= 2.1'
gem.required_ruby_version = '>= 2.4'

gem.add_runtime_dependency("msgpack", [">= 1.2.0", "< 2.0.0"])
gem.add_runtime_dependency("yajl-ruby", ["~> 1.0"])
Expand All @@ -27,7 +27,6 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency("tzinfo", [">= 1.0", "< 3.0"])
gem.add_runtime_dependency("tzinfo-data", ["~> 1.0"])
gem.add_runtime_dependency("strptime", [">= 0.2.2", "< 1.0.0"])
gem.add_runtime_dependency("dig_rb", ["~> 1.0.0"])

# build gem for a certain platform. see also Rakefile
fake_platform = ENV['GEM_BUILD_FAKE_PLATFORM'].to_s
Expand Down
1 change: 0 additions & 1 deletion lib/fluent/plugin_helper/http_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#

begin
# raise if RUBY_VERSION < 2.3.x. see Gemfile
require 'async'
require 'fluent/plugin_helper/http_server/server'
rescue LoadError => _
Expand Down
8 changes: 0 additions & 8 deletions lib/fluent/plugin_helper/record_accessor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
#

require 'fluent/config/error'
unless {}.respond_to?(:dig)
begin
# backport_dig is faster than dig_rb so prefer backport_dig.
require 'backport_dig'
rescue LoadError
require 'dig_rb'
end
end

module Fluent
module PluginHelper
Expand Down
17 changes: 1 addition & 16 deletions lib/fluent/plugin_helper/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -693,26 +693,11 @@ def write(data)
end
end

if RUBY_VERSION.to_f >= 2.3
NONBLOCK_ARG = { exception: false }
def try_handshake
@_handler_socket.accept_nonblock(**NONBLOCK_ARG)
end
else
def try_handshake
@_handler_socket.accept_nonblock
rescue IO::WaitReadable
:wait_readable
rescue IO::WaitWritable
:wait_writable
end
end

def try_tls_accept
return true if @_handler_accepted

begin
result = try_handshake # this method call actually try to do handshake via TLS
result = @_handler_socket.accept_nonblock(exception: false) # this method call actually try to do handshake via TLS
if result == :wait_readable || result == :wait_writable
# retry accept_nonblock: there aren't enough data in underlying socket buffer
else
Expand Down

0 comments on commit c809788

Please sign in to comment.