Skip to content

Commit 2b3b29b

Browse files
authored
Merge pull request #466 from rhenium/ky/require-ruby-2.6
require Ruby 2.6 or later
2 parents f6cb25d + 3436bd0 commit 2b3b29b

File tree

8 files changed

+9
-53
lines changed

8 files changed

+9
-53
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
os: [ ubuntu-latest, macos-latest ]
14-
ruby: [ head, "3.0", "2.7", "2.6", "2.5", "2.4", "2.3" ]
14+
ruby: [ head, "3.0", "2.7", "2.6" ]
1515
steps:
1616
- name: repo checkout
1717
uses: actions/checkout@v2
@@ -38,7 +38,7 @@ jobs:
3838
fail-fast: false
3939
matrix:
4040
os: [ windows-latest ]
41-
ruby: [ mswin, mingw, "3.0", "2.7", "2.6", "2.5", "2.4", "2.3" ]
41+
ruby: [ mswin, mingw, "3.0", "2.7", "2.6" ]
4242
steps:
4343
- name: repo checkout
4444
uses: actions/checkout@v2

ext/openssl/ossl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ void ossl_debug(const char *, ...);
155155
* Include all parts
156156
*/
157157
#include "openssl_missing.h"
158-
#include "ruby_missing.h"
159158
#include "ossl_asn1.h"
160159
#include "ossl_bio.h"
161160
#include "ossl_bn.h"

ext/openssl/ossl_pkey_ec.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,6 @@ static VALUE ossl_ec_group_initialize(int argc, VALUE *argv, VALUE self)
598598
ossl_raise(rb_eArgError, "wrong number of arguments");
599599
}
600600

601-
#if !defined(LIKELY) && !defined(RB_LIKELY)
602-
#define LIKELY(x) (x)
603-
#endif
604601
ASSUME(group);
605602
RTYPEDDATA_DATA(self) = group;
606603

ext/openssl/ruby_missing.h

Lines changed: 0 additions & 24 deletions
This file was deleted.

lib/openssl/buffering.rb

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,6 @@ def consume_rbuff(size=nil)
9999
end
100100
end
101101

102-
if "".respond_to?(:unpack1)
103-
def unpack_byte(str)
104-
str.unpack1("C")
105-
end
106-
else
107-
def unpack_byte(str)
108-
str.unpack("C").first
109-
end
110-
end
111-
112102
public
113103

114104
# call-seq:
@@ -117,7 +107,7 @@ def unpack_byte(str)
117107
# Get the next 8bit byte from `ssl`. Returns `nil` on EOF
118108
def getbyte
119109
byte = read(1)
120-
byte && unpack_byte(byte)
110+
byte && byte.unpack1("C")
121111
end
122112

123113
##

lib/openssl/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module OpenSSL
4-
VERSION = "2.2.1"
4+
VERSION = "3.0.0.pre"
55
end

openssl.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |spec|
22
spec.name = "openssl"
3-
spec.version = "2.2.1"
3+
spec.version = "3.0.0.pre"
44
spec.authors = ["Martin Bosslet", "SHIBATA Hiroshi", "Zachary Scott", "Kazuki Yamaguchi"]
55
spec.email = ["[email protected]"]
66
spec.summary = %q{OpenSSL provides SSL, TLS and general purpose cryptography.}
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
1515
spec.extra_rdoc_files = Dir["*.md"]
1616
spec.rdoc_options = ["--main", "README.md"]
1717

18-
spec.required_ruby_version = ">= 2.3.0"
18+
spec.required_ruby_version = ">= 2.6.0"
1919

2020
spec.metadata["msys2_mingw_dependencies"] = "openssl"
2121
end

test/openssl/utils.rb

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,7 @@ def start_server(verify_mode: OpenSSL::SSL::VERIFY_NONE, start_immediately: true
236236
threads = []
237237
begin
238238
server_thread = Thread.new do
239-
if Thread.method_defined?(:report_on_exception=) # Ruby >= 2.4
240-
Thread.current.report_on_exception = false
241-
end
239+
Thread.current.report_on_exception = false
242240

243241
begin
244242
loop do
@@ -254,9 +252,7 @@ def start_server(verify_mode: OpenSSL::SSL::VERIFY_NONE, start_immediately: true
254252
end
255253

256254
th = Thread.new do
257-
if Thread.method_defined?(:report_on_exception=)
258-
Thread.current.report_on_exception = false
259-
end
255+
Thread.current.report_on_exception = false
260256

261257
begin
262258
server_proc.call(ctx, ssl)
@@ -273,9 +269,7 @@ def start_server(verify_mode: OpenSSL::SSL::VERIFY_NONE, start_immediately: true
273269
end
274270

275271
client_thread = Thread.new do
276-
if Thread.method_defined?(:report_on_exception=)
277-
Thread.current.report_on_exception = false
278-
end
272+
Thread.current.report_on_exception = false
279273

280274
begin
281275
block.call(port)

0 commit comments

Comments
 (0)