diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/rubygems_ext.rb | 17 | ||||
-rw-r--r-- | lib/rubygems/specification.rb | 10 |
2 files changed, 17 insertions, 10 deletions
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index 0252e1a81a..ff3defa5b4 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -74,6 +74,23 @@ module Gem end end + alias_method :rg_missing_extensions?, :missing_extensions? + def missing_extensions? + # When we use this methods with local gemspec, we don't handle + # build status of extension correctly. So We need to find extension + # files in require_paths. + # TODO: Gem::Specification couldn't access extension name from extconf.rb + # so we find them with heuristic way. We should improve it. + if source.respond_to?(:root) + return false if (full_require_paths - [extension_dir]).any? do |path| + File.exist?(File.join(path, "#{name}.#{RbConfig::CONFIG['DLEXT']}")) || + !Dir.glob(File.join(path, name, "*.#{RbConfig::CONFIG['DLEXT']}")).empty? + end + end + + rg_missing_extensions? + end + remove_method :gem_dir if instance_methods(false).include?(:gem_dir) def gem_dir full_gem_path diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index d58647c9b5..f018c8ead5 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -2184,16 +2184,6 @@ class Gem::Specification < Gem::BasicSpecification return false if default_gem? return false if File.exist? gem_build_complete_path - # When we use this methods with local gemspec, we don't handle - # build status of extension correctly. So We need to find extension - # files in require_paths. - # TODO: Gem::Specification couldn't access extension name from extconf.rb - # so we find them with heuristic way. We should improve it. - return false if (full_require_paths - [extension_dir]).any? do |path| - File.exist?(File.join(path, "#{name}.#{RbConfig::CONFIG['DLEXT']}")) || - !Dir.glob(File.join(path, name, "*.#{RbConfig::CONFIG['DLEXT']}")).empty? - end - true end |