Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require Ruby 2.3+ and drop Ruby 2.2 support #975

Merged
merged 1 commit into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [2.2, 2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, jruby, truffleruby]
ruby: [2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, jruby, truffleruby]

env:
JAVA_OPTS: '-Xmx1024m'
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Current

* (#975) Set the Ruby compatibility version at 2.3
* (#972) Remove Rubinius-related code

## Release v1.1.10

concurrent-ruby:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ be obeyed though. Features developed in `concurrent-ruby-edge` are expected to m

## Supported Ruby versions

* MRI 2.2 and above
* MRI 2.3 and above
* Latest JRuby 9000
* Latest TruffleRuby

Expand Down
2 changes: 1 addition & 1 deletion concurrent-ruby-edge.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ be obeyed though. Features developed in `concurrent-ruby-edge` are expected to m
Please see http://concurrent-ruby.com for more information.
TXT

s.required_ruby_version = '>= 2.2'
s.required_ruby_version = '>= 2.3'

s.add_runtime_dependency 'concurrent-ruby', "~> #{Concurrent::VERSION}"
end
2 changes: 1 addition & 1 deletion concurrent-ruby-ext.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |s|
s.require_paths = ['lib']
s.extensions = 'ext/concurrent-ruby-ext/extconf.rb'

s.required_ruby_version = '>= 2.2'
s.required_ruby_version = '>= 2.3'

s.add_runtime_dependency 'concurrent-ruby', "= #{Concurrent::VERSION}"
end
2 changes: 1 addition & 1 deletion concurrent-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ Gem::Specification.new do |s|
TXT
s.metadata["source_code_uri"] = "https://github.com/ruby-concurrency/concurrent-ruby"
s.metadata["changelog_uri"] = "https://github.com/ruby-concurrency/concurrent-ruby/blob/master/CHANGELOG.md"
s.required_ruby_version = '>= 2.2'
s.required_ruby_version = '>= 2.3'
end
4 changes: 0 additions & 4 deletions lib/concurrent-ruby/concurrent/utility/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ def on_jruby?
RUBY_ENGINE == 'jruby'
end

def on_jruby_9000?
on_jruby? && ruby_version(JRUBY_VERSION, :>=, 9, 0, 0)
end

def on_cruby?
RUBY_ENGINE == 'ruby'
end
Expand Down
48 changes: 23 additions & 25 deletions spec/concurrent/executor/ruby_thread_pool_executor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,36 +157,34 @@ def eventually(mutex: nil, timeout: 5, &block)
end
end

if Concurrent.on_cruby? && Concurrent.ruby_version(:>=, 2, 3, 0)
context 'threads naming' do
subject do
opts = { min_threads: 2 }
opts[:name] = pool_name if pool_name
described_class.new(opts)
end
context 'threads naming' do
subject do
opts = { min_threads: 2 }
opts[:name] = pool_name if pool_name
described_class.new(opts)
end

let(:names) { Concurrent::Set.new }
let(:names) { Concurrent::Set.new }

before do
subject.post(names) { |names| names << Thread.current.name }
subject.post(names) { |names| names << Thread.current.name }
subject.shutdown
subject.wait_for_termination(pool_termination_timeout)
expect(names.size).to eq 2
end
before do
subject.post(names) { |names| names << Thread.current.name }
subject.post(names) { |names| names << Thread.current.name }
subject.shutdown
subject.wait_for_termination(pool_termination_timeout)
expect(names.size).to eq 2
end

context 'without pool name' do
let(:pool_name) { }
it 'sets counted name' do
expect(names.all? { |name| name =~ /^worker-\d+$/ }).to be true
end
context 'without pool name' do
let(:pool_name) { }
it 'sets counted name' do
expect(names.all? { |name| name =~ /^worker-\d+$/ }).to be true
end
end

context 'with pool name' do
let(:pool_name) { 'MyExecutor' }
it 'sets counted name' do
expect(names.all? { |name| name =~ /^MyExecutor-worker-\d+$/ }).to be true
end
context 'with pool name' do
let(:pool_name) { 'MyExecutor' }
it 'sets counted name' do
expect(names.all? { |name| name =~ /^MyExecutor-worker-\d+$/ }).to be true
end
end
end
Expand Down