bundler 2.1.0.pre.3 → 2.1.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +27 -3
- data/lib/bundler.rb +0 -1
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli.rb +1 -1
- data/lib/bundler/cli/config.rb +1 -1
- data/lib/bundler/cli/exec.rb +12 -3
- data/lib/bundler/cli/update.rb +1 -1
- data/lib/bundler/feature_flag.rb +1 -1
- data/lib/bundler/fetcher.rb +2 -2
- data/lib/bundler/fetcher/downloader.rb +1 -1
- data/lib/bundler/fetcher/index.rb +1 -1
- data/lib/bundler/friendly_errors.rb +1 -1
- data/lib/bundler/gem_helper.rb +12 -10
- data/lib/bundler/inline.rb +36 -31
- data/lib/bundler/lazy_specification.rb +0 -1
- data/lib/bundler/mirror.rb +3 -3
- data/lib/bundler/plugin/api/source.rb +2 -4
- data/lib/bundler/remote_specification.rb +0 -2
- data/lib/bundler/rubygems_integration.rb +5 -13
- data/lib/bundler/settings.rb +7 -4
- data/lib/bundler/source/git.rb +5 -5
- data/lib/bundler/source/git/git_proxy.rb +3 -2
- data/lib/bundler/source/rubygems.rb +3 -3
- data/lib/bundler/source/rubygems/remote.rb +1 -1
- data/lib/bundler/uri_credentials_filter.rb +7 -3
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +3 -3
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +26 -26
- data/lib/bundler/vendor/thor/lib/thor.rb +7 -0
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +10 -6
- data/lib/bundler/vendor/thor/lib/thor/base.rb +29 -19
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +13 -2
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +8 -9
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +10 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/util.rb +17 -1
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
- data/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
- data/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
- data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
- data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/lib/bundler/vendored_uri.rb +4 -0
- data/lib/bundler/version.rb +1 -1
- data/man/bundle-add.1 +1 -1
- data/man/bundle-add.1.txt +1 -1
- data/man/bundle-binstubs.1 +1 -1
- data/man/bundle-binstubs.1.txt +1 -1
- data/man/bundle-cache.1 +1 -1
- data/man/bundle-cache.1.txt +1 -1
- data/man/bundle-check.1 +1 -1
- data/man/bundle-check.1.txt +1 -1
- data/man/bundle-clean.1 +1 -1
- data/man/bundle-clean.1.txt +1 -1
- data/man/bundle-config.1 +1 -1
- data/man/bundle-config.1.txt +1 -1
- data/man/bundle-doctor.1 +1 -1
- data/man/bundle-doctor.1.txt +1 -1
- data/man/bundle-exec.1 +1 -1
- data/man/bundle-exec.1.txt +1 -1
- data/man/bundle-gem.1 +1 -1
- data/man/bundle-gem.1.txt +1 -1
- data/man/bundle-info.1 +1 -1
- data/man/bundle-info.1.txt +1 -1
- data/man/bundle-init.1 +1 -1
- data/man/bundle-init.1.txt +1 -1
- data/man/bundle-inject.1 +1 -1
- data/man/bundle-inject.1.txt +1 -1
- data/man/bundle-install.1 +1 -1
- data/man/bundle-install.1.txt +1 -1
- data/man/bundle-list.1 +1 -1
- data/man/bundle-list.1.txt +1 -1
- data/man/bundle-lock.1 +1 -1
- data/man/bundle-lock.1.txt +1 -1
- data/man/bundle-open.1 +1 -1
- data/man/bundle-open.1.txt +1 -1
- data/man/bundle-outdated.1 +1 -1
- data/man/bundle-outdated.1.txt +1 -1
- data/man/bundle-platform.1 +1 -1
- data/man/bundle-platform.1.txt +1 -1
- data/man/bundle-pristine.1 +1 -1
- data/man/bundle-pristine.1.txt +1 -1
- data/man/bundle-remove.1 +1 -1
- data/man/bundle-remove.1.txt +1 -1
- data/man/bundle-show.1 +1 -1
- data/man/bundle-show.1.txt +1 -1
- data/man/bundle-update.1 +1 -1
- data/man/bundle-update.1.txt +1 -1
- data/man/bundle-viz.1 +1 -1
- data/man/bundle-viz.1.txt +1 -1
- data/man/bundle.1 +1 -1
- data/man/bundle.1.txt +1 -1
- data/man/gemfile.5 +1 -1
- data/man/gemfile.5.txt +1 -1
- metadata +17 -5
- data/lib/bundler/gem_remote_fetcher.rb +0 -43
- data/lib/bundler/vendor/fileutils/lib/fileutils/version.rb +0 -5
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1b0f254fde45e5334d616c37efb448b0c3213d5681d141a3652fe6aa59e3f4a
|
4
|
+
data.tar.gz: 3c6f21c091483b75be54095df2449cc31f12dce5800473b57fabe7efa1536368
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d55cf58680c59ed903fa27d6b90e73d9609b9373ccf51041bbfdd31b56449ee40eb1d927c0ef1278aa977d85a912e06f90accaa958a36376abee465c11ad846b
|
7
|
+
data.tar.gz: 67860aa75e4883107d5c8c3afd76a388bea176a6b39382e1258ceafec35afa993aed49b82d2cce92da64e41739dafbbc65fba01ce9ca80470490d44474fabf7e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,27 @@
|
|
1
|
+
## 2.1.0 (December 15, 2019)
|
2
|
+
|
3
|
+
Features:
|
4
|
+
|
5
|
+
- Add support for new default gems. In particular,
|
6
|
+
|
7
|
+
* `open3` [#7455](https://github.com/bundler/bundler/pull/7455)
|
8
|
+
* `cgi`: [#7456](https://github.com/bundler/bundler/pull/7456)
|
9
|
+
* `uri` [#7460](https://github.com/bundler/bundler/pull/7460)
|
10
|
+
|
11
|
+
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)
|
12
|
+
|
13
|
+
Bugfixes:
|
14
|
+
|
15
|
+
- Fix `bundle exec rake install` failing [#7474](https://github.com/bundler/bundler/pull/7474)
|
16
|
+
- Fix `bundle exec`'ing to rubygems being silent [#7442](https://github.com/bundler/bundler/pull/7442)
|
17
|
+
- Restore previous `BUNDLE_GEMFILE` in `bundler/inline` [#7418](https://github.com/bundler/bundler/pull/7418)
|
18
|
+
- Fix error when using `gem` DSL's `:glob` option for selecting gemspecs from a specific source [#7419](https://github.com/bundler/bundler/pull/7419)
|
19
|
+
|
20
|
+
Changes:
|
21
|
+
|
22
|
+
- `bundle config` no longer warns when using "old interface" (might be deprecated again in the future) [#7475](https://github.com/bundler/bundler/pull/7475)
|
23
|
+
- `bundle update` no longer warns when used without arguments (might be deprecated again in the future) [#7475](https://github.com/bundler/bundler/pull/7475)
|
24
|
+
|
1
25
|
## 2.1.0.pre.3 (November 12, 2019)
|
2
26
|
|
3
27
|
Features:
|
@@ -20,13 +44,13 @@ Bugfixes:
|
|
20
44
|
Bugfixes:
|
21
45
|
|
22
46
|
- Fix `bundle clean` trying to delete non-existent directory ([#7340](https://github.com/bundler/bundler/pull/7340))
|
23
|
-
- Fix warnings about
|
47
|
+
- Fix warnings about keyword argument separation on ruby 2.7 ([#7337](https://github.com/bundler/bundler/pull/7337))
|
24
48
|
|
25
49
|
## 2.1.0.pre.1 (August 28, 2019)
|
26
50
|
|
27
51
|
One of the biggest changes in bundler 2.1.0 is that deprecations for upcoming
|
28
52
|
breaking changes in bundler 3 will be turned on by default. We do this to grab
|
29
|
-
feedback and
|
53
|
+
feedback and communicate early to our users the kind of changes we're intending
|
30
54
|
to ship with bundler 3. See
|
31
55
|
[#6965](https://github.com/bundler/bundler/pull/6965).
|
32
56
|
|
@@ -89,7 +113,7 @@ Bugfixes:
|
|
89
113
|
- Warn about situations where multiple gems provide the same executable ([#7075](https://github.com/bundler/bundler/pull/7075))
|
90
114
|
- Ignore `frozen` setting in inline mode ([#7125](https://github.com/bundler/bundler/pull/7125))
|
91
115
|
- 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
|
116
|
+
- 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
117
|
- 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
118
|
- Fix `bundle outdated` pluralization when multiple groups are requested ([#7063](https://github.com/bundler/bundler/pull/7063))
|
95
119
|
- Fix `bundle install` not updating conservatively when gemspec is changed ([#7143](https://github.com/bundler/bundler/pull/7143))
|
data/lib/bundler.rb
CHANGED
@@ -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-
|
8
|
-
@git_commit_sha = "
|
7
|
+
@built_at = "2019-12-15".freeze
|
8
|
+
@git_commit_sha = "683fe9799e".freeze
|
9
9
|
@release = true
|
10
10
|
# end ivars
|
11
11
|
|
data/lib/bundler/cli.rb
CHANGED
@@ -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").
|
data/lib/bundler/cli/config.rb
CHANGED
@@ -25,7 +25,7 @@ module Bundler
|
|
25
25
|
["config", "get", ARGV[1]]
|
26
26
|
end
|
27
27
|
|
28
|
-
SharedHelpers.major_deprecation
|
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
|
data/lib/bundler/cli/exec.rb
CHANGED
@@ -25,12 +25,12 @@ module Bundler
|
|
25
25
|
SharedHelpers.set_bundle_environment
|
26
26
|
if bin_path = Bundler.which(cmd)
|
27
27
|
if !Bundler.settings[:disable_exec_load] && ruby_shebang?(bin_path)
|
28
|
-
return kernel_load(bin_path, *args)
|
28
|
+
return with_verbose_rubygems { kernel_load(bin_path, *args) }
|
29
29
|
end
|
30
|
-
kernel_exec(bin_path, *args)
|
30
|
+
with_verbose_rubygems { kernel_exec(bin_path, *args) }
|
31
31
|
else
|
32
32
|
# exec using the given command
|
33
|
-
kernel_exec(cmd, *args)
|
33
|
+
with_verbose_rubygems { kernel_exec(cmd, *args) }
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -89,5 +89,14 @@ module Bundler
|
|
89
89
|
first_line = File.open(file, "rb") {|f| f.read(possibilities.map(&:size).max) }
|
90
90
|
possibilities.any? {|shebang| first_line.start_with?(shebang) }
|
91
91
|
end
|
92
|
+
|
93
|
+
def with_verbose_rubygems
|
94
|
+
old_ui = Gem::DefaultUserInteraction.ui
|
95
|
+
Gem::DefaultUserInteraction.ui = nil
|
96
|
+
|
97
|
+
yield
|
98
|
+
ensure
|
99
|
+
Gem::DefaultUserInteraction.ui = old_ui
|
100
|
+
end
|
92
101
|
end
|
93
102
|
end
|
data/lib/bundler/cli/update.rb
CHANGED
@@ -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
|
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
|
data/lib/bundler/feature_flag.rb
CHANGED
@@ -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) {
|
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 }
|
data/lib/bundler/fetcher.rb
CHANGED
@@ -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
|
data/lib/bundler/gem_helper.rb
CHANGED
@@ -73,8 +73,7 @@ module Bundler
|
|
73
73
|
|
74
74
|
def build_gem
|
75
75
|
file_name = nil
|
76
|
-
|
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
|
-
|
89
|
-
cmd = "#{gem} install #{built_gem_path}"
|
87
|
+
cmd = "#{gem_command} install #{built_gem_path}"
|
90
88
|
cmd += " --local" if local
|
91
|
-
|
92
|
-
unless status.success?
|
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
|
-
|
102
|
-
|
103
|
-
|
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(
|
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
|
data/lib/bundler/inline.rb
CHANGED
@@ -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
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
Bundler
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
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
|
-
|
53
|
-
|
54
|
-
|
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
|
-
|
58
|
-
definition.
|
59
|
-
|
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
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
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
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
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
|
data/lib/bundler/mirror.rb
CHANGED
@@ -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
|
|
@@ -247,12 +247,6 @@ module Bundler
|
|
247
247
|
EXT_LOCK
|
248
248
|
end
|
249
249
|
|
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
250
|
def with_build_args(args)
|
257
251
|
ext_lock.synchronize do
|
258
252
|
old_args = build_args
|
@@ -531,8 +525,8 @@ module Bundler
|
|
531
525
|
end
|
532
526
|
end
|
533
527
|
|
534
|
-
def fetch_specs(
|
535
|
-
path =
|
528
|
+
def fetch_specs(remote, name)
|
529
|
+
path = remote.uri.to_s + "#{name}.#{Gem.marshal_version}.gz"
|
536
530
|
fetcher = gem_remote_fetcher
|
537
531
|
fetcher.headers = { "X-Gemfile-Source" => remote.original_uri.to_s } if remote.original_uri
|
538
532
|
string = fetcher.fetch_path(path)
|
@@ -543,10 +537,8 @@ module Bundler
|
|
543
537
|
end
|
544
538
|
|
545
539
|
def fetch_all_remote_specs(remote)
|
546
|
-
|
547
|
-
|
548
|
-
specs = fetch_specs(source, remote, "specs")
|
549
|
-
pres = fetch_specs(source, remote, "prerelease_specs") || []
|
540
|
+
specs = fetch_specs(remote, "specs")
|
541
|
+
pres = fetch_specs(remote, "prerelease_specs") || []
|
550
542
|
|
551
543
|
specs.concat(pres)
|
552
544
|
end
|
@@ -564,7 +556,7 @@ module Bundler
|
|
564
556
|
require "resolv"
|
565
557
|
proxy = configuration[:http_proxy]
|
566
558
|
dns = Resolv::DNS.new
|
567
|
-
|
559
|
+
Gem::RemoteFetcher.new(proxy, dns)
|
568
560
|
end
|
569
561
|
|
570
562
|
def gem_from_path(path, policy = nil)
|