bundler 2.1.0.pre.3 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +40 -3
  3. data/lib/bundler.rb +0 -1
  4. data/lib/bundler/build_metadata.rb +2 -2
  5. data/lib/bundler/cli.rb +1 -1
  6. data/lib/bundler/cli/config.rb +1 -1
  7. data/lib/bundler/cli/update.rb +1 -1
  8. data/lib/bundler/feature_flag.rb +1 -1
  9. data/lib/bundler/fetcher.rb +2 -2
  10. data/lib/bundler/fetcher/downloader.rb +1 -1
  11. data/lib/bundler/fetcher/index.rb +1 -1
  12. data/lib/bundler/friendly_errors.rb +1 -1
  13. data/lib/bundler/gem_helper.rb +12 -10
  14. data/lib/bundler/inline.rb +36 -31
  15. data/lib/bundler/lazy_specification.rb +0 -1
  16. data/lib/bundler/mirror.rb +3 -3
  17. data/lib/bundler/plugin/api/source.rb +2 -4
  18. data/lib/bundler/remote_specification.rb +0 -2
  19. data/lib/bundler/rubygems_integration.rb +15 -13
  20. data/lib/bundler/settings.rb +7 -4
  21. data/lib/bundler/setup.rb +5 -0
  22. data/lib/bundler/source/git.rb +5 -5
  23. data/lib/bundler/source/git/git_proxy.rb +3 -2
  24. data/lib/bundler/source/rubygems.rb +3 -3
  25. data/lib/bundler/source/rubygems/remote.rb +1 -1
  26. data/lib/bundler/uri_credentials_filter.rb +7 -3
  27. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +3 -3
  28. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +26 -26
  29. data/lib/bundler/vendor/thor/lib/thor.rb +7 -0
  30. data/lib/bundler/vendor/thor/lib/thor/actions.rb +10 -6
  31. data/lib/bundler/vendor/thor/lib/thor/base.rb +29 -19
  32. data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
  33. data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +1 -1
  34. data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +13 -2
  35. data/lib/bundler/vendor/thor/lib/thor/runner.rb +8 -9
  36. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +10 -1
  37. data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +2 -2
  38. data/lib/bundler/vendor/thor/lib/thor/util.rb +17 -1
  39. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  40. data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
  41. data/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
  42. data/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
  43. data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
  44. data/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
  45. data/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
  46. data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
  47. data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
  48. data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
  49. data/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
  50. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
  51. data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
  52. data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
  53. data/lib/bundler/vendored_uri.rb +4 -0
  54. data/lib/bundler/version.rb +1 -1
  55. data/man/bundle-add.1 +1 -1
  56. data/man/bundle-add.1.txt +1 -1
  57. data/man/bundle-binstubs.1 +1 -1
  58. data/man/bundle-binstubs.1.txt +1 -1
  59. data/man/bundle-cache.1 +1 -1
  60. data/man/bundle-cache.1.txt +1 -1
  61. data/man/bundle-check.1 +1 -1
  62. data/man/bundle-check.1.txt +1 -1
  63. data/man/bundle-clean.1 +1 -1
  64. data/man/bundle-clean.1.txt +1 -1
  65. data/man/bundle-config.1 +1 -1
  66. data/man/bundle-config.1.txt +1 -1
  67. data/man/bundle-doctor.1 +1 -1
  68. data/man/bundle-doctor.1.txt +1 -1
  69. data/man/bundle-exec.1 +1 -1
  70. data/man/bundle-exec.1.txt +1 -1
  71. data/man/bundle-gem.1 +1 -1
  72. data/man/bundle-gem.1.txt +1 -1
  73. data/man/bundle-info.1 +1 -1
  74. data/man/bundle-info.1.txt +1 -1
  75. data/man/bundle-init.1 +1 -1
  76. data/man/bundle-init.1.txt +1 -1
  77. data/man/bundle-inject.1 +1 -1
  78. data/man/bundle-inject.1.txt +1 -1
  79. data/man/bundle-install.1 +1 -1
  80. data/man/bundle-install.1.txt +1 -1
  81. data/man/bundle-list.1 +1 -1
  82. data/man/bundle-list.1.txt +1 -1
  83. data/man/bundle-lock.1 +1 -1
  84. data/man/bundle-lock.1.txt +1 -1
  85. data/man/bundle-open.1 +1 -1
  86. data/man/bundle-open.1.txt +1 -1
  87. data/man/bundle-outdated.1 +1 -1
  88. data/man/bundle-outdated.1.txt +1 -1
  89. data/man/bundle-platform.1 +1 -1
  90. data/man/bundle-platform.1.txt +1 -1
  91. data/man/bundle-pristine.1 +1 -1
  92. data/man/bundle-pristine.1.txt +1 -1
  93. data/man/bundle-remove.1 +1 -1
  94. data/man/bundle-remove.1.txt +1 -1
  95. data/man/bundle-show.1 +1 -1
  96. data/man/bundle-show.1.txt +1 -1
  97. data/man/bundle-update.1 +1 -1
  98. data/man/bundle-update.1.txt +1 -1
  99. data/man/bundle-viz.1 +1 -1
  100. data/man/bundle-viz.1.txt +1 -1
  101. data/man/bundle.1 +1 -1
  102. data/man/bundle.1.txt +1 -1
  103. data/man/gemfile.5 +1 -1
  104. data/man/gemfile.5.txt +1 -1
  105. metadata +18 -6
  106. data/lib/bundler/gem_remote_fetcher.rb +0 -43
  107. data/lib/bundler/vendor/fileutils/lib/fileutils/version.rb +0 -5
  108. data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '016587ebd0e4e401df2504768760b0718525d11e04b85551d00b1f97d3a01200'
4
- data.tar.gz: d39551298cdbbbc1781fc4ca9a6419be8776f48bac0a2a1c1c8e2620cf9b422b
3
+ metadata.gz: 843e4286044cdb233de4175677bc39b0e942bf7530dfc102b513f0f813ebe628
4
+ data.tar.gz: f8c96b7117f2b17f8c6e7286575a972168a4ac0a4f8611d33d2ebe07e8e9a624
5
5
  SHA512:
6
- metadata.gz: f112162b7ea371f4711eace2134d55702d658653b544bdc47e7085788690d36d8c0f00395c237cb71e4d56269d5e172109ee8f1a82efcf0fef1b0d1af6976db7
7
- data.tar.gz: c9de6a0993c9c5fbfdf5423be20a02fdd33ee0ab98df9172205972274e77889a6747408ca74e22f6dc4cce65c51ea2777d7608740488827f284b8a4055124223
6
+ metadata.gz: 58b2638c69639e4e1ee65cbb9eb803fcf07055fcd2fb51b123c04cff7f756c0900c8147d73bd8f8f3005972dc7d6ade1defa6febcc930e53683d5f8953d6354e
7
+ data.tar.gz: e8e0bd8f0da1f426f47f8ecb051d92874b2c32a2494c4979d26d2c318cb742b17bc7ce9b7ea8d0303111a9045ede19bcbdb25d3e611d7ec71ab523692af58bf5
@@ -1,3 +1,40 @@
1
+ ## 2.1.2 (December 20, 2019)
2
+
3
+ Bugfixes:
4
+
5
+ - Restore an explicit `require "rubygems"` on top `rubygems_integration.rb` to avoid some missing constant errors under some convoluted setups [#7505](https://github.com/bundler/bundler/pull/7505)
6
+
7
+ ## 2.1.1 (December 17, 2019)
8
+
9
+ Bugfixes:
10
+
11
+ - Fix some cases of shelling out to `rubygems` still being silent [#7493](https://github.com/bundler/bundler/pull/7493)
12
+ - Restore compatibility with `rubygems-bundler` so that binstubs work under `RVM` [#7498](https://github.com/bundler/bundler/pull/7498)
13
+
14
+ ## 2.1.0 (December 15, 2019)
15
+
16
+ Features:
17
+
18
+ - Add support for new default gems. In particular,
19
+
20
+ * `open3` [#7455](https://github.com/bundler/bundler/pull/7455)
21
+ * `cgi`: [#7456](https://github.com/bundler/bundler/pull/7456)
22
+ * `uri` [#7460](https://github.com/bundler/bundler/pull/7460)
23
+
24
+ plus other PRs removing or lazily loading usages of these gems from other places to not interfere with user's choice, such as [#7471](https://github.com/bundler/bundler/pull/7471) or [#7473](https://github.com/bundler/bundler/pull/7473)
25
+
26
+ Bugfixes:
27
+
28
+ - Fix `bundle exec rake install` failing [#7474](https://github.com/bundler/bundler/pull/7474)
29
+ - Fix `bundle exec`'ing to rubygems being silent [#7442](https://github.com/bundler/bundler/pull/7442)
30
+ - Restore previous `BUNDLE_GEMFILE` in `bundler/inline` [#7418](https://github.com/bundler/bundler/pull/7418)
31
+ - Fix error when using `gem` DSL's `:glob` option for selecting gemspecs from a specific source [#7419](https://github.com/bundler/bundler/pull/7419)
32
+
33
+ Changes:
34
+
35
+ - `bundle config` no longer warns when using "old interface" (might be deprecated again in the future) [#7475](https://github.com/bundler/bundler/pull/7475)
36
+ - `bundle update` no longer warns when used without arguments (might be deprecated again in the future) [#7475](https://github.com/bundler/bundler/pull/7475)
37
+
1
38
  ## 2.1.0.pre.3 (November 12, 2019)
2
39
 
3
40
  Features:
@@ -20,13 +57,13 @@ Bugfixes:
20
57
  Bugfixes:
21
58
 
22
59
  - Fix `bundle clean` trying to delete non-existent directory ([#7340](https://github.com/bundler/bundler/pull/7340))
23
- - Fix warnings about keywork argument separation on ruby 2.7 ([#7337](https://github.com/bundler/bundler/pull/7337))
60
+ - Fix warnings about keyword argument separation on ruby 2.7 ([#7337](https://github.com/bundler/bundler/pull/7337))
24
61
 
25
62
  ## 2.1.0.pre.1 (August 28, 2019)
26
63
 
27
64
  One of the biggest changes in bundler 2.1.0 is that deprecations for upcoming
28
65
  breaking changes in bundler 3 will be turned on by default. We do this to grab
29
- feedback and comunicate early to our users the kind of changes we're intending
66
+ feedback and communicate early to our users the kind of changes we're intending
30
67
  to ship with bundler 3. See
31
68
  [#6965](https://github.com/bundler/bundler/pull/6965).
32
69
 
@@ -89,7 +126,7 @@ Bugfixes:
89
126
  - Warn about situations where multiple gems provide the same executable ([#7075](https://github.com/bundler/bundler/pull/7075))
90
127
  - Ignore `frozen` setting in inline mode ([#7125](https://github.com/bundler/bundler/pull/7125))
91
128
  - Fix incorrect "bundler attempted to update GEM but version stayed the same" message when updating git sourced gems ([#6325](https://github.com/bundler/bundler/pull/6325))
92
- - Don't check for existance of a writable home directory if `BUNDLE_USER_HOME` is set ([#6885](https://github.com/bundler/bundler/pull/6885))
129
+ - Don't check for existence of a writable home directory if `BUNDLE_USER_HOME` is set ([#6885](https://github.com/bundler/bundler/pull/6885))
93
130
  - Fix error message when server would respond to a bad username/password requiest with a 401 ([#6928](https://github.com/bundler/bundler/pull/6928))
94
131
  - Fix `bundle outdated` pluralization when multiple groups are requested ([#7063](https://github.com/bundler/bundler/pull/7063))
95
132
  - Fix `bundle install` not updating conservatively when gemspec is changed ([#7143](https://github.com/bundler/bundler/pull/7143))
@@ -50,7 +50,6 @@ module Bundler
50
50
  autoload :FeatureFlag, File.expand_path("bundler/feature_flag", __dir__)
51
51
  autoload :GemHelper, File.expand_path("bundler/gem_helper", __dir__)
52
52
  autoload :GemHelpers, File.expand_path("bundler/gem_helpers", __dir__)
53
- autoload :GemRemoteFetcher, File.expand_path("bundler/gem_remote_fetcher", __dir__)
54
53
  autoload :GemVersionPromoter, File.expand_path("bundler/gem_version_promoter", __dir__)
55
54
  autoload :Graph, File.expand_path("bundler/graph", __dir__)
56
55
  autoload :Index, File.expand_path("bundler/index", __dir__)
@@ -4,8 +4,8 @@ module Bundler
4
4
  # Represents metadata from when the Bundler gem was built.
5
5
  module BuildMetadata
6
6
  # begin ivars
7
- @built_at = "2019-11-12".freeze
8
- @git_commit_sha = "9e06edc33".freeze
7
+ @built_at = "2019-12-20".freeze
8
+ @git_commit_sha = "4da3289ebd".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -783,7 +783,7 @@ module Bundler
783
783
  return unless SharedHelpers.md5_available?
784
784
 
785
785
  latest = Fetcher::CompactIndex.
786
- new(nil, Source::Rubygems::Remote.new(URI("https://rubygems.org")), nil).
786
+ new(nil, Source::Rubygems::Remote.new(Bundler::URI("https://rubygems.org")), nil).
787
787
  send(:compact_index_client).
788
788
  instance_variable_get(:@cache).
789
789
  dependencies("bundler").
@@ -25,7 +25,7 @@ module Bundler
25
25
  ["config", "get", ARGV[1]]
26
26
  end
27
27
 
28
- SharedHelpers.major_deprecation 2,
28
+ SharedHelpers.major_deprecation 3,
29
29
  "Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle #{new_args.join(" ")}` instead."
30
30
 
31
31
  Base.new(options, name, value, self).run
@@ -22,7 +22,7 @@ module Bundler
22
22
  if Bundler.feature_flag.update_requires_all_flag?
23
23
  raise InvalidOption, "To update everything, pass the `--all` flag."
24
24
  end
25
- SharedHelpers.major_deprecation 2, "Pass --all to `bundle update` to update everything"
25
+ SharedHelpers.major_deprecation 3, "Pass --all to `bundle update` to update everything"
26
26
  elsif !full_update && options[:all]
27
27
  raise InvalidOption, "Cannot specify --all along with specific options."
28
28
  end
@@ -46,7 +46,7 @@ module Bundler
46
46
  settings_flag(:specific_platform) { bundler_3_mode? }
47
47
  settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
48
48
  settings_flag(:unlock_source_unlocks_spec) { !bundler_3_mode? }
49
- settings_flag(:update_requires_all_flag) { bundler_3_mode? }
49
+ settings_flag(:update_requires_all_flag) { bundler_4_mode? }
50
50
  settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_mode? }
51
51
 
52
52
  settings_option(:default_cli_command) { bundler_3_mode? ? :cli_help : :install }
@@ -97,7 +97,7 @@ module Bundler
97
97
  spec -= [nil, "ruby", ""]
98
98
  spec_file_name = "#{spec.join "-"}.gemspec"
99
99
 
100
- uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
100
+ uri = Bundler::URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
101
101
  if uri.scheme == "file"
102
102
  path = Bundler.rubygems.correct_for_windows_path(uri.path)
103
103
  Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(path))
@@ -244,7 +244,7 @@ module Bundler
244
244
 
245
245
  con = PersistentHTTP.new :name => "bundler", :proxy => :ENV
246
246
  if gem_proxy = Bundler.rubygems.configuration[:http_proxy]
247
- con.proxy = URI.parse(gem_proxy) if gem_proxy != :no_proxy
247
+ con.proxy = Bundler::URI.parse(gem_proxy) if gem_proxy != :no_proxy
248
248
  end
249
249
 
250
250
  if remote_uri.scheme == "https"
@@ -21,7 +21,7 @@ module Bundler
21
21
  when Net::HTTPSuccess, Net::HTTPNotModified
22
22
  response
23
23
  when Net::HTTPRedirection
24
- new_uri = URI.parse(response["location"])
24
+ new_uri = Bundler::URI.parse(response["location"])
25
25
  if new_uri.host == uri.host
26
26
  new_uri.user = uri.user
27
27
  new_uri.password = uri.password
@@ -28,7 +28,7 @@ module Bundler
28
28
  spec -= [nil, "ruby", ""]
29
29
  spec_file_name = "#{spec.join "-"}.gemspec"
30
30
 
31
- uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
31
+ uri = Bundler::URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
32
32
  if uri.scheme == "file"
33
33
  path = Bundler.rubygems.correct_for_windows_path(uri.path)
34
34
  Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(path))
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "cgi"
4
3
  require_relative "vendored_thor"
5
4
 
6
5
  module Bundler
@@ -114,6 +113,7 @@ module Bundler
114
113
  def issues_url(exception)
115
114
  message = exception.message.lines.first.tr(":", " ").chomp
116
115
  message = message.split("-").first if exception.is_a?(Errno)
116
+ require "cgi"
117
117
  "https://github.com/bundler/bundler/search?q=" \
118
118
  "#{CGI.escape(message)}&type=Issues"
119
119
  end
@@ -73,8 +73,7 @@ module Bundler
73
73
 
74
74
  def build_gem
75
75
  file_name = nil
76
- gem = ENV["GEM_COMMAND"] ? ENV["GEM_COMMAND"] : "gem"
77
- sh("#{gem} build -V #{spec_path}".shellsplit) do
76
+ sh("#{gem_command} build -V #{spec_path}".shellsplit) do
78
77
  file_name = File.basename(built_gem_path)
79
78
  SharedHelpers.filesystem_access(File.join(base, "pkg")) {|p| FileUtils.mkdir_p(p) }
80
79
  FileUtils.mv(built_gem_path, "pkg")
@@ -85,11 +84,10 @@ module Bundler
85
84
 
86
85
  def install_gem(built_gem_path = nil, local = false)
87
86
  built_gem_path ||= build_gem
88
- gem = ENV["GEM_COMMAND"] ? ENV["GEM_COMMAND"] : "gem"
89
- cmd = "#{gem} install #{built_gem_path}"
87
+ cmd = "#{gem_command} install #{built_gem_path}"
90
88
  cmd += " --local" if local
91
- out, status = sh_with_status(cmd.shellsplit)
92
- unless status.success? && out[/Successfully installed/]
89
+ _, status = sh_with_status(cmd.shellsplit)
90
+ unless status.success?
93
91
  raise "Couldn't install gem, run `gem install #{built_gem_path}' for more detailed output"
94
92
  end
95
93
  Bundler.ui.confirm "#{name} (#{version}) installed."
@@ -98,13 +96,13 @@ module Bundler
98
96
  protected
99
97
 
100
98
  def rubygem_push(path)
101
- gem_command = %W[gem push #{path}]
102
- gem_command << "--key" << gem_key if gem_key
103
- gem_command << "--host" << allowed_push_host if allowed_push_host
99
+ cmd = %W[#{gem_command} push #{path}]
100
+ cmd << "--key" << gem_key if gem_key
101
+ cmd << "--host" << allowed_push_host if allowed_push_host
104
102
  unless allowed_push_host || Bundler.user_home.join(".gem/credentials").file?
105
103
  raise "Your rubygems.org credentials aren't set. Run `gem push` to set them."
106
104
  end
107
- sh_with_input(gem_command)
105
+ sh_with_input(cmd)
108
106
  Bundler.ui.confirm "Pushed #{name} #{version} to #{gem_push_host}"
109
107
  end
110
108
 
@@ -211,5 +209,9 @@ module Bundler
211
209
  def gem_push?
212
210
  !%w[n no nil false off 0].include?(ENV["gem_push"].to_s.downcase)
213
211
  end
212
+
213
+ def gem_command
214
+ ENV["GEM_COMMAND"] ? ENV["GEM_COMMAND"] : "gem"
215
+ end
214
216
  end
215
217
  end
@@ -37,43 +37,48 @@ def gemfile(install = false, options = {}, &gemfile)
37
37
  ui.level = "silent" if opts.delete(:quiet)
38
38
  raise ArgumentError, "Unknown options: #{opts.keys.join(", ")}" unless opts.empty?
39
39
 
40
- old_root = Bundler.method(:root)
41
- bundler_module = class << Bundler; self; end
42
- bundler_module.send(:remove_method, :root)
43
- def Bundler.root
44
- Bundler::SharedHelpers.pwd.expand_path
45
- end
46
- Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", "Gemfile"
47
-
48
- Bundler::Plugin.gemfile_install(&gemfile) if Bundler.feature_flag.plugins?
49
- builder = Bundler::Dsl.new
50
- builder.instance_eval(&gemfile)
40
+ begin
41
+ old_root = Bundler.method(:root)
42
+ bundler_module = class << Bundler; self; end
43
+ bundler_module.send(:remove_method, :root)
44
+ def Bundler.root
45
+ Bundler::SharedHelpers.pwd.expand_path
46
+ end
47
+ old_gemfile = ENV["BUNDLE_GEMFILE"]
48
+ Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", "Gemfile"
51
49
 
52
- Bundler.settings.temporary(:frozen => false) do
53
- definition = builder.to_definition(nil, true)
54
- def definition.lock(*); end
55
- definition.validate_runtime!
50
+ Bundler::Plugin.gemfile_install(&gemfile) if Bundler.feature_flag.plugins?
51
+ builder = Bundler::Dsl.new
52
+ builder.instance_eval(&gemfile)
56
53
 
57
- missing_specs = proc do
58
- definition.missing_specs?
59
- end
54
+ Bundler.settings.temporary(:frozen => false) do
55
+ definition = builder.to_definition(nil, true)
56
+ def definition.lock(*); end
57
+ definition.validate_runtime!
60
58
 
61
- Bundler.ui = install ? ui : Bundler::UI::Silent.new
62
- if install || missing_specs.call
63
- Bundler.settings.temporary(:inline => true, :disable_platform_warnings => true) do
64
- installer = Bundler::Installer.install(Bundler.root, definition, :system => true)
65
- installer.post_install_messages.each do |name, message|
66
- Bundler.ui.info "Post-install message from #{name}:\n#{message}"
59
+ Bundler.ui = install ? ui : Bundler::UI::Silent.new
60
+ if install || definition.missing_specs?
61
+ Bundler.settings.temporary(:inline => true, :disable_platform_warnings => true) do
62
+ installer = Bundler::Installer.install(Bundler.root, definition, :system => true)
63
+ installer.post_install_messages.each do |name, message|
64
+ Bundler.ui.info "Post-install message from #{name}:\n#{message}"
65
+ end
67
66
  end
68
67
  end
68
+
69
+ runtime = Bundler::Runtime.new(nil, definition)
70
+ runtime.setup.require
71
+ end
72
+ ensure
73
+ if bundler_module
74
+ bundler_module.send(:remove_method, :root)
75
+ bundler_module.send(:define_method, :root, old_root)
69
76
  end
70
77
 
71
- runtime = Bundler::Runtime.new(nil, definition)
72
- runtime.setup.require
73
- end
74
- ensure
75
- if bundler_module
76
- bundler_module.send(:remove_method, :root)
77
- bundler_module.send(:define_method, :root, old_root)
78
+ if old_gemfile
79
+ ENV["BUNDLE_GEMFILE"] = old_gemfile
80
+ else
81
+ ENV.delete("BUNDLE_GEMFILE")
82
+ end
78
83
  end
79
84
  end
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "uri"
4
3
  require_relative "match_platform"
5
4
 
6
5
  module Bundler
@@ -47,7 +47,7 @@ module Bundler
47
47
 
48
48
  def fetch_valid_mirror_for(uri)
49
49
  downcased = uri.to_s.downcase
50
- mirror = @mirrors[downcased] || @mirrors[URI(downcased).host] || Mirror.new(uri)
50
+ mirror = @mirrors[downcased] || @mirrors[Bundler::URI(downcased).host] || Mirror.new(uri)
51
51
  mirror.validate!(@prober)
52
52
  mirror = Mirror.new(uri) unless mirror.valid?
53
53
  mirror
@@ -74,7 +74,7 @@ module Bundler
74
74
  @uri = if uri.nil?
75
75
  nil
76
76
  else
77
- URI(uri.to_s)
77
+ Bundler::URI(uri.to_s)
78
78
  end
79
79
  @valid = nil
80
80
  end
@@ -126,7 +126,7 @@ module Bundler
126
126
  if uri == "all"
127
127
  @all = true
128
128
  else
129
- @uri = URI(uri).absolute? ? Settings.normalize_uri(uri) : uri
129
+ @uri = Bundler::URI(uri).absolute? ? Settings.normalize_uri(uri) : uri
130
130
  end
131
131
  @value = value
132
132
  end
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "uri"
4
-
5
3
  module Bundler
6
4
  module Plugin
7
5
  class API
@@ -108,7 +106,7 @@ module Bundler
108
106
  def install_path
109
107
  @install_path ||=
110
108
  begin
111
- base_name = File.basename(URI.parse(uri).normalize.path)
109
+ base_name = File.basename(Bundler::URI.parse(uri).normalize.path)
112
110
 
113
111
  gem_install_dir.join("#{base_name}-#{uri_hash[0..11]}")
114
112
  end
@@ -170,7 +168,7 @@ module Bundler
170
168
  #
171
169
  # This is used by `app_cache_path`
172
170
  def app_cache_dirname
173
- base_name = File.basename(URI.parse(uri).normalize.path)
171
+ base_name = File.basename(Bundler::URI.parse(uri).normalize.path)
174
172
  "#{base_name}-#{uri_hash}"
175
173
  end
176
174
 
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "uri"
4
-
5
3
  module Bundler
6
4
  # Represents a lazily loaded gem specification, where the full specification
7
5
  # is on the source server in rubygems' "quick" index. The proxy object is to
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "rubygems"
4
+
3
5
  module Bundler
4
6
  class RubygemsIntegration
5
7
  if defined?(Gem::Ext::Builder::CHDIR_MONITOR)
@@ -247,12 +249,6 @@ module Bundler
247
249
  EXT_LOCK
248
250
  end
249
251
 
250
- def fetch_prerelease_specs
251
- fetch_specs(false, true)
252
- rescue Gem::RemoteFetcher::FetchError
253
- {} # if we can't download them, there aren't any
254
- end
255
-
256
252
  def with_build_args(args)
257
253
  ext_lock.synchronize do
258
254
  old_args = build_args
@@ -531,8 +527,16 @@ module Bundler
531
527
  end
532
528
  end
533
529
 
534
- def fetch_specs(source, remote, name)
535
- path = source + "#{name}.#{Gem.marshal_version}.gz"
530
+ def plain_specs
531
+ Gem::Specification._all
532
+ end
533
+
534
+ def plain_specs=(specs)
535
+ Gem::Specification.all = specs
536
+ end
537
+
538
+ def fetch_specs(remote, name)
539
+ path = remote.uri.to_s + "#{name}.#{Gem.marshal_version}.gz"
536
540
  fetcher = gem_remote_fetcher
537
541
  fetcher.headers = { "X-Gemfile-Source" => remote.original_uri.to_s } if remote.original_uri
538
542
  string = fetcher.fetch_path(path)
@@ -543,10 +547,8 @@ module Bundler
543
547
  end
544
548
 
545
549
  def fetch_all_remote_specs(remote)
546
- source = remote.uri.is_a?(URI) ? remote.uri : URI.parse(source.to_s)
547
-
548
- specs = fetch_specs(source, remote, "specs")
549
- pres = fetch_specs(source, remote, "prerelease_specs") || []
550
+ specs = fetch_specs(remote, "specs")
551
+ pres = fetch_specs(remote, "prerelease_specs") || []
550
552
 
551
553
  specs.concat(pres)
552
554
  end
@@ -564,7 +566,7 @@ module Bundler
564
566
  require "resolv"
565
567
  proxy = configuration[:http_proxy]
566
568
  dns = Resolv::DNS.new
567
- Bundler::GemRemoteFetcher.new(proxy, dns)
569
+ Gem::RemoteFetcher.new(proxy, dns)
568
570
  end
569
571
 
570
572
  def gem_from_path(path, policy = nil)