Skip to content

Commit bf30bfd

Browse files
authored
Merge pull request #955 from eregon/cleanup_dead_code_for_old_versions
Cleanup dead code for Ruby < 2.2
2 parents 8ffa7bb + 414f800 commit bf30bfd

File tree

8 files changed

+929
-947
lines changed

8 files changed

+929
-947
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ gem 'concurrent-ruby-edge', Concurrent::EDGE_VERSION, options
1212
gem 'concurrent-ruby-ext', Concurrent::VERSION, options.merge(platform: :mri)
1313

1414
group :development do
15-
gem 'rake', (Concurrent.ruby_version :<, 2, 2, 0) ? '~> 12.0' : '~> 13.0'
15+
gem 'rake', '~> 13.0'
1616
gem 'rake-compiler', '~> 1.0', '>= 1.0.7'
1717
gem 'rake-compiler-dock', '~> 1.0'
1818
gem 'pry', '~> 0.11', platforms: :mri

Rakefile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@ require_relative 'lib/concurrent-ruby/concurrent/version'
22
require_relative 'lib/concurrent-ruby-edge/concurrent/edge/version'
33
require_relative 'lib/concurrent-ruby/concurrent/utility/engine'
44

5-
if Concurrent.ruby_version :<, 2, 0, 0
6-
# @!visibility private
7-
module Kernel
8-
def __dir__
9-
File.dirname __FILE__
10-
end
11-
end
12-
end
13-
145
core_gemspec = Gem::Specification.load File.join(__dir__, 'concurrent-ruby.gemspec')
156
ext_gemspec = Gem::Specification.load File.join(__dir__, 'concurrent-ruby-ext.gemspec')
167
edge_gemspec = Gem::Specification.load File.join(__dir__, 'concurrent-ruby-edge.gemspec')

lib/concurrent-ruby-edge/concurrent-edge.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
require 'concurrent/agent'
77
require 'concurrent/channel'
88
require 'concurrent/lazy_register'
9-
require 'concurrent/executor/wrapping_executor' if Concurrent.ruby_version :>=, 2, 1, 0
9+
require 'concurrent/executor/wrapping_executor'
1010

1111
require 'concurrent/edge/lock_free_linked_set'
1212
require 'concurrent/edge/lock_free_queue'
@@ -16,4 +16,4 @@
1616
require 'concurrent/edge/channel'
1717

1818
require 'concurrent/edge/processing_actor'
19-
require 'concurrent/edge/erlang_actor' if Concurrent.ruby_version :>=, 2, 1, 0
19+
require 'concurrent/edge/erlang_actor'

lib/concurrent-ruby-edge/concurrent/edge/erlang_actor.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
if Concurrent.ruby_version :<, 2, 1, 0
2-
raise 'ErlangActor requires at least ruby version 2.1'
3-
end
4-
51
module Concurrent
62

73
# This module provides actor abstraction that has same behaviour as Erlang actor.

lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ module Synchronization
44
# @!visibility private
55
# @!macro internal_implementation_note
66
LockableObjectImplementation = case
7-
when Concurrent.on_cruby? && Concurrent.ruby_version(:<=, 1, 9, 3)
8-
MonitorLockableObject
9-
when Concurrent.on_cruby? && Concurrent.ruby_version(:>, 1, 9, 3)
7+
when Concurrent.on_cruby?
108
MutexLockableObject
119
when Concurrent.on_jruby?
1210
JRubyLockableObject

0 commit comments

Comments
 (0)