1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Revert "[close #1811] Minimum Ruby version >= 2.5"

This commit is contained in:
Richard Schneeman 2019-06-14 14:00:54 -05:00 committed by GitHub
parent c242e76f4d
commit 0cd28f373a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 18 additions and 15 deletions

View file

@ -1,6 +1,6 @@
AllCops:
DisabledByDefault: true
TargetRubyVersion: 2.5
TargetRubyVersion: 2.2
DisplayCopNames: true
StyleGuideCopsOnly: false
Exclude:

View file

@ -8,7 +8,8 @@ before_install:
r_eng="$(ruby -e 'STDOUT.write RUBY_ENGINE')";
rv="$(ruby -e 'STDOUT.write RUBY_VERSION')";
if [ "$r_eng" == "ruby" ]; then
if [ "$rv" \< "2.6" ]; then gem update --system --no-document --conservative
if [ "$rv" \< "2.3" ]; then gem update --system 2.7.9 --no-document
elif [ "$rv" \< "2.6" ]; then gem update --system --no-document --conservative
fi
fi
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
@ -24,6 +25,9 @@ script:
- bundle exec rake
rvm:
- 2.2.10
- 2.3.8
- 2.4.6
- 2.5.5
- 2.6.3
- ruby-head
@ -33,6 +37,9 @@ matrix:
include:
- rvm: ruby-head
env: RUBYOPT="--jit"
- rvm: 2.4.6
os: osx
osx_image: xcode10.2
- rvm: 2.5.5
os: osx
osx_image: xcode10.2

View file

@ -9,7 +9,6 @@
* Add option to suppress SignalException on SIGTERM (#1690)
* Allow mutual TLS CA to be set using `ssl_bind` DSL (#1689)
* Reactor now uses nio4r instead of `select` (#1728)
* Minimum Ruby version now >= 2.5 (#1813)
* x bugfixes
* Do not accept new requests on shutdown (#1685, #1808)
* Fix 3 corner cases when request body is chunked (#1508)

View file

@ -63,7 +63,7 @@ module Puma
remove = []
ENV.each do |k,v|
if /PUMA_INHERIT_\d+/.match?(k)
if k =~ /PUMA_INHERIT_\d+/
fd, url = v.split(":", 2)
@inherited_fds[url] = fd.to_i
remove << k
@ -75,7 +75,7 @@ module Puma
key = [ :unix, Socket.unpack_sockaddr_un(sock.getsockname) ]
rescue ArgumentError
port, addr = Socket.unpack_sockaddr_in(sock.getsockname)
if /\:/.match?(addr)
if addr =~ /\:/
addr = "[#{addr}]"
end
key = [ :tcp, addr, port ]

View file

@ -348,7 +348,7 @@ module Puma
end
if bytes
token = +""
token = "".dup
bytes.each_byte { |b| token << b.to_s(16) }
else
token = (0..count).to_a.map { rand(255).to_s(16) }.join

View file

@ -105,7 +105,7 @@ module Puma
# On Linux, use TCP_CORK to better control how the TCP stack
# packetizes our stream. This improves both latency and throughput.
#
if RUBY_PLATFORM.match?(/linux/)
if RUBY_PLATFORM =~ /linux/
UNPACK_TCP_STATE_FROM_TCP_INFO = "C".freeze
# 6 == Socket::IPPROTO_TCP

View file

@ -17,8 +17,5 @@ Gem::Specification.new do |s|
%w[History.md LICENSE README.md]
s.homepage = "http://puma.io"
s.license = "BSD-3-Clause"
# We will guarantee to support the last 2 major releases,
# and may choose to support further back as we see fit.
s.required_ruby_version = Gem::Requirement.new(">= 2.5")
s.required_ruby_version = Gem::Requirement.new(">= 2.2")
end

View file

@ -11,7 +11,7 @@ log = File.read("t1-stdout")
File.unlink "t1-stdout" if File.file? "t1-stdout"
File.unlink "t1-pid" if File.file? "t1-pid"
if %r!GET / HTTP/1\.1!.match?(log)
if log =~ %r!GET / HTTP/1\.1!
exit 0
else
exit 1

View file

@ -186,7 +186,7 @@ class TestIntegration < Minitest::Test
until done
@events.stdout.rewind
log = @events.stdout.readlines.join("")
if /- Worker \d \(pid: \d+\) booted, phase: 1/.match?(log)
if log =~ /- Worker \d \(pid: \d+\) booted, phase: 1/
assert_match(/TERM sent/, log)
assert_match(/- Worker \d \(pid: \d+\) booted, phase: 1/, log)
done = true

View file

@ -37,7 +37,7 @@ class TestPersistent < Minitest::Test
end
def lines(count, s=@client)
str = +""
str = "".dup
Timeout.timeout(5) do
count.times { str << s.gets }
end

View file

@ -13,7 +13,7 @@ Make-Const repo_name 'puma'
Make-Const url_repo 'https://github.com/puma/puma.git'
#———————————————————————————————————————————————————————————————— lowest ruby version
Make-Const ruby_vers_low 25
Make-Const ruby_vers_low 22
# null = don't compile; false = compile, ignore test (allow failure);
# true = compile & test
Make-Const trunk $false ; Make-Const trunk_x64 $false