Skip to content

Commit

Permalink
[rubygems/rubygems] Hack to get Gem::Specification#extensions_dir d…
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez authored and hsbt committed Nov 8, 2023
1 parent 9afd295 commit e6e4b48
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
5 changes: 2 additions & 3 deletions lib/bundler/rubygems_ext.rb
Expand Up @@ -351,9 +351,8 @@ class Specification
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
Expand Down
22 changes: 15 additions & 7 deletions lib/rubygems/specification.rb
Expand Up @@ -530,13 +530,6 @@ def require_paths=(val)

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.

Expand Down Expand Up @@ -724,6 +717,21 @@ def test_files=(files) # :nodoc:
@test_files = Array files
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

Expand Down

0 comments on commit e6e4b48

Please sign in to comment.