bundler 2.2.11 → 2.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +414 -5
- data/README.md +1 -1
- data/bundler.gemspec +2 -3
- data/exe/bundle +7 -8
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli/cache.rb +1 -1
- data/lib/bundler/cli/check.rb +4 -2
- data/lib/bundler/cli/common.rb +15 -2
- data/lib/bundler/cli/doctor.rb +24 -5
- data/lib/bundler/cli/exec.rb +1 -6
- data/lib/bundler/cli/gem.rb +130 -26
- data/lib/bundler/cli/info.rb +16 -4
- data/lib/bundler/cli/install.rb +12 -27
- data/lib/bundler/cli/issue.rb +4 -3
- data/lib/bundler/cli/list.rb +7 -1
- data/lib/bundler/cli/lock.rb +5 -1
- data/lib/bundler/cli/open.rb +1 -2
- data/lib/bundler/cli/outdated.rb +10 -11
- data/lib/bundler/cli/platform.rb +1 -1
- data/lib/bundler/cli/remove.rb +1 -2
- data/lib/bundler/cli/update.rb +17 -8
- data/lib/bundler/cli.rb +41 -55
- data/lib/bundler/compact_index_client/cache.rb +0 -9
- data/lib/bundler/compact_index_client/updater.rb +10 -11
- data/lib/bundler/compact_index_client.rb +2 -8
- data/lib/bundler/current_ruby.rb +5 -4
- data/lib/bundler/definition.rb +147 -290
- data/lib/bundler/dependency.rb +5 -7
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +67 -66
- data/lib/bundler/endpoint_specification.rb +21 -11
- data/lib/bundler/env.rb +1 -1
- data/lib/bundler/environment_preserver.rb +4 -1
- data/lib/bundler/errors.rb +19 -3
- data/lib/bundler/feature_flag.rb +0 -4
- data/lib/bundler/fetcher/compact_index.rb +10 -15
- data/lib/bundler/fetcher/downloader.rb +9 -6
- data/lib/bundler/fetcher/index.rb +0 -27
- data/lib/bundler/fetcher.rb +10 -16
- data/lib/bundler/friendly_errors.rb +5 -32
- data/lib/bundler/gem_helper.rb +21 -16
- data/lib/bundler/index.rb +2 -7
- data/lib/bundler/injector.rb +12 -3
- data/lib/bundler/inline.rb +2 -1
- data/lib/bundler/installer/gem_installer.rb +4 -22
- data/lib/bundler/installer/parallel_installer.rb +36 -15
- data/lib/bundler/installer/standalone.rb +14 -9
- data/lib/bundler/installer.rb +8 -17
- data/lib/bundler/lazy_specification.rb +23 -2
- data/lib/bundler/lockfile_generator.rb +1 -1
- data/lib/bundler/lockfile_parser.rb +16 -45
- data/lib/bundler/man/bundle-add.1 +10 -2
- data/lib/bundler/man/bundle-add.1.ronn +7 -1
- data/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/lib/bundler/man/bundle-cache.1 +1 -1
- data/lib/bundler/man/bundle-check.1 +1 -1
- data/lib/bundler/man/bundle-clean.1 +1 -1
- data/lib/bundler/man/bundle-config.1 +23 -15
- data/lib/bundler/man/bundle-config.1.ronn +24 -17
- data/lib/bundler/man/bundle-doctor.1 +1 -1
- data/lib/bundler/man/bundle-exec.1 +1 -1
- data/lib/bundler/man/bundle-gem.1 +14 -1
- data/lib/bundler/man/bundle-gem.1.ronn +16 -0
- data/lib/bundler/man/bundle-info.1 +1 -1
- data/lib/bundler/man/bundle-init.1 +1 -1
- data/lib/bundler/man/bundle-inject.1 +1 -1
- data/lib/bundler/man/bundle-install.1 +2 -2
- data/lib/bundler/man/bundle-install.1.ronn +2 -2
- data/lib/bundler/man/bundle-list.1 +1 -1
- data/lib/bundler/man/bundle-lock.1 +1 -1
- data/lib/bundler/man/bundle-open.1 +1 -1
- data/lib/bundler/man/bundle-outdated.1 +1 -1
- data/lib/bundler/man/bundle-platform.1 +1 -1
- data/lib/bundler/man/bundle-pristine.1 +1 -1
- data/lib/bundler/man/bundle-remove.1 +1 -1
- data/lib/bundler/man/bundle-show.1 +1 -1
- data/lib/bundler/man/bundle-update.1 +5 -5
- data/lib/bundler/man/bundle-update.1.ronn +5 -4
- data/lib/bundler/man/bundle-viz.1 +1 -1
- data/lib/bundler/man/bundle.1 +1 -1
- data/lib/bundler/man/gemfile.5 +28 -2
- data/lib/bundler/man/gemfile.5.ronn +9 -1
- data/lib/bundler/plugin/api/source.rb +22 -0
- data/lib/bundler/plugin/index.rb +4 -1
- data/lib/bundler/plugin/installer.rb +10 -10
- data/lib/bundler/plugin/source_list.rb +4 -0
- data/lib/bundler/plugin.rb +28 -8
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/psyched_yaml.rb +1 -13
- data/lib/bundler/remote_specification.rb +7 -0
- data/lib/bundler/resolver/spec_group.rb +1 -25
- data/lib/bundler/resolver.rb +55 -147
- data/lib/bundler/retry.rb +1 -1
- data/lib/bundler/ruby_version.rb +1 -1
- data/lib/bundler/rubygems_ext.rb +30 -8
- data/lib/bundler/rubygems_gem_installer.rb +68 -1
- data/lib/bundler/rubygems_integration.rb +43 -60
- data/lib/bundler/runtime.rb +18 -11
- data/lib/bundler/self_manager.rb +168 -0
- data/lib/bundler/settings.rb +96 -20
- data/lib/bundler/setup.rb +2 -2
- data/lib/bundler/shared_helpers.rb +4 -19
- data/lib/bundler/source/git/git_proxy.rb +8 -6
- data/lib/bundler/source/git.rb +22 -4
- data/lib/bundler/source/metadata.rb +1 -5
- data/lib/bundler/source/path/installer.rb +1 -1
- data/lib/bundler/source/path.rb +3 -1
- data/lib/bundler/source/rubygems.rb +111 -106
- data/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/lib/bundler/source.rb +21 -0
- data/lib/bundler/source_list.rb +100 -60
- data/lib/bundler/source_map.rb +58 -0
- data/lib/bundler/spec_set.rb +17 -31
- data/lib/bundler/stub_specification.rb +8 -0
- data/lib/bundler/templates/Executable.bundler +7 -7
- data/lib/bundler/templates/Gemfile +0 -2
- data/lib/bundler/templates/gems.rb +0 -3
- data/lib/bundler/templates/newgem/Gemfile.tt +5 -2
- data/lib/bundler/templates/newgem/README.md.tt +5 -3
- data/lib/bundler/templates/newgem/Rakefile.tt +15 -2
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +15 -6
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +18 -16
- data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/lib/bundler/templates/newgem/standard.yml.tt +3 -0
- data/lib/bundler/templates/newgem/test/minitest/{newgem_test.rb.tt → test_newgem.rb.tt} +1 -1
- data/lib/bundler/ui/shell.rb +1 -1
- data/lib/bundler/vendor/.document +1 -0
- data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +19 -21
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +57 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +39 -74
- data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/lib/bundler/vendor/molinillo/LICENSE +9 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +1 -1
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +1 -2
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +6 -2
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +6 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +9 -4
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +19 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +22 -4
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +1 -1
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +453 -0
- data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +17 -80
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +5 -6
- data/lib/bundler/vendor/uri/lib/uri/http.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/https.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +1 -14
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +1 -12
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/ws.rb +84 -0
- data/lib/bundler/vendor/uri/lib/uri/wss.rb +22 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +0 -1
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/worker.rb +19 -4
- data/lib/bundler.rb +28 -31
- metadata +27 -9
- data/lib/bundler/gemdeps.rb +0 -29
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
data/lib/bundler/cli.rb
CHANGED
@@ -14,6 +14,7 @@ module Bundler
|
|
14
14
|
COMMAND_ALIASES = {
|
15
15
|
"check" => "c",
|
16
16
|
"install" => "i",
|
17
|
+
"plugin" => "",
|
17
18
|
"list" => "ls",
|
18
19
|
"exec" => ["e", "ex", "exe"],
|
19
20
|
"cache" => ["package", "pack"],
|
@@ -60,6 +61,8 @@ module Bundler
|
|
60
61
|
Bundler.reset_settings_and_root!
|
61
62
|
end
|
62
63
|
|
64
|
+
Bundler.self_manager.restart_with_locked_bundler_if_needed
|
65
|
+
|
63
66
|
Bundler.settings.set_command_option_if_given :retry, options[:retry]
|
64
67
|
|
65
68
|
current_cmd = args.last[:current_command].name
|
@@ -72,14 +75,6 @@ module Bundler
|
|
72
75
|
Bundler.ui = UI::Shell.new(options)
|
73
76
|
Bundler.ui.level = "debug" if options["verbose"]
|
74
77
|
unprinted_warnings.each {|w| Bundler.ui.warn(w) }
|
75
|
-
|
76
|
-
if ENV["RUBYGEMS_GEMDEPS"] && !ENV["RUBYGEMS_GEMDEPS"].empty?
|
77
|
-
Bundler.ui.warn(
|
78
|
-
"The RUBYGEMS_GEMDEPS environment variable is set. This enables RubyGems' " \
|
79
|
-
"experimental Gemfile mode, which may conflict with Bundler and cause unexpected errors. " \
|
80
|
-
"To remove this warning, unset RUBYGEMS_GEMDEPS.", :wrap => true
|
81
|
-
)
|
82
|
-
end
|
83
78
|
end
|
84
79
|
|
85
80
|
check_unknown_options!(:except => [:config, :exec])
|
@@ -191,6 +186,7 @@ module Bundler
|
|
191
186
|
method_option "install", :type => :boolean, :banner =>
|
192
187
|
"Runs 'bundle install' after removing the gems from the Gemfile"
|
193
188
|
def remove(*gems)
|
189
|
+
SharedHelpers.major_deprecation(2, "The `--install` flag has been deprecated. `bundle install` is triggered by default.") if ARGV.include?("--install")
|
194
190
|
require_relative "cli/remove"
|
195
191
|
Remove.new(gems, options).run
|
196
192
|
end
|
@@ -308,39 +304,19 @@ module Bundler
|
|
308
304
|
end
|
309
305
|
end
|
310
306
|
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
if flag = rest.find{|arg| ["--verbose", "--outdated"].include?(arg) }
|
326
|
-
Bundler::SharedHelpers.major_deprecation(2, "the `#{flag}` flag to `bundle show` was undocumented and will be removed without replacement")
|
327
|
-
else
|
328
|
-
new_command = rest.find {|arg| !arg.start_with?("--") } ? "info" : "list"
|
329
|
-
|
330
|
-
new_arguments = rest.map do |arg|
|
331
|
-
next arg if arg != "--paths"
|
332
|
-
next "--path" if new_command == "info"
|
333
|
-
end
|
334
|
-
|
335
|
-
old_argv = ARGV.join(" ")
|
336
|
-
new_argv = [new_command, *new_arguments.compact].join(" ")
|
337
|
-
|
338
|
-
Bundler::SharedHelpers.major_deprecation(2, "use `bundle #{new_argv}` instead of `bundle #{old_argv}`")
|
339
|
-
end
|
340
|
-
end
|
341
|
-
require_relative "cli/show"
|
342
|
-
Show.new(options, gem_name).run
|
343
|
-
end
|
307
|
+
desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem"
|
308
|
+
long_desc <<-D
|
309
|
+
Show lists the names and versions of all gems that are required by your Gemfile.
|
310
|
+
Calling show with [GEM] will list the exact location of that gem on your machine.
|
311
|
+
D
|
312
|
+
method_option "paths", :type => :boolean,
|
313
|
+
:banner => "List the paths of all gems that are required by your Gemfile."
|
314
|
+
method_option "outdated", :type => :boolean,
|
315
|
+
:banner => "Show verbose output including whether gems are outdated."
|
316
|
+
def show(gem_name = nil)
|
317
|
+
SharedHelpers.major_deprecation(2, "the `--outdated` flag to `bundle show` was undocumented and will be removed without replacement") if ARGV.include?("--outdated")
|
318
|
+
require_relative "cli/show"
|
319
|
+
Show.new(options, gem_name).run
|
344
320
|
end
|
345
321
|
|
346
322
|
desc "list", "List all gems in the bundle"
|
@@ -357,6 +333,7 @@ module Bundler
|
|
357
333
|
|
358
334
|
desc "info GEM [OPTIONS]", "Show information for the given gem"
|
359
335
|
method_option "path", :type => :boolean, :banner => "Print full path to gem"
|
336
|
+
method_option "version", :type => :boolean, :banner => "Print gem version"
|
360
337
|
def info(gem_name)
|
361
338
|
require_relative "cli/info"
|
362
339
|
Info.new(options, gem_name).run
|
@@ -392,8 +369,11 @@ module Bundler
|
|
392
369
|
method_option "version", :aliases => "-v", :type => :string
|
393
370
|
method_option "group", :aliases => "-g", :type => :string
|
394
371
|
method_option "source", :aliases => "-s", :type => :string
|
372
|
+
method_option "require", :aliases => "-r", :type => :string, :banner => "Adds require path to gem. Provide false, or a path as a string."
|
395
373
|
method_option "git", :type => :string
|
374
|
+
method_option "github", :type => :string
|
396
375
|
method_option "branch", :type => :string
|
376
|
+
method_option "ref", :type => :string
|
397
377
|
method_option "skip-install", :type => :boolean, :banner =>
|
398
378
|
"Adds gem to the Gemfile but does not install it"
|
399
379
|
method_option "optimistic", :type => :boolean, :banner => "Adds optimistic declaration of version to gem"
|
@@ -475,6 +455,12 @@ module Bundler
|
|
475
455
|
"do in future versions. Instead please use `bundle config set cache_all true`, " \
|
476
456
|
"and stop using this flag" if ARGV.include?("--all")
|
477
457
|
|
458
|
+
SharedHelpers.major_deprecation 2,
|
459
|
+
"The `--path` flag is deprecated because its semantics are unclear. " \
|
460
|
+
"Use `bundle config cache_path` to configure the path of your cache of gems, " \
|
461
|
+
"and `bundle config path` to configure the path where your gems are installed, " \
|
462
|
+
"and stop using this flag" if ARGV.include?("--path")
|
463
|
+
|
478
464
|
require_relative "cli/cache"
|
479
465
|
Cache.new(options).run
|
480
466
|
end
|
@@ -482,7 +468,7 @@ module Bundler
|
|
482
468
|
map aliases_for("cache")
|
483
469
|
|
484
470
|
desc "exec [OPTIONS]", "Run the command in context of the bundle"
|
485
|
-
method_option :keep_file_descriptors, :type => :boolean, :default =>
|
471
|
+
method_option :keep_file_descriptors, :type => :boolean, :default => true
|
486
472
|
method_option :gemfile, :type => :string, :required => false
|
487
473
|
long_desc <<-D
|
488
474
|
Exec runs a command, providing it access to the gems in the bundle. While using
|
@@ -490,6 +476,10 @@ module Bundler
|
|
490
476
|
into the system wide RubyGems repository.
|
491
477
|
D
|
492
478
|
def exec(*args)
|
479
|
+
if ARGV.include?("--no-keep-file-descriptors")
|
480
|
+
SharedHelpers.major_deprecation(2, "The `--no-keep-file-descriptors` has been deprecated. `bundle exec` no longer mess with your file descriptors. Close them in the exec'd script if you need to")
|
481
|
+
end
|
482
|
+
|
493
483
|
require_relative "cli/exec"
|
494
484
|
Exec.new(options, args).run
|
495
485
|
end
|
@@ -504,8 +494,8 @@ module Bundler
|
|
504
494
|
By default, setting a configuration value sets it for all projects
|
505
495
|
on the machine.
|
506
496
|
|
507
|
-
If a global setting is
|
508
|
-
will show the current value, as well as any
|
497
|
+
If a global setting is superseded by local configuration, this command
|
498
|
+
will show the current value, as well as any superseded values and
|
509
499
|
where they were specified.
|
510
500
|
D
|
511
501
|
require_relative "cli/config"
|
@@ -568,7 +558,7 @@ module Bundler
|
|
568
558
|
method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version."
|
569
559
|
method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group."
|
570
560
|
def viz
|
571
|
-
SharedHelpers.major_deprecation 2, "The `viz` command has been
|
561
|
+
SharedHelpers.major_deprecation 2, "The `viz` command has been renamed to `graph` and moved to a plugin. See https://github.com/rubygems/bundler-graph"
|
572
562
|
require_relative "cli/viz"
|
573
563
|
Viz.new(options.dup).run
|
574
564
|
end
|
@@ -591,6 +581,9 @@ module Bundler
|
|
591
581
|
:desc => "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
|
592
582
|
method_option :ci, :type => :string, :lazy_default => Bundler.settings["gem.ci"] || "",
|
593
583
|
:desc => "Generate CI configuration, either GitHub Actions, Travis CI, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|travis|gitlab|circle)`"
|
584
|
+
method_option :linter, :type => :string, :lazy_default => Bundler.settings["gem.linter"] || "",
|
585
|
+
:desc => "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
|
586
|
+
method_option :github_username, :type => :string, :default => Bundler.settings["gem.github_username"], :banner => "Set your username on GitHub", :desc => "Fill in GitHub username on README so that you don't have to do it manually. Set a default with `bundle config set --global gem.github_username <your_username>`."
|
594
587
|
|
595
588
|
def gem(name)
|
596
589
|
end
|
@@ -816,17 +809,10 @@ module Bundler
|
|
816
809
|
|
817
810
|
current = Gem::Version.new(VERSION)
|
818
811
|
return if current >= latest
|
819
|
-
latest_installed = Bundler.rubygems.find_name("bundler").map(&:version).max
|
820
|
-
|
821
|
-
installation = "To install the latest version, run `gem install bundler#{" --pre" if latest.prerelease?}`"
|
822
|
-
if latest_installed && latest_installed > current
|
823
|
-
suggestion = "To update to the most recent installed version (#{latest_installed}), run `bundle update --bundler`"
|
824
|
-
suggestion = "#{installation}\n#{suggestion}" if latest_installed < latest
|
825
|
-
else
|
826
|
-
suggestion = installation
|
827
|
-
end
|
828
812
|
|
829
|
-
Bundler.ui.warn
|
813
|
+
Bundler.ui.warn \
|
814
|
+
"The latest bundler is #{latest}, but you are currently running #{current}.\n" \
|
815
|
+
"To update to the most recent version, run `bundle update --bundler`"
|
830
816
|
rescue RuntimeError
|
831
817
|
nil
|
832
818
|
end
|
@@ -76,15 +76,6 @@ module Bundler
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
-
def specific_dependency(name, version, platform)
|
80
|
-
pattern = [version, platform].compact.join("-")
|
81
|
-
return nil if pattern.empty?
|
82
|
-
|
83
|
-
gem_lines = info_path(name).read
|
84
|
-
gem_line = gem_lines[/^#{Regexp.escape(pattern)}\b.*/, 0]
|
85
|
-
gem_line ? parse_gem(gem_line) : nil
|
86
|
-
end
|
87
|
-
|
88
79
|
private
|
89
80
|
|
90
81
|
def lines(path)
|
@@ -50,16 +50,20 @@ module Bundler
|
|
50
50
|
|
51
51
|
content = response.body
|
52
52
|
|
53
|
-
|
53
|
+
etag = (response["ETag"] || "").gsub(%r{\AW/}, "")
|
54
|
+
correct_response = SharedHelpers.filesystem_access(local_temp_path) do
|
54
55
|
if response.is_a?(Net::HTTPPartialContent) && local_temp_path.size.nonzero?
|
55
56
|
local_temp_path.open("a") {|f| f << slice_body(content, 1..-1) }
|
57
|
+
|
58
|
+
etag_for(local_temp_path) == etag
|
56
59
|
else
|
57
|
-
local_temp_path.open("
|
60
|
+
local_temp_path.open("wb") {|f| f << content }
|
61
|
+
|
62
|
+
etag.length.zero? || etag_for(local_temp_path) == etag
|
58
63
|
end
|
59
64
|
end
|
60
65
|
|
61
|
-
|
62
|
-
if etag.length.zero? || etag_for(local_temp_path) == etag
|
66
|
+
if correct_response
|
63
67
|
SharedHelpers.filesystem_access(local_path) do
|
64
68
|
FileUtils.mv(local_temp_path, local_path)
|
65
69
|
end
|
@@ -72,11 +76,6 @@ module Bundler
|
|
72
76
|
|
73
77
|
update(local_path, remote_path, :retrying)
|
74
78
|
end
|
75
|
-
rescue Errno::EACCES
|
76
|
-
raise Bundler::PermissionError,
|
77
|
-
"Bundler does not have write access to create a temp directory " \
|
78
|
-
"within #{Dir.tmpdir}. Bundler must have write access to your " \
|
79
|
-
"systems temp directory to function properly. "
|
80
79
|
rescue Zlib::GzipFile::Error
|
81
80
|
raise Bundler::HTTPError
|
82
81
|
end
|
@@ -92,11 +91,11 @@ module Bundler
|
|
92
91
|
|
93
92
|
def checksum_for_file(path)
|
94
93
|
return nil unless path.file?
|
95
|
-
# This must use
|
94
|
+
# This must use File.read instead of Digest.file().hexdigest
|
96
95
|
# because we need to preserve \n line endings on windows when calculating
|
97
96
|
# the checksum
|
98
97
|
SharedHelpers.filesystem_access(path, :read) do
|
99
|
-
SharedHelpers.digest(:MD5).hexdigest(
|
98
|
+
SharedHelpers.digest(:MD5).hexdigest(File.read(path))
|
100
99
|
end
|
101
100
|
end
|
102
101
|
end
|
@@ -5,7 +5,7 @@ require "set"
|
|
5
5
|
|
6
6
|
module Bundler
|
7
7
|
class CompactIndexClient
|
8
|
-
DEBUG_MUTEX = Mutex.new
|
8
|
+
DEBUG_MUTEX = Thread::Mutex.new
|
9
9
|
def self.debug
|
10
10
|
return unless ENV["DEBUG_COMPACT_INDEX"]
|
11
11
|
DEBUG_MUTEX.synchronize { warn("[#{self}] #{yield}") }
|
@@ -25,7 +25,7 @@ module Bundler
|
|
25
25
|
@endpoints = Set.new
|
26
26
|
@info_checksums_by_name = {}
|
27
27
|
@parsed_checksums = false
|
28
|
-
@mutex = Mutex.new
|
28
|
+
@mutex = Thread::Mutex.new
|
29
29
|
end
|
30
30
|
|
31
31
|
def execution_mode=(block)
|
@@ -73,12 +73,6 @@ module Bundler
|
|
73
73
|
end.flatten(1)
|
74
74
|
end
|
75
75
|
|
76
|
-
def spec(name, version, platform = nil)
|
77
|
-
Bundler::CompactIndexClient.debug { "spec(name = #{name}, version = #{version}, platform = #{platform})" }
|
78
|
-
update_info(name)
|
79
|
-
@cache.specific_dependency(name, version, platform)
|
80
|
-
end
|
81
|
-
|
82
76
|
def update_and_parse_checksums!
|
83
77
|
Bundler::CompactIndexClient.debug { "update_and_parse_checksums!" }
|
84
78
|
return @info_checksums_by_name if @parsed_checksums
|
data/lib/bundler/current_ruby.rb
CHANGED
@@ -20,6 +20,7 @@ module Bundler
|
|
20
20
|
2.5
|
21
21
|
2.6
|
22
22
|
2.7
|
23
|
+
3.0
|
23
24
|
].freeze
|
24
25
|
|
25
26
|
KNOWN_MAJOR_VERSIONS = KNOWN_MINOR_VERSIONS.map {|v| v.split(".", 2).first }.uniq.freeze
|
@@ -64,19 +65,19 @@ module Bundler
|
|
64
65
|
end
|
65
66
|
|
66
67
|
def mswin?
|
67
|
-
|
68
|
+
Gem.win_platform?
|
68
69
|
end
|
69
70
|
|
70
71
|
def mswin64?
|
71
|
-
|
72
|
+
Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mswin64" && Bundler.local_platform.cpu == "x64"
|
72
73
|
end
|
73
74
|
|
74
75
|
def mingw?
|
75
|
-
|
76
|
+
Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu != "x64"
|
76
77
|
end
|
77
78
|
|
78
79
|
def x64_mingw?
|
79
|
-
|
80
|
+
Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu == "x64"
|
80
81
|
end
|
81
82
|
|
82
83
|
(KNOWN_MINOR_VERSIONS + KNOWN_MAJOR_VERSIONS).each do |version|
|