summaryrefslogtreecommitdiff
path: root/lib/bundler/settings.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2021-05-28 12:47:49 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-07-07 13:30:20 +0900
commit6e2240a2f954c84ed12357382c9c065ae4b91e11 (patch)
treeef4b33a9a67843cbc45aad510d7bca9f2a763496 /lib/bundler/settings.rb
parent9952e9358ea73a1bda8d5f8c8672ee1c04892ce4 (diff)
Sync latest bundler & rubygems development version
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4533
Diffstat (limited to 'lib/bundler/settings.rb')
-rw-r--r--lib/bundler/settings.rb24
1 files changed, 21 insertions, 3 deletions
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index e9155acf48..95da31a765 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -20,7 +20,6 @@ module Bundler
disable_exec_load
disable_local_branch_check
disable_local_revision_check
- disable_multisource
disable_shared_gems
disable_version_check
force_ruby_platform
@@ -45,7 +44,6 @@ module Bundler
silence_deprecations
silence_root_warning
suppress_install_using_messages
- unlock_source_unlocks_spec
update_requires_all_flag
use_gem_version_promoter_for_major_updates
].freeze
@@ -210,6 +208,13 @@ module Bundler
locations
end
+ def processor_count
+ require "etc"
+ Etc.nprocessors
+ rescue StandardError
+ 1
+ end
+
# for legacy reasons, in Bundler 2, we do not respect :disable_shared_gems
def path
configs.each do |_level, settings|
@@ -442,7 +447,20 @@ module Bundler
valid_file = file.exist? && !file.size.zero?
return {} unless valid_file
require_relative "yaml_serializer"
- YAMLSerializer.load file.read
+ YAMLSerializer.load(file.read).inject({}) do |config, (k, v)|
+ new_k = k
+
+ if k.include?("-")
+ Bundler.ui.warn "Your #{file} config includes `#{k}`, which contains the dash character (`-`).\n" \
+ "This is deprecated, because configuration through `ENV` should be possible, but `ENV` keys cannot include dashes.\n" \
+ "Please edit #{file} and replace any dashes in configuration keys with a triple underscore (`___`)."
+
+ new_k = k.gsub("-", "___")
+ end
+
+ config[new_k] = v
+ config
+ end
end
end