summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYuta Saito <kateinoigakukun@gmail.com>2024-05-04 22:36:25 +0000
committergit <svn-admin@ruby-lang.org>2024-06-18 00:59:36 +0000
commit3e4b694565f8459c95283f6ec6aed52ad38cc57a (patch)
tree607bf0d6bbf9afd7db44a1fd10f62e6eff427e37 /lib
parent273d41b9e3c90d4d3fe2ffcb88477197d528b9a0 (diff)
[rubygems/rubygems] Bundler integration for --target-rbconfig option
https://github.com/rubygems/rubygems/commit/f9fb413a19
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/cli.rb2
-rw-r--r--lib/bundler/cli/install.rb4
-rw-r--r--lib/bundler/rubygems_integration.rb4
3 files changed, 10 insertions, 0 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index acd43518f8..76a198b2ae 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -229,6 +229,8 @@ module Bundler
method_option "system", type: :boolean, banner: "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
method_option "trust-policy", alias: "P", type: :string, banner: "Gem trust policy (like gem install -P). Must be one of " +
Bundler.rubygems.security_policy_keys.join("|")
+ method_option "target-rbconfig", type: :string, banner: "rbconfig.rb for the deployment target platform"
+
method_option "without", type: :array, banner: "Exclude gems that are part of the specified named group."
method_option "with", type: :array, banner: "Include gems that are part of the specified named group."
def install
diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb
index a233d5d2e5..8e53728f34 100644
--- a/lib/bundler/cli/install.rb
+++ b/lib/bundler/cli/install.rb
@@ -19,6 +19,10 @@ module Bundler
# Disable color in deployment mode
Bundler.ui.shell = Thor::Shell::Basic.new if options[:deployment]
+ if target_rbconfig_path = options["target-rbconfig"]
+ Bundler.rubygems.set_target_rbconfig(target_rbconfig_path)
+ end
+
check_for_options_conflicts
check_trust_policy
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index b841462263..5f7a2e9c1f 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -34,6 +34,10 @@ module Bundler
Gem::Command.build_args = args
end
+ def set_target_rbconfig(path)
+ Gem.set_target_rbconfig(path)
+ end
+
def loaded_specs(name)
Gem.loaded_specs[name]
end