diff options
| author | Shinichi Maeshima <netwillnet@gmail.com> | 2026-05-05 17:13:52 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2026-05-08 08:08:04 +0000 |
| commit | 842c847c79d57de4c2d9b3199679fceaab839899 (patch) | |
| tree | bf3517b97566f941272ab8f5b7546b9066ed994b | |
| parent | 607648d5fc98782018a40c45079d300c48f684c4 (diff) | |
[ruby/rubygems] Simplify the code
Refactor the code based on the feedback in https://github.com/ruby/rubygems/pull/9505#discussion_r3167085736 .
https://github.com/ruby/rubygems/commit/153abcb5e3
| -rw-r--r-- | lib/bundler/cli/config.rb | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/bundler/cli/config.rb b/lib/bundler/cli/config.rb index 3ac973cfe1..8248e3b15b 100644 --- a/lib/bundler/cli/config.rb +++ b/lib/bundler/cli/config.rb @@ -87,23 +87,17 @@ module Bundler if value.nil? warn_unused_scope "Ignoring --#{scope} since no value to set was given" - - configured = Bundler.settings.locations(name).any? + current_value = Bundler.settings[name] if options[:parseable] if value = Bundler.settings[name] Bundler.ui.info("#{name}=#{value}") end - if configured - return - else - exit 1 - end + else + confirm(name) end - confirm(name) - - if configured + if current_value return else exit 1 |
