summaryrefslogtreecommitdiff
path: root/lib/bundler/stub_specification.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/stub_specification.rb')
-rw-r--r--lib/bundler/stub_specification.rb42
1 files changed, 17 insertions, 25 deletions
diff --git a/lib/bundler/stub_specification.rb b/lib/bundler/stub_specification.rb
index 0dd024024a..bef94b505e 100644
--- a/lib/bundler/stub_specification.rb
+++ b/lib/bundler/stub_specification.rb
@@ -13,17 +13,13 @@ module Bundler
attr_accessor :stub, :ignored
- # Pre 2.2.0 did not include extension_dir
- # https://github.com/rubygems/rubygems/commit/9485ca2d101b82a946d6f327f4bdcdea6d4946ea
- if Bundler.rubygems.provides?(">= 2.2.0")
- def source=(source)
- super
- # Stub has no concept of source, which means that extension_dir may be wrong
- # This is the case for git-based gems. So, instead manually assign the extension dir
- return unless source.respond_to?(:extension_dir_name)
- path = File.join(stub.extensions_dir, source.extension_dir_name)
- stub.extension_dir = File.expand_path(path)
- end
+ def source=(source)
+ super
+ # Stub has no concept of source, which means that extension_dir may be wrong
+ # This is the case for git-based gems. So, instead manually assign the extension dir
+ return unless source.respond_to?(:extension_dir_name)
+ path = File.join(stub.extensions_dir, source.extension_dir_name)
+ stub.extension_dir = File.expand_path(path)
end
def to_yaml
@@ -32,11 +28,9 @@ module Bundler
# @!group Stub Delegates
- if Bundler.rubygems.provides?(">= 2.3")
- # This is defined directly to avoid having to load every installed spec
- def missing_extensions?
- stub.missing_extensions?
- end
+ # This is defined directly to avoid having to load every installed spec
+ def missing_extensions?
+ stub.missing_extensions?
end
def activated
@@ -57,16 +51,14 @@ module Bundler
stub.full_gem_path || method_missing(:full_gem_path)
end
- if Bundler.rubygems.provides?(">= 2.2.0")
- def full_require_paths
- stub.full_require_paths
- end
+ def full_require_paths
+ stub.full_require_paths
+ end
- # This is what we do in bundler/rubygems_ext
- # full_require_paths is always implemented in >= 2.2.0
- def load_paths
- full_require_paths
- end
+ # This is what we do in bundler/rubygems_ext
+ # full_require_paths is always implemented
+ def load_paths
+ full_require_paths
end
def loaded_from