Skip to content

Commit

Permalink
Cleanup dead code for Ruby < 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Mar 18, 2022
1 parent 8ffa7bb commit 414f800
Show file tree
Hide file tree
Showing 8 changed files with 929 additions and 947 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gem 'concurrent-ruby-edge', Concurrent::EDGE_VERSION, options
gem 'concurrent-ruby-ext', Concurrent::VERSION, options.merge(platform: :mri)

group :development do
gem 'rake', (Concurrent.ruby_version :<, 2, 2, 0) ? '~> 12.0' : '~> 13.0'
gem 'rake', '~> 13.0'
gem 'rake-compiler', '~> 1.0', '>= 1.0.7'
gem 'rake-compiler-dock', '~> 1.0'
gem 'pry', '~> 0.11', platforms: :mri
Expand Down
9 changes: 0 additions & 9 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ require_relative 'lib/concurrent-ruby/concurrent/version'
require_relative 'lib/concurrent-ruby-edge/concurrent/edge/version'
require_relative 'lib/concurrent-ruby/concurrent/utility/engine'

if Concurrent.ruby_version :<, 2, 0, 0
# @!visibility private
module Kernel
def __dir__
File.dirname __FILE__
end
end
end

core_gemspec = Gem::Specification.load File.join(__dir__, 'concurrent-ruby.gemspec')
ext_gemspec = Gem::Specification.load File.join(__dir__, 'concurrent-ruby-ext.gemspec')
edge_gemspec = Gem::Specification.load File.join(__dir__, 'concurrent-ruby-edge.gemspec')
Expand Down
4 changes: 2 additions & 2 deletions lib/concurrent-ruby-edge/concurrent-edge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
require 'concurrent/agent'
require 'concurrent/channel'
require 'concurrent/lazy_register'
require 'concurrent/executor/wrapping_executor' if Concurrent.ruby_version :>=, 2, 1, 0
require 'concurrent/executor/wrapping_executor'

require 'concurrent/edge/lock_free_linked_set'
require 'concurrent/edge/lock_free_queue'
Expand All @@ -16,4 +16,4 @@
require 'concurrent/edge/channel'

require 'concurrent/edge/processing_actor'
require 'concurrent/edge/erlang_actor' if Concurrent.ruby_version :>=, 2, 1, 0
require 'concurrent/edge/erlang_actor'
4 changes: 0 additions & 4 deletions lib/concurrent-ruby-edge/concurrent/edge/erlang_actor.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
if Concurrent.ruby_version :<, 2, 1, 0
raise 'ErlangActor requires at least ruby version 2.1'
end

module Concurrent

# This module provides actor abstraction that has same behaviour as Erlang actor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ module Synchronization
# @!visibility private
# @!macro internal_implementation_note
LockableObjectImplementation = case
when Concurrent.on_cruby? && Concurrent.ruby_version(:<=, 1, 9, 3)
MonitorLockableObject
when Concurrent.on_cruby? && Concurrent.ruby_version(:>, 1, 9, 3)
when Concurrent.on_cruby?
MutexLockableObject
when Concurrent.on_jruby?
JRubyLockableObject
Expand Down
Loading

0 comments on commit 414f800

Please sign in to comment.