bundler 2.4.12 → 2.4.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +117 -0
- data/exe/bundle +5 -13
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli/binstubs.rb +1 -1
- data/lib/bundler/cli/info.rb +1 -1
- data/lib/bundler/cli/install.rb +1 -1
- data/lib/bundler/cli/outdated.rb +1 -1
- data/lib/bundler/cli/platform.rb +7 -5
- data/lib/bundler/cli/update.rb +1 -0
- data/lib/bundler/definition.rb +97 -59
- data/lib/bundler/dsl.rb +1 -1
- data/lib/bundler/env.rb +1 -1
- data/lib/bundler/feature_flag.rb +0 -1
- data/lib/bundler/fetcher/base.rb +2 -2
- data/lib/bundler/fetcher/compact_index.rb +4 -8
- data/lib/bundler/fetcher/dependency.rb +1 -1
- data/lib/bundler/fetcher/downloader.rb +2 -0
- data/lib/bundler/fetcher/index.rb +1 -2
- data/lib/bundler/fetcher.rb +42 -31
- data/lib/bundler/friendly_errors.rb +1 -1
- data/lib/bundler/gem_helper.rb +3 -4
- data/lib/bundler/index.rb +62 -31
- data/lib/bundler/installer/parallel_installer.rb +1 -1
- data/lib/bundler/installer/standalone.rb +8 -1
- data/lib/bundler/installer.rb +1 -1
- data/lib/bundler/lockfile_generator.rb +1 -1
- data/lib/bundler/lockfile_parser.rb +4 -15
- data/lib/bundler/man/bundle-add.1 +1 -1
- data/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/lib/bundler/man/bundle-cache.1 +3 -3
- data/lib/bundler/man/bundle-cache.1.ronn +2 -2
- 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 +1 -4
- data/lib/bundler/man/bundle-config.1.ronn +0 -3
- data/lib/bundler/man/bundle-console.1 +1 -1
- 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 +1 -1
- data/lib/bundler/man/bundle-help.1 +1 -1
- data/lib/bundler/man/bundle-info.1 +3 -3
- data/lib/bundler/man/bundle-info.1.ronn +3 -3
- 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 +1 -1
- 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 +13 -9
- data/lib/bundler/man/bundle-outdated.1.ronn +12 -9
- data/lib/bundler/man/bundle-platform.1 +1 -1
- data/lib/bundler/man/bundle-plugin.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 +1 -1
- data/lib/bundler/man/bundle-version.1 +1 -1
- data/lib/bundler/man/bundle-viz.1 +1 -1
- data/lib/bundler/man/bundle.1 +1 -1
- data/lib/bundler/man/gemfile.5 +26 -2
- data/lib/bundler/man/gemfile.5.ronn +11 -1
- data/lib/bundler/plugin/index.rb +1 -1
- data/lib/bundler/plugin.rb +1 -1
- data/lib/bundler/resolver.rb +34 -5
- data/lib/bundler/retry.rb +1 -1
- data/lib/bundler/ruby_dsl.rb +27 -0
- data/lib/bundler/ruby_version.rb +2 -2
- data/lib/bundler/rubygems_integration.rb +1 -1
- data/lib/bundler/runtime.rb +1 -1
- data/lib/bundler/safe_marshal.rb +31 -0
- data/lib/bundler/self_manager.rb +2 -0
- data/lib/bundler/settings.rb +40 -16
- data/lib/bundler/source/git/git_proxy.rb +45 -15
- data/lib/bundler/source/git.rb +40 -14
- data/lib/bundler/source/rubygems.rb +30 -30
- data/lib/bundler/source.rb +1 -1
- data/lib/bundler/source_list.rb +0 -4
- data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +1 -1
- data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +4 -4
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +1 -1
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -1
- data/lib/bundler/ui/rg_proxy.rb +1 -1
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1 -1
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +9 -4
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler.rb +7 -15
- metadata +4 -3
@@ -15,7 +15,7 @@ module Bundler
|
|
15
15
|
method.bind(self).call(*args, &blk)
|
16
16
|
rescue NetworkDownError, CompactIndexClient::Updater::MisMatchedChecksumError => e
|
17
17
|
raise HTTPError, e.message
|
18
|
-
rescue AuthenticationRequiredError
|
18
|
+
rescue AuthenticationRequiredError, BadAuthenticationError
|
19
19
|
# Fail since we got a 401 from the server.
|
20
20
|
raise
|
21
21
|
rescue HTTPError => e
|
@@ -35,12 +35,12 @@ module Bundler
|
|
35
35
|
remaining_gems = gem_names.dup
|
36
36
|
|
37
37
|
until remaining_gems.empty?
|
38
|
-
log_specs "Looking up gems #{remaining_gems.inspect}"
|
38
|
+
log_specs { "Looking up gems #{remaining_gems.inspect}" }
|
39
39
|
|
40
40
|
deps = begin
|
41
41
|
parallel_compact_index_client.dependencies(remaining_gems)
|
42
42
|
rescue TooManyRequestsError
|
43
|
-
@bundle_worker
|
43
|
+
@bundle_worker&.stop
|
44
44
|
@bundle_worker = nil # reset it. Not sure if necessary
|
45
45
|
serial_compact_index_client.dependencies(remaining_gems)
|
46
46
|
end
|
@@ -49,7 +49,7 @@ module Bundler
|
|
49
49
|
complete_gems.concat(deps.map(&:first)).uniq!
|
50
50
|
remaining_gems = next_gems - complete_gems
|
51
51
|
end
|
52
|
-
@bundle_worker
|
52
|
+
@bundle_worker&.stop
|
53
53
|
@bundle_worker = nil # reset it. Not sure if necessary
|
54
54
|
|
55
55
|
gem_info
|
@@ -60,10 +60,6 @@ module Bundler
|
|
60
60
|
Bundler.ui.debug("FIPS mode is enabled, bundler can't use the CompactIndex API")
|
61
61
|
return nil
|
62
62
|
end
|
63
|
-
if fetch_uri.scheme == "file"
|
64
|
-
Bundler.ui.debug("Using a local server, bundler won't use the CompactIndex API")
|
65
|
-
return false
|
66
|
-
end
|
67
63
|
# Read info file checksums out of /versions, so we can know if gems are up to date
|
68
64
|
compact_index_client.update_and_parse_checksums!
|
69
65
|
rescue CompactIndexClient::Updater::MisMatchedChecksumError => e
|
@@ -24,7 +24,7 @@ module Bundler
|
|
24
24
|
def specs(gem_names, full_dependency_list = [], last_spec_list = [])
|
25
25
|
query_list = gem_names.uniq - full_dependency_list
|
26
26
|
|
27
|
-
log_specs "Query List: #{query_list.inspect}"
|
27
|
+
log_specs { "Query List: #{query_list.inspect}" }
|
28
28
|
|
29
29
|
return last_spec_list if query_list.empty?
|
30
30
|
|
@@ -41,6 +41,8 @@ module Bundler
|
|
41
41
|
when Net::HTTPUnauthorized
|
42
42
|
raise BadAuthenticationError, uri.host if uri.userinfo
|
43
43
|
raise AuthenticationRequiredError, uri.host
|
44
|
+
when Net::HTTPForbidden
|
45
|
+
raise AuthenticationForbiddenError, uri.host
|
44
46
|
when Net::HTTPNotFound
|
45
47
|
raise FallbackError, "Net::HTTPNotFound: #{filtered_uri}"
|
46
48
|
else
|
@@ -15,8 +15,7 @@ module Bundler
|
|
15
15
|
raise BadAuthenticationError, remote_uri if remote_uri.userinfo
|
16
16
|
raise AuthenticationRequiredError, remote_uri
|
17
17
|
when /403/
|
18
|
-
raise
|
19
|
-
raise AuthenticationRequiredError, remote_uri
|
18
|
+
raise AuthenticationForbiddenError, remote_uri
|
20
19
|
else
|
21
20
|
raise HTTPError, "Could not fetch specs from #{display_uri} due to underlying error <#{e.message}>"
|
22
21
|
end
|
data/lib/bundler/fetcher.rb
CHANGED
@@ -9,6 +9,7 @@ require "rubygems/request"
|
|
9
9
|
module Bundler
|
10
10
|
# Handles all the fetching with the rubygems server
|
11
11
|
class Fetcher
|
12
|
+
autoload :Base, File.expand_path("fetcher/base", __dir__)
|
12
13
|
autoload :CompactIndex, File.expand_path("fetcher/compact_index", __dir__)
|
13
14
|
autoload :Downloader, File.expand_path("fetcher/downloader", __dir__)
|
14
15
|
autoload :Dependency, File.expand_path("fetcher/dependency", __dir__)
|
@@ -61,6 +62,16 @@ module Bundler
|
|
61
62
|
end
|
62
63
|
end
|
63
64
|
|
65
|
+
# This error is raised if HTTP authentication is correct, but lacks
|
66
|
+
# necessary permissions.
|
67
|
+
class AuthenticationForbiddenError < HTTPError
|
68
|
+
def initialize(remote_uri)
|
69
|
+
remote_uri = filter_uri(remote_uri)
|
70
|
+
super "Access token could not be authenticated for #{remote_uri}.\n" \
|
71
|
+
"Make sure it's valid and has the necessary scopes configured."
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
64
75
|
# Exceptions classes that should bypass retry attempts. If your password didn't work the
|
65
76
|
# first time, it's not going to the third time.
|
66
77
|
NET_ERRORS = [:HTTPBadGateway, :HTTPBadRequest, :HTTPFailedDependency,
|
@@ -70,7 +81,7 @@ module Bundler
|
|
70
81
|
:HTTPRequestURITooLong, :HTTPUnauthorized, :HTTPUnprocessableEntity,
|
71
82
|
:HTTPUnsupportedMediaType, :HTTPVersionNotSupported].freeze
|
72
83
|
FAIL_ERRORS = begin
|
73
|
-
fail_errors = [AuthenticationRequiredError, BadAuthenticationError, FallbackError]
|
84
|
+
fail_errors = [AuthenticationRequiredError, BadAuthenticationError, AuthenticationForbiddenError, FallbackError]
|
74
85
|
fail_errors << Gem::Requirement::BadRequirementError
|
75
86
|
fail_errors.concat(NET_ERRORS.map {|e| Net.const_get(e) })
|
76
87
|
end.freeze
|
@@ -124,18 +135,7 @@ module Bundler
|
|
124
135
|
def specs(gem_names, source)
|
125
136
|
index = Bundler::Index.new
|
126
137
|
|
127
|
-
|
128
|
-
@use_api = false
|
129
|
-
specs = fetchers.last.specs(gem_names)
|
130
|
-
else
|
131
|
-
specs = []
|
132
|
-
@fetchers = fetchers.drop_while do |f|
|
133
|
-
!f.available? || (f.api_fetcher? && !gem_names) || !specs = f.specs(gem_names)
|
134
|
-
end
|
135
|
-
@use_api = false if fetchers.none?(&:api_fetcher?)
|
136
|
-
end
|
137
|
-
|
138
|
-
specs.each do |name, version, platform, dependencies, metadata|
|
138
|
+
fetch_specs(gem_names).each do |name, version, platform, dependencies, metadata|
|
139
139
|
spec = if dependencies
|
140
140
|
EndpointSpecification.new(name, version, platform, self, dependencies, metadata)
|
141
141
|
else
|
@@ -148,22 +148,10 @@ module Bundler
|
|
148
148
|
|
149
149
|
index
|
150
150
|
rescue CertificateFailureError
|
151
|
-
Bundler.ui.info "" if gem_names &&
|
151
|
+
Bundler.ui.info "" if gem_names && api_fetcher? # newline after dots
|
152
152
|
raise
|
153
153
|
end
|
154
154
|
|
155
|
-
def use_api
|
156
|
-
return @use_api if defined?(@use_api)
|
157
|
-
|
158
|
-
fetchers.shift until fetchers.first.available?
|
159
|
-
|
160
|
-
@use_api = if remote_uri.scheme == "file" || Bundler::Fetcher.disable_endpoint
|
161
|
-
false
|
162
|
-
else
|
163
|
-
fetchers.first.api_fetcher?
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
155
|
def user_agent
|
168
156
|
@user_agent ||= begin
|
169
157
|
ruby = Bundler::RubyVersion.system
|
@@ -199,10 +187,6 @@ module Bundler
|
|
199
187
|
end
|
200
188
|
end
|
201
189
|
|
202
|
-
def fetchers
|
203
|
-
@fetchers ||= FETCHERS.map {|f| f.new(downloader, @remote, uri) }
|
204
|
-
end
|
205
|
-
|
206
190
|
def http_proxy
|
207
191
|
return unless uri = connection.proxy_uri
|
208
192
|
uri.to_s
|
@@ -212,9 +196,36 @@ module Bundler
|
|
212
196
|
"#<#{self.class}:0x#{object_id} uri=#{uri}>"
|
213
197
|
end
|
214
198
|
|
199
|
+
def api_fetcher?
|
200
|
+
fetchers.first.api_fetcher?
|
201
|
+
end
|
202
|
+
|
215
203
|
private
|
216
204
|
|
217
|
-
|
205
|
+
def available_fetchers
|
206
|
+
if Bundler::Fetcher.disable_endpoint
|
207
|
+
[Index]
|
208
|
+
elsif remote_uri.scheme == "file"
|
209
|
+
Bundler.ui.debug("Using a local server, bundler won't use the CompactIndex API")
|
210
|
+
[Index]
|
211
|
+
else
|
212
|
+
[CompactIndex, Dependency, Index]
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
def fetchers
|
217
|
+
@fetchers ||= available_fetchers.map {|f| f.new(downloader, @remote, uri) }.drop_while {|f| !f.available? }
|
218
|
+
end
|
219
|
+
|
220
|
+
def fetch_specs(gem_names)
|
221
|
+
fetchers.reject!(&:api_fetcher?) unless gem_names
|
222
|
+
fetchers.reject! do |f|
|
223
|
+
specs = f.specs(gem_names)
|
224
|
+
return specs if specs
|
225
|
+
true
|
226
|
+
end
|
227
|
+
[]
|
228
|
+
end
|
218
229
|
|
219
230
|
def cis
|
220
231
|
env_cis = {
|
data/lib/bundler/gem_helper.rb
CHANGED
@@ -21,7 +21,7 @@ module Bundler
|
|
21
21
|
|
22
22
|
def gemspec(&block)
|
23
23
|
gemspec = instance.gemspec
|
24
|
-
block
|
24
|
+
block&.call(gemspec)
|
25
25
|
gemspec
|
26
26
|
end
|
27
27
|
end
|
@@ -152,8 +152,7 @@ module Bundler
|
|
152
152
|
|
153
153
|
def gem_push_host
|
154
154
|
env_rubygems_host = ENV["RUBYGEMS_HOST"]
|
155
|
-
env_rubygems_host = nil if
|
156
|
-
env_rubygems_host && env_rubygems_host.empty?
|
155
|
+
env_rubygems_host = nil if env_rubygems_host&.empty?
|
157
156
|
|
158
157
|
allowed_push_host || env_rubygems_host || "rubygems.org"
|
159
158
|
end
|
@@ -218,7 +217,7 @@ module Bundler
|
|
218
217
|
SharedHelpers.chdir(base) do
|
219
218
|
outbuf = IO.popen(cmd, :err => [:child, :out], &:read)
|
220
219
|
status = $?
|
221
|
-
block
|
220
|
+
block&.call(outbuf) if status.success?
|
222
221
|
[outbuf, status]
|
223
222
|
end
|
224
223
|
end
|
data/lib/bundler/index.rb
CHANGED
@@ -10,8 +10,8 @@ module Bundler
|
|
10
10
|
i
|
11
11
|
end
|
12
12
|
|
13
|
-
attr_reader :specs, :
|
14
|
-
protected :specs, :
|
13
|
+
attr_reader :specs, :duplicates, :sources
|
14
|
+
protected :specs, :duplicates
|
15
15
|
|
16
16
|
RUBY = "ruby"
|
17
17
|
NULL = "\0"
|
@@ -19,21 +19,21 @@ module Bundler
|
|
19
19
|
def initialize
|
20
20
|
@sources = []
|
21
21
|
@cache = {}
|
22
|
-
@specs =
|
23
|
-
@
|
22
|
+
@specs = {}
|
23
|
+
@duplicates = {}
|
24
24
|
end
|
25
25
|
|
26
26
|
def initialize_copy(o)
|
27
27
|
@sources = o.sources.dup
|
28
28
|
@cache = {}
|
29
|
-
@specs =
|
30
|
-
@
|
29
|
+
@specs = {}
|
30
|
+
@duplicates = {}
|
31
31
|
|
32
32
|
o.specs.each do |name, hash|
|
33
33
|
@specs[name] = hash.dup
|
34
34
|
end
|
35
|
-
o.
|
36
|
-
@
|
35
|
+
o.duplicates.each do |name, array|
|
36
|
+
@duplicates[name] = array.dup
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -46,12 +46,11 @@ module Bundler
|
|
46
46
|
true
|
47
47
|
end
|
48
48
|
|
49
|
-
def search_all(name)
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
all_matches
|
49
|
+
def search_all(name, &blk)
|
50
|
+
return enum_for(:search_all, name) unless blk
|
51
|
+
specs_by_name(name).each(&blk)
|
52
|
+
@duplicates[name]&.each(&blk)
|
53
|
+
@sources.each {|source| source.search_all(name, &blk) }
|
55
54
|
end
|
56
55
|
|
57
56
|
# Search this index's specs, and any source indexes that this index knows
|
@@ -61,11 +60,14 @@ module Bundler
|
|
61
60
|
return results unless @sources.any?
|
62
61
|
|
63
62
|
@sources.each do |source|
|
64
|
-
results
|
63
|
+
results = safe_concat(results, source.search(query))
|
65
64
|
end
|
66
|
-
results.uniq(&:full_name)
|
65
|
+
results.uniq!(&:full_name) unless results.empty? # avoid modifying frozen EMPTY_SEARCH
|
66
|
+
results
|
67
67
|
end
|
68
68
|
|
69
|
+
alias_method :[], :search
|
70
|
+
|
69
71
|
def local_search(query)
|
70
72
|
case query
|
71
73
|
when Gem::Specification, RemoteSpecification, LazySpecification, EndpointSpecification then search_by_spec(query)
|
@@ -76,12 +78,10 @@ module Bundler
|
|
76
78
|
end
|
77
79
|
end
|
78
80
|
|
79
|
-
|
80
|
-
|
81
|
-
def <<(spec)
|
82
|
-
@specs[spec.name][spec.full_name] = spec
|
83
|
-
spec
|
81
|
+
def add(spec)
|
82
|
+
(@specs[spec.name] ||= {}).store(spec.full_name, spec)
|
84
83
|
end
|
84
|
+
alias_method :<<, :add
|
85
85
|
|
86
86
|
def each(&blk)
|
87
87
|
return enum_for(:each) unless blk
|
@@ -115,15 +115,25 @@ module Bundler
|
|
115
115
|
names.uniq
|
116
116
|
end
|
117
117
|
|
118
|
-
|
118
|
+
# Combines indexes proritizing existing specs, like `Hash#reverse_merge!`
|
119
|
+
# Duplicate specs found in `other` are stored in `@duplicates`.
|
120
|
+
def use(other)
|
119
121
|
return unless other
|
120
|
-
other.each do |
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
122
|
+
other.each do |spec|
|
123
|
+
exist?(spec) ? add_duplicate(spec) : add(spec)
|
124
|
+
end
|
125
|
+
self
|
126
|
+
end
|
127
|
+
|
128
|
+
# Combines indexes proritizing specs from `other`, like `Hash#merge!`
|
129
|
+
# Duplicate specs found in `self` are saved in `@duplicates`.
|
130
|
+
def merge!(other)
|
131
|
+
return unless other
|
132
|
+
other.each do |spec|
|
133
|
+
if existing = find_by_spec(spec)
|
134
|
+
add_duplicate(existing)
|
125
135
|
end
|
126
|
-
|
136
|
+
add spec
|
127
137
|
end
|
128
138
|
self
|
129
139
|
end
|
@@ -157,19 +167,40 @@ module Bundler
|
|
157
167
|
|
158
168
|
private
|
159
169
|
|
170
|
+
def safe_concat(a, b)
|
171
|
+
return a if b.empty?
|
172
|
+
return b if a.empty?
|
173
|
+
a.concat(b)
|
174
|
+
end
|
175
|
+
|
176
|
+
def add_duplicate(spec)
|
177
|
+
(@duplicates[spec.name] ||= []) << spec
|
178
|
+
end
|
179
|
+
|
160
180
|
def specs_by_name_and_version(name, version)
|
161
|
-
|
181
|
+
results = @specs[name]&.values
|
182
|
+
return EMPTY_SEARCH unless results
|
183
|
+
results.select! {|spec| spec.version == version }
|
184
|
+
results
|
162
185
|
end
|
163
186
|
|
164
187
|
def specs_by_name(name)
|
165
|
-
@specs[name]
|
188
|
+
@specs[name]&.values || EMPTY_SEARCH
|
166
189
|
end
|
167
190
|
|
168
191
|
EMPTY_SEARCH = [].freeze
|
169
192
|
|
170
193
|
def search_by_spec(spec)
|
171
|
-
spec =
|
194
|
+
spec = find_by_spec(spec)
|
172
195
|
spec ? [spec] : EMPTY_SEARCH
|
173
196
|
end
|
197
|
+
|
198
|
+
def find_by_spec(spec)
|
199
|
+
@specs[spec.name]&.fetch(spec.full_name, nil)
|
200
|
+
end
|
201
|
+
|
202
|
+
def exist?(spec)
|
203
|
+
@specs[spec.name]&.key?(spec.full_name)
|
204
|
+
end
|
174
205
|
end
|
175
206
|
end
|
@@ -55,13 +55,20 @@ module Bundler
|
|
55
55
|
if spec.source.instance_of?(Source::Path) && spec.source.path.absolute?
|
56
56
|
full_path
|
57
57
|
else
|
58
|
-
|
58
|
+
relative_path_from(Bundler.root.join(bundler_path), :to => full_path) || full_path
|
59
59
|
end
|
60
60
|
rescue TypeError
|
61
61
|
error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
|
62
62
|
raise Gem::InvalidSpecificationException.new(error_message)
|
63
63
|
end
|
64
64
|
|
65
|
+
def relative_path_from(source, to:)
|
66
|
+
Pathname.new(to).relative_path_from(source).to_s
|
67
|
+
rescue ArgumentError
|
68
|
+
# on Windows, if source and destination are on different drivers, there's no relative path from one to the other
|
69
|
+
nil
|
70
|
+
end
|
71
|
+
|
65
72
|
def define_path_helpers
|
66
73
|
<<~'END'
|
67
74
|
unless defined?(Gem)
|
data/lib/bundler/installer.rb
CHANGED
@@ -90,7 +90,7 @@ module Bundler
|
|
90
90
|
|
91
91
|
Gem::Specification.reset # invalidate gem specification cache so that installed gems are immediately available
|
92
92
|
|
93
|
-
lock
|
93
|
+
lock
|
94
94
|
Standalone.new(options[:standalone], @definition).generate if options[:standalone]
|
95
95
|
end
|
96
96
|
end
|
@@ -26,6 +26,7 @@ module Bundler
|
|
26
26
|
KNOWN_SECTIONS = SECTIONS_BY_VERSION_INTRODUCED.values.flatten.freeze
|
27
27
|
|
28
28
|
ENVIRONMENT_VERSION_SECTIONS = [BUNDLED, RUBY].freeze
|
29
|
+
deprecate_constant(:ENVIRONMENT_VERSION_SECTIONS)
|
29
30
|
|
30
31
|
def self.sections_in_lockfile(lockfile_contents)
|
31
32
|
lockfile_contents.scan(/^\w[\w ]*$/).uniq
|
@@ -109,21 +110,9 @@ module Bundler
|
|
109
110
|
def parse_source(line)
|
110
111
|
case line
|
111
112
|
when SPECS
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
@sources << @current_source
|
116
|
-
when GIT
|
117
|
-
@current_source = TYPES[@type].from_lock(@opts)
|
118
|
-
@sources << @current_source
|
119
|
-
when GEM
|
120
|
-
@opts["remotes"] = Array(@opts.delete("remote")).reverse
|
121
|
-
@current_source = TYPES[@type].from_lock(@opts)
|
122
|
-
@sources << @current_source
|
123
|
-
when PLUGIN
|
124
|
-
@current_source = Plugin.source_from_lock(@opts)
|
125
|
-
@sources << @current_source
|
126
|
-
end
|
113
|
+
return unless TYPES.key?(@type)
|
114
|
+
@current_source = TYPES[@type].from_lock(@opts)
|
115
|
+
@sources << @current_source
|
127
116
|
when OPTIONS
|
128
117
|
value = $2
|
129
118
|
value = true if value == "true"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-BINSTUBS" "1" "
|
4
|
+
.TH "BUNDLE\-BINSTUBS" "1" "August 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-CACHE" "1" "
|
4
|
+
.TH "BUNDLE\-CACHE" "1" "August 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
|
@@ -13,7 +13,7 @@
|
|
13
13
|
alias: \fBpackage\fR, \fBpack\fR
|
14
14
|
.
|
15
15
|
.SH "DESCRIPTION"
|
16
|
-
Copy all of the \fB\.gem\fR files needed to run the application into the \fBvendor/cache\fR directory\. In the future, when running
|
16
|
+
Copy all of the \fB\.gem\fR files needed to run the application into the \fBvendor/cache\fR directory\. In the future, when running \fBbundle install(1)\fR \fIbundle\-install\.1\.html\fR, use the gems in the cache in preference to the ones on \fBrubygems\.org\fR\.
|
17
17
|
.
|
18
18
|
.SH "GIT AND PATH GEMS"
|
19
19
|
The \fBbundle cache\fR command can also package \fB:git\fR and \fB:path\fR dependencies besides \.gem files\. This needs to be explicitly enabled via the \fB\-\-all\fR option\. Once used, the \fB\-\-all\fR option will be remembered\.
|
@@ -22,7 +22,7 @@ The \fBbundle cache\fR command can also package \fB:git\fR and \fB:path\fR depen
|
|
22
22
|
When using gems that have different packages for different platforms, Bundler supports caching of gems for other platforms where the Gemfile has been resolved (i\.e\. present in the lockfile) in \fBvendor/cache\fR\. This needs to be enabled via the \fB\-\-all\-platforms\fR option\. This setting will be remembered in your local bundler configuration\.
|
23
23
|
.
|
24
24
|
.SH "REMOTE FETCHING"
|
25
|
-
By default, if you run \fBbundle install(1)\fR
|
25
|
+
By default, if you run \fBbundle install(1)\fR \fIbundle\-install\.1\.html\fR after running bundle cache(1) \fIbundle\-cache\.1\.html\fR, bundler will still connect to \fBrubygems\.org\fR to check whether a platform\-specific gem exists for any of the gems in \fBvendor/cache\fR\.
|
26
26
|
.
|
27
27
|
.P
|
28
28
|
For instance, consider this Gemfile(5):
|
@@ -10,7 +10,7 @@ alias: `package`, `pack`
|
|
10
10
|
## DESCRIPTION
|
11
11
|
|
12
12
|
Copy all of the `.gem` files needed to run the application into the
|
13
|
-
`vendor/cache` directory. In the future, when running [bundle install(1)]
|
13
|
+
`vendor/cache` directory. In the future, when running [`bundle install(1)`](bundle-install.1.html),
|
14
14
|
use the gems in the cache in preference to the ones on `rubygems.org`.
|
15
15
|
|
16
16
|
## GIT AND PATH GEMS
|
@@ -29,7 +29,7 @@ bundler configuration.
|
|
29
29
|
|
30
30
|
## REMOTE FETCHING
|
31
31
|
|
32
|
-
By default, if you run `bundle install(1)`](bundle-install.1.html) after running
|
32
|
+
By default, if you run [`bundle install(1)`](bundle-install.1.html) after running
|
33
33
|
[bundle cache(1)](bundle-cache.1.html), bundler will still connect to `rubygems.org`
|
34
34
|
to check whether a platform-specific gem exists for any of the gems
|
35
35
|
in `vendor/cache`.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-CHECK" "1" "
|
4
|
+
.TH "BUNDLE\-CHECK" "1" "August 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-CLEAN" "1" "
|
4
|
+
.TH "BUNDLE\-CLEAN" "1" "August 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-CONFIG" "1" "
|
4
|
+
.TH "BUNDLE\-CONFIG" "1" "August 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-config\fR \- Set bundler configuration options
|
@@ -284,9 +284,6 @@ The following is a list of all configuration keys and their purpose\. You can le
|
|
284
284
|
\fBssl_verify_mode\fR (\fBBUNDLE_SSL_VERIFY_MODE\fR): The SSL verification mode Bundler uses when making HTTPS requests\. Defaults to verify peer\.
|
285
285
|
.
|
286
286
|
.IP "\(bu" 4
|
287
|
-
\fBsuppress_install_using_messages\fR (\fBBUNDLE_SUPPRESS_INSTALL_USING_MESSAGES\fR): Avoid printing \fBUsing \.\.\.\fR messages during installation when the version of a gem has not changed\.
|
288
|
-
.
|
289
|
-
.IP "\(bu" 4
|
290
287
|
\fBsystem_bindir\fR (\fBBUNDLE_SYSTEM_BINDIR\fR): The location where RubyGems installs binstubs\. Defaults to \fBGem\.bindir\fR\.
|
291
288
|
.
|
292
289
|
.IP "\(bu" 4
|
@@ -265,9 +265,6 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|
265
265
|
* `ssl_verify_mode` (`BUNDLE_SSL_VERIFY_MODE`):
|
266
266
|
The SSL verification mode Bundler uses when making HTTPS requests.
|
267
267
|
Defaults to verify peer.
|
268
|
-
* `suppress_install_using_messages` (`BUNDLE_SUPPRESS_INSTALL_USING_MESSAGES`):
|
269
|
-
Avoid printing `Using ...` messages during installation when the version of
|
270
|
-
a gem has not changed.
|
271
268
|
* `system_bindir` (`BUNDLE_SYSTEM_BINDIR`):
|
272
269
|
The location where RubyGems installs binstubs. Defaults to `Gem.bindir`.
|
273
270
|
* `timeout` (`BUNDLE_TIMEOUT`):
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-CONSOLE" "1" "
|
4
|
+
.TH "BUNDLE\-CONSOLE" "1" "August 2023" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-console\fR \- Deprecated way to open an IRB session with the bundle pre\-loaded
|