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

Defensive 1.9.3 support #773

Merged
merged 1 commit into from Nov 6, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion Rakefile
Expand Up @@ -2,7 +2,15 @@

require_relative 'lib/concurrent/version'
require_relative 'lib/concurrent/utility/engine'
require_relative 'lib/concurrent/utility/193'

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')
Expand Down
2 changes: 0 additions & 2 deletions lib/concurrent.rb
@@ -1,5 +1,3 @@
require 'concurrent/utility/193'

require 'concurrent/version'
require 'concurrent/constants'
require 'concurrent/errors'
Expand Down
17 changes: 0 additions & 17 deletions lib/concurrent/utility/193.rb

This file was deleted.

10 changes: 9 additions & 1 deletion lib/concurrent/utility/native_extension_loader.rb
Expand Up @@ -42,6 +42,14 @@ def load_native_extensions

private

def load_error_path(error)
if error.respond_to? :path
error.path
else
error.message.split(' -- ').last
end
end

def set_c_extensions_loaded
@c_extensions_loaded = true
end
Expand All @@ -54,7 +62,7 @@ def try_load_c_extension(path)
require path
set_c_extensions_loaded
rescue LoadError => e
if e.path == path
if load_error_path(e) == path
# move on with pure-Ruby implementations
# TODO (pitr-ch 12-Jul-2018): warning on verbose?
else
Expand Down