summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-12-30 13:34:16 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-11-08 09:04:28 +0900
commite6e4b4884d42a228aa342758318e1621c2552b62 (patch)
treea140274ab4242e37cad514878f1e5e9b2299c98c /lib
parent9afd2957edca3f2d72476f1a187ef34ec99b5110 (diff)
[rubygems/rubygems] Hack to get `Gem::Specification#extensions_dir` documented
https://github.com/rubygems/rubygems/commit/625b8293f7
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/rubygems_ext.rb5
-rw-r--r--lib/rubygems/specification.rb22
2 files changed, 17 insertions, 10 deletions
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index cb131a0185..dadac408b7 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -351,9 +351,8 @@ module Gem
end
def extensions_dir
- Gem.default_ext_dir_for(base_dir) ||
- File.join(base_dir, "extensions", ORIGINAL_LOCAL_PLATFORM,
- Gem.extension_api_version)
+ @extensions_dir ||=
+ Gem.default_ext_dir_for(base_dir) || File.join(base_dir, "extensions", ORIGINAL_LOCAL_PLATFORM, Gem.extension_api_version)
end
end
end
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
index 6f69ee22ce..31ef29f02f 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -531,13 +531,6 @@ class Gem::Specification < Gem::BasicSpecification
attr_reader :required_rubygems_version
##
- # The version of RubyGems used to create this gem.
- #
- # Do not set this, it is set automatically when the gem is packaged.
-
- attr_accessor :rubygems_version
-
- ##
# The key used to sign this gem. See Gem::Security for details.
attr_accessor :signing_key
@@ -725,6 +718,21 @@ class Gem::Specification < Gem::BasicSpecification
end
######################################################################
+ # :section: Read-only attributes
+
+ ##
+ # The version of RubyGems used to create this gem.
+
+ attr_accessor :rubygems_version
+
+ ##
+ # The path where this gem installs its extensions.
+
+ def extensions_dir
+ @extensions_dir ||= super
+ end
+
+ ######################################################################
# :section: Specification internals
##