bundler 2.2.30 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +86 -0
- data/exe/bundle +7 -8
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli/doctor.rb +3 -2
- data/lib/bundler/cli/gem.rb +70 -8
- data/lib/bundler/cli/info.rb +6 -1
- data/lib/bundler/cli/install.rb +2 -0
- data/lib/bundler/cli/update.rb +2 -2
- data/lib/bundler/cli.rb +9 -1
- data/lib/bundler/compact_index_client/updater.rb +0 -5
- data/lib/bundler/definition.rb +66 -120
- data/lib/bundler/dependency.rb +5 -7
- data/lib/bundler/dsl.rb +18 -30
- data/lib/bundler/endpoint_specification.rb +0 -8
- data/lib/bundler/environment_preserver.rb +4 -1
- data/lib/bundler/fetcher/compact_index.rb +9 -4
- data/lib/bundler/fetcher.rb +2 -5
- data/lib/bundler/gem_helper.rb +2 -2
- data/lib/bundler/injector.rb +10 -1
- data/lib/bundler/installer/gem_installer.rb +1 -6
- data/lib/bundler/installer.rb +1 -4
- data/lib/bundler/lazy_specification.rb +17 -1
- data/lib/bundler/lockfile_parser.rb +10 -12
- 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 +5 -5
- data/lib/bundler/man/bundle-config.1.ronn +5 -5
- 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 +2 -2
- data/lib/bundler/man/bundle-update.1.ronn +2 -1
- 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 +1 -0
- data/lib/bundler/plugin/installer.rb +1 -1
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/psyched_yaml.rb +1 -13
- data/lib/bundler/resolver.rb +34 -31
- data/lib/bundler/rubygems_ext.rb +2 -0
- data/lib/bundler/rubygems_integration.rb +11 -48
- data/lib/bundler/runtime.rb +1 -1
- data/lib/bundler/self_manager.rb +73 -0
- data/lib/bundler/shared_helpers.rb +4 -12
- data/lib/bundler/source/git/git_proxy.rb +7 -4
- data/lib/bundler/source/metadata.rb +1 -1
- data/lib/bundler/source/rubygems.rb +17 -13
- data/lib/bundler/source/rubygems_aggregate.rb +1 -1
- data/lib/bundler/source.rb +1 -1
- data/lib/bundler/source_list.rb +7 -29
- data/lib/bundler/spec_set.rb +1 -1
- data/lib/bundler/templates/Executable.bundler +1 -1
- 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/Rakefile.tt +15 -2
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +2 -2
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +13 -13
- data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/lib/bundler/templates/newgem/standard.yml.tt +2 -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/molinillo/lib/molinillo/dependency_graph.rb +2 -2
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +453 -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.rb +9 -3
- metadata +13 -5
- data/lib/bundler/gemdeps.rb +0 -29
data/lib/bundler/resolver.rb
CHANGED
@@ -30,10 +30,8 @@ module Bundler
|
|
30
30
|
@resolver = Molinillo::Resolver.new(self, self)
|
31
31
|
@search_for = {}
|
32
32
|
@base_dg = Molinillo::DependencyGraph.new
|
33
|
-
aggregate_global_source = @source_requirements[:default].is_a?(Source::RubygemsAggregate)
|
34
33
|
@base.each do |ls|
|
35
34
|
dep = Dependency.new(ls.name, ls.version)
|
36
|
-
ls.source = source_for(ls.name) unless aggregate_global_source
|
37
35
|
@base_dg.add_vertex(ls.name, DepProxy.get_proxy(dep, ls.platform), true)
|
38
36
|
end
|
39
37
|
additional_base_requirements.each {|d| @base_dg.add_vertex(d.name, d) }
|
@@ -136,6 +134,7 @@ module Bundler
|
|
136
134
|
end
|
137
135
|
nested.reduce([]) do |groups, (version, specs)|
|
138
136
|
next groups if locked_requirement && !locked_requirement.satisfied_by?(version)
|
137
|
+
next groups unless specs.any? {|spec| spec.match_platform(platform) }
|
139
138
|
|
140
139
|
specs_by_platform = Hash.new do |current_specs, current_platform|
|
141
140
|
current_specs[current_platform] = select_best_platform_match(specs, current_platform)
|
@@ -147,7 +146,7 @@ module Bundler
|
|
147
146
|
next groups if @resolving_only_for_ruby
|
148
147
|
|
149
148
|
spec_group = SpecGroup.create_for(specs_by_platform, @platforms, platform)
|
150
|
-
groups << spec_group
|
149
|
+
groups << spec_group
|
151
150
|
|
152
151
|
groups
|
153
152
|
end
|
@@ -264,30 +263,37 @@ module Bundler
|
|
264
263
|
"If you are updating multiple gems in your Gemfile at once,\n" \
|
265
264
|
"try passing them all to `bundle update`"
|
266
265
|
else
|
267
|
-
|
268
|
-
specs = source.specs.search(name)
|
269
|
-
versions_with_platforms = specs.map {|s| [s.version, s.platform] }
|
270
|
-
cache_message = begin
|
271
|
-
" or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
|
272
|
-
rescue GemfileNotFound
|
273
|
-
nil
|
274
|
-
end
|
275
|
-
message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source.to_err}#{cache_message}.\n")
|
276
|
-
message << "The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}" if versions_with_platforms.any?
|
266
|
+
message = gem_not_found_message(name, requirement, source_for(name))
|
277
267
|
end
|
278
268
|
raise GemNotFound, message
|
279
269
|
end
|
280
270
|
end
|
281
271
|
|
282
|
-
def
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
272
|
+
def gem_not_found_message(name, requirement, source, extra_message = "")
|
273
|
+
specs = source.specs.search(name)
|
274
|
+
matching_part = name
|
275
|
+
requirement_label = SharedHelpers.pretty_dependency(requirement)
|
276
|
+
cache_message = begin
|
277
|
+
" or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
|
278
|
+
rescue GemfileNotFound
|
279
|
+
nil
|
280
|
+
end
|
281
|
+
specs_matching_requirement = specs.select {| spec| requirement.matches_spec?(spec) }
|
282
|
+
|
283
|
+
if specs_matching_requirement.any?
|
284
|
+
specs = specs_matching_requirement
|
285
|
+
matching_part = requirement_label
|
286
|
+
requirement_label = "#{requirement_label} #{requirement.__platform}"
|
289
287
|
end
|
290
|
-
|
288
|
+
|
289
|
+
message = String.new("Could not find gem '#{requirement_label}'#{extra_message} in #{source}#{cache_message}.\n")
|
290
|
+
|
291
|
+
if specs.any?
|
292
|
+
message << "\nThe source contains the following gems matching '#{matching_part}':\n"
|
293
|
+
message << specs.map {|s| " * #{s.full_name}" }.join("\n")
|
294
|
+
end
|
295
|
+
|
296
|
+
message
|
291
297
|
end
|
292
298
|
|
293
299
|
def version_conflict_message(e)
|
@@ -359,19 +365,16 @@ module Bundler
|
|
359
365
|
|
360
366
|
metadata_requirement = name.end_with?("\0")
|
361
367
|
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
o << ", which is required by "
|
367
|
-
o << "gem '#{SharedHelpers.pretty_dependency(conflict.requirement_trees.first[-2])}',"
|
368
|
+
extra_message = if conflict.requirement_trees.first.size > 1
|
369
|
+
", which is required by gem '#{SharedHelpers.pretty_dependency(conflict.requirement_trees.first[-2])}',"
|
370
|
+
else
|
371
|
+
""
|
368
372
|
end
|
369
|
-
o << " "
|
370
373
|
|
371
|
-
|
372
|
-
"is not available in #{relevant_source}"
|
374
|
+
if metadata_requirement
|
375
|
+
o << "#{SharedHelpers.pretty_dependency(conflict.requirement)}#{extra_message} is not available in #{relevant_source}"
|
373
376
|
else
|
374
|
-
|
377
|
+
o << gem_not_found_message(name, conflict.requirement, relevant_source, extra_message)
|
375
378
|
end
|
376
379
|
end
|
377
380
|
end,
|
data/lib/bundler/rubygems_ext.rb
CHANGED
@@ -12,25 +12,21 @@ module Bundler
|
|
12
12
|
EXT_LOCK = Monitor.new
|
13
13
|
end
|
14
14
|
|
15
|
-
def self.version
|
16
|
-
@version ||= Gem::Version.new(Gem::VERSION)
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.provides?(req_str)
|
20
|
-
Gem::Requirement.new(req_str).satisfied_by?(version)
|
21
|
-
end
|
22
|
-
|
23
15
|
def initialize
|
24
16
|
@replaced_methods = {}
|
25
17
|
backport_ext_builder_monitor
|
26
18
|
end
|
27
19
|
|
28
20
|
def version
|
29
|
-
|
21
|
+
@version ||= Gem.rubygems_version
|
30
22
|
end
|
31
23
|
|
32
24
|
def provides?(req_str)
|
33
|
-
|
25
|
+
Gem::Requirement.new(req_str).satisfied_by?(version)
|
26
|
+
end
|
27
|
+
|
28
|
+
def supports_bundler_trampolining?
|
29
|
+
provides?(">= 3.3.0.a")
|
34
30
|
end
|
35
31
|
|
36
32
|
def build_args
|
@@ -115,7 +111,7 @@ module Bundler
|
|
115
111
|
Bundler.ui.error "#{e.class}: #{e.message}"
|
116
112
|
Bundler.ui.trace e
|
117
113
|
raise
|
118
|
-
rescue
|
114
|
+
rescue ::Psych::SyntaxError => e
|
119
115
|
raise YamlSyntaxError.new(e, "Your RubyGems configuration, which is " \
|
120
116
|
"usually located in ~/.gemrc, contains invalid YAML syntax.")
|
121
117
|
end
|
@@ -142,19 +138,6 @@ module Bundler
|
|
142
138
|
end
|
143
139
|
end
|
144
140
|
|
145
|
-
def sources=(val)
|
146
|
-
# Gem.configuration creates a new Gem::ConfigFile, which by default will read ~/.gemrc
|
147
|
-
# If that file exists, its settings (including sources) will overwrite the values we
|
148
|
-
# are about to set here. In order to avoid that, we force memoizing the config file now.
|
149
|
-
configuration
|
150
|
-
|
151
|
-
Gem.sources = val
|
152
|
-
end
|
153
|
-
|
154
|
-
def sources
|
155
|
-
Gem.sources
|
156
|
-
end
|
157
|
-
|
158
141
|
def gem_dir
|
159
142
|
Gem.dir
|
160
143
|
end
|
@@ -232,18 +215,6 @@ module Bundler
|
|
232
215
|
EXT_LOCK
|
233
216
|
end
|
234
217
|
|
235
|
-
def with_build_args(args)
|
236
|
-
ext_lock.synchronize do
|
237
|
-
old_args = build_args
|
238
|
-
begin
|
239
|
-
self.build_args = args
|
240
|
-
yield
|
241
|
-
ensure
|
242
|
-
self.build_args = old_args
|
243
|
-
end
|
244
|
-
end
|
245
|
-
end
|
246
|
-
|
247
218
|
def spec_from_gem(path, policy = nil)
|
248
219
|
require "rubygems/security"
|
249
220
|
require_relative "psyched_yaml"
|
@@ -571,10 +542,6 @@ module Bundler
|
|
571
542
|
Gem::REPOSITORY_SUBDIRECTORIES
|
572
543
|
end
|
573
544
|
|
574
|
-
def install_with_build_args(args)
|
575
|
-
yield
|
576
|
-
end
|
577
|
-
|
578
545
|
def path_separator
|
579
546
|
Gem.path_separator
|
580
547
|
end
|
@@ -604,6 +571,10 @@ module Bundler
|
|
604
571
|
end
|
605
572
|
end
|
606
573
|
|
574
|
+
def find_bundler(version)
|
575
|
+
find_name("bundler").find {|s| s.version.to_s == version }
|
576
|
+
end
|
577
|
+
|
607
578
|
def find_name(name)
|
608
579
|
Gem::Specification.stubs_for(name).map(&:to_spec)
|
609
580
|
end
|
@@ -617,14 +588,6 @@ module Bundler
|
|
617
588
|
Gem::Specification.send(:default_stubs, "*.gemspec")
|
618
589
|
end
|
619
590
|
end
|
620
|
-
|
621
|
-
def use_gemdeps(gemfile)
|
622
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path(gemfile)
|
623
|
-
require_relative "gemdeps"
|
624
|
-
runtime = Bundler.setup
|
625
|
-
activated_spec_names = runtime.requested_specs.map(&:to_spec).sort_by(&:name)
|
626
|
-
[Gemdeps.new(runtime), activated_spec_names]
|
627
|
-
end
|
628
591
|
end
|
629
592
|
|
630
593
|
def self.rubygems
|
data/lib/bundler/runtime.rb
CHANGED
@@ -265,7 +265,7 @@ module Bundler
|
|
265
265
|
|
266
266
|
return if manuals.empty?
|
267
267
|
Bundler::SharedHelpers.set_env "MANPATH", manuals.concat(
|
268
|
-
ENV["MANPATH"].to_s.split(File::PATH_SEPARATOR)
|
268
|
+
ENV["MANPATH"] ? ENV["MANPATH"].to_s.split(File::PATH_SEPARATOR) : [""]
|
269
269
|
).uniq.join(File::PATH_SEPARATOR)
|
270
270
|
end
|
271
271
|
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
#
|
5
|
+
# This class handles installing and switching to the version of bundler needed
|
6
|
+
# by an application.
|
7
|
+
#
|
8
|
+
class SelfManager
|
9
|
+
def restart_with_locked_bundler_if_needed
|
10
|
+
return unless needs_switching? && installed?
|
11
|
+
|
12
|
+
restart_with_locked_bundler
|
13
|
+
end
|
14
|
+
|
15
|
+
def install_locked_bundler_and_restart_with_it_if_needed
|
16
|
+
return unless needs_switching?
|
17
|
+
|
18
|
+
Bundler.ui.info \
|
19
|
+
"Bundler #{current_version} is running, but your lockfile was generated with #{lockfile_version}. " \
|
20
|
+
"Installing Bundler #{lockfile_version} and restarting using that version."
|
21
|
+
|
22
|
+
install_and_restart_with_locked_bundler
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def install_and_restart_with_locked_bundler
|
28
|
+
bundler_dep = Gem::Dependency.new("bundler", lockfile_version)
|
29
|
+
|
30
|
+
Gem.install(bundler_dep)
|
31
|
+
rescue StandardError => e
|
32
|
+
Bundler.ui.trace e
|
33
|
+
Bundler.ui.warn "There was an error installing the locked bundler version (#{lockfile_version}), rerun with the `--verbose` flag for more details. Going on using bundler #{current_version}."
|
34
|
+
else
|
35
|
+
restart_with_locked_bundler
|
36
|
+
end
|
37
|
+
|
38
|
+
def restart_with_locked_bundler
|
39
|
+
configured_gem_home = ENV["GEM_HOME"]
|
40
|
+
configured_gem_path = ENV["GEM_PATH"]
|
41
|
+
|
42
|
+
Bundler.with_original_env do
|
43
|
+
Kernel.exec(
|
44
|
+
{ "GEM_HOME" => configured_gem_home, "GEM_PATH" => configured_gem_path, "BUNDLER_VERSION" => lockfile_version },
|
45
|
+
$PROGRAM_NAME, *ARGV
|
46
|
+
)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def needs_switching?
|
51
|
+
ENV["BUNDLER_VERSION"].nil? &&
|
52
|
+
Bundler.rubygems.supports_bundler_trampolining? &&
|
53
|
+
SharedHelpers.in_bundle? &&
|
54
|
+
lockfile_version &&
|
55
|
+
!lockfile_version.end_with?(".dev") &&
|
56
|
+
lockfile_version != current_version
|
57
|
+
end
|
58
|
+
|
59
|
+
def installed?
|
60
|
+
Bundler.configure
|
61
|
+
|
62
|
+
Bundler.rubygems.find_bundler(lockfile_version)
|
63
|
+
end
|
64
|
+
|
65
|
+
def current_version
|
66
|
+
@current_version ||= Bundler::VERSION
|
67
|
+
end
|
68
|
+
|
69
|
+
def lockfile_version
|
70
|
+
@lockfile_version ||= Bundler::LockfileParser.bundled_with
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -109,7 +109,7 @@ module Bundler
|
|
109
109
|
raise VirtualProtocolError.new
|
110
110
|
rescue Errno::ENOSPC
|
111
111
|
raise NoSpaceOnDeviceError.new(path, action)
|
112
|
-
rescue
|
112
|
+
rescue Errno::ENOTSUP
|
113
113
|
raise OperationNotSupportedError.new(path, action)
|
114
114
|
rescue Errno::EEXIST, Errno::ENOENT
|
115
115
|
raise
|
@@ -117,13 +117,6 @@ module Bundler
|
|
117
117
|
raise GenericSystemCallError.new(e, "There was an error accessing `#{path}`.")
|
118
118
|
end
|
119
119
|
|
120
|
-
def const_get_safely(constant_name, namespace)
|
121
|
-
const_in_namespace = namespace.constants.include?(constant_name.to_s) ||
|
122
|
-
namespace.constants.include?(constant_name.to_sym)
|
123
|
-
return nil unless const_in_namespace
|
124
|
-
namespace.const_get(constant_name)
|
125
|
-
end
|
126
|
-
|
127
120
|
def major_deprecation(major_version, message, print_caller_location: false)
|
128
121
|
if print_caller_location
|
129
122
|
caller_location = caller_locations(2, 2).first
|
@@ -246,7 +239,7 @@ module Bundler
|
|
246
239
|
current = File.expand_path(SharedHelpers.pwd).tap{|x| x.untaint if RUBY_VERSION < "2.7" }
|
247
240
|
|
248
241
|
until !File.directory?(current) || current == previous
|
249
|
-
if ENV["
|
242
|
+
if ENV["BUNDLER_SPEC_RUN"]
|
250
243
|
# avoid stepping above the tmp directory when testing
|
251
244
|
gemspec = if ENV["GEM_COMMAND"]
|
252
245
|
# for Ruby Core
|
@@ -320,12 +313,11 @@ module Bundler
|
|
320
313
|
end
|
321
314
|
|
322
315
|
def clean_load_path
|
323
|
-
bundler_lib = bundler_ruby_lib
|
324
|
-
|
325
316
|
loaded_gem_paths = Bundler.rubygems.loaded_gem_paths
|
326
317
|
|
327
318
|
$LOAD_PATH.reject! do |p|
|
328
|
-
|
319
|
+
resolved_path = resolve_path(p)
|
320
|
+
next if $LOADED_FEATURES.any? {|lf| lf.start_with?(resolved_path) }
|
329
321
|
loaded_gem_paths.delete(p)
|
330
322
|
end
|
331
323
|
$LOAD_PATH.uniq!
|
@@ -56,7 +56,6 @@ module Bundler
|
|
56
56
|
@ref = ref
|
57
57
|
@revision = revision
|
58
58
|
@git = git
|
59
|
-
raise GitNotInstalledError.new if allow? && !Bundler.git_present?
|
60
59
|
end
|
61
60
|
|
62
61
|
def revision
|
@@ -96,12 +95,12 @@ module Bundler
|
|
96
95
|
SharedHelpers.filesystem_access(path.dirname) do |p|
|
97
96
|
FileUtils.mkdir_p(p)
|
98
97
|
end
|
99
|
-
git_retry "clone",
|
98
|
+
git_retry "clone", "--bare", "--no-hardlinks", "--quiet", "--", configured_uri, path.to_s
|
100
99
|
return unless extra_ref
|
101
100
|
end
|
102
101
|
|
103
102
|
with_path do
|
104
|
-
git_retry(*["fetch", "--force", "--quiet", "--tags", configured_uri, "refs/heads/*:refs/heads/*", extra_ref].compact, :dir => path)
|
103
|
+
git_retry(*["fetch", "--force", "--quiet", "--tags", "--", configured_uri, "refs/heads/*:refs/heads/*", extra_ref].compact, :dir => path)
|
105
104
|
end
|
106
105
|
end
|
107
106
|
|
@@ -208,7 +207,11 @@ module Bundler
|
|
208
207
|
end
|
209
208
|
|
210
209
|
def allow?
|
211
|
-
@git ? @git.allow_git_ops? : true
|
210
|
+
allowed = @git ? @git.allow_git_ops? : true
|
211
|
+
|
212
|
+
raise GitNotInstalledError.new if allowed && !Bundler.git_present?
|
213
|
+
|
214
|
+
allowed
|
212
215
|
end
|
213
216
|
|
214
217
|
def with_path(&blk)
|
@@ -25,7 +25,7 @@ module Bundler
|
|
25
25
|
s.loaded_from = File.expand_path("..", __FILE__)
|
26
26
|
end
|
27
27
|
|
28
|
-
if local_spec = Bundler.rubygems.
|
28
|
+
if local_spec = Bundler.rubygems.find_bundler(VERSION)
|
29
29
|
idx << local_spec
|
30
30
|
end
|
31
31
|
|
@@ -98,26 +98,30 @@ module Bundler
|
|
98
98
|
out << " specs:\n"
|
99
99
|
end
|
100
100
|
|
101
|
-
def
|
101
|
+
def to_s
|
102
102
|
if remotes.empty?
|
103
103
|
"locally installed gems"
|
104
|
-
elsif @allow_remote
|
104
|
+
elsif @allow_remote && @allow_cached && @allow_local
|
105
|
+
"rubygems repository #{remote_names}, cached gems or installed locally"
|
106
|
+
elsif @allow_remote && @allow_local
|
105
107
|
"rubygems repository #{remote_names} or installed locally"
|
106
|
-
elsif @
|
107
|
-
"
|
108
|
+
elsif @allow_remote
|
109
|
+
"rubygems repository #{remote_names}"
|
110
|
+
elsif @allow_cached && @allow_local
|
111
|
+
"cached gems or installed locally"
|
108
112
|
else
|
109
113
|
"locally installed gems"
|
110
114
|
end
|
111
115
|
end
|
112
116
|
|
113
|
-
def
|
117
|
+
def identifier
|
114
118
|
if remotes.empty?
|
115
119
|
"locally installed gems"
|
116
120
|
else
|
117
|
-
"rubygems repository #{remote_names}
|
121
|
+
"rubygems repository #{remote_names}"
|
118
122
|
end
|
119
123
|
end
|
120
|
-
alias_method :name, :
|
124
|
+
alias_method :name, :identifier
|
121
125
|
|
122
126
|
def specs
|
123
127
|
@specs ||= begin
|
@@ -162,7 +166,7 @@ module Bundler
|
|
162
166
|
begin
|
163
167
|
s = Bundler.rubygems.spec_from_gem(path, Bundler.settings["trust-policy"])
|
164
168
|
spec.__swap__(s)
|
165
|
-
rescue
|
169
|
+
rescue Gem::Package::FormatError
|
166
170
|
Bundler.rm_rf(path)
|
167
171
|
raise
|
168
172
|
end
|
@@ -262,10 +266,6 @@ module Bundler
|
|
262
266
|
@remotes.unshift(uri) unless @remotes.include?(uri)
|
263
267
|
end
|
264
268
|
|
265
|
-
def equivalent_remotes?(other_remotes)
|
266
|
-
other_remotes.map(&method(:remove_auth)) == @remotes.map(&method(:remove_auth))
|
267
|
-
end
|
268
|
-
|
269
269
|
def spec_names
|
270
270
|
if @allow_remote && dependency_api_available?
|
271
271
|
remote_specs.spec_names
|
@@ -334,7 +334,11 @@ module Bundler
|
|
334
334
|
end
|
335
335
|
|
336
336
|
def credless_remotes
|
337
|
-
|
337
|
+
if Bundler.settings[:allow_deployment_source_credential_changes]
|
338
|
+
remotes.map(&method(:remove_auth))
|
339
|
+
else
|
340
|
+
remotes.map(&method(:suppress_configured_credentials))
|
341
|
+
end
|
338
342
|
end
|
339
343
|
|
340
344
|
def remotes_for_spec(spec)
|
data/lib/bundler/source.rb
CHANGED
data/lib/bundler/source_list.rb
CHANGED
@@ -98,7 +98,7 @@ module Bundler
|
|
98
98
|
end
|
99
99
|
|
100
100
|
def get(source)
|
101
|
-
source_list_for(source).find {|s|
|
101
|
+
source_list_for(source).find {|s| equivalent_source?(source, s) }
|
102
102
|
end
|
103
103
|
|
104
104
|
def lock_sources
|
@@ -106,14 +106,14 @@ module Bundler
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def lock_other_sources
|
109
|
-
(path_sources + git_sources + plugin_sources).sort_by(&:
|
109
|
+
(path_sources + git_sources + plugin_sources).sort_by(&:identifier)
|
110
110
|
end
|
111
111
|
|
112
112
|
def lock_rubygems_sources
|
113
113
|
if merged_gem_lockfile_sections?
|
114
114
|
[combine_rubygems_sources]
|
115
115
|
else
|
116
|
-
rubygems_sources.sort_by(&:
|
116
|
+
rubygems_sources.sort_by(&:identifier)
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
@@ -173,7 +173,7 @@ module Bundler
|
|
173
173
|
end
|
174
174
|
|
175
175
|
def different_sources?(lock_sources, replacement_sources)
|
176
|
-
!
|
176
|
+
!equivalent_sources?(lock_sources, replacement_sources)
|
177
177
|
end
|
178
178
|
|
179
179
|
def rubygems_aggregate_class
|
@@ -210,34 +210,12 @@ module Bundler
|
|
210
210
|
end
|
211
211
|
end
|
212
212
|
|
213
|
-
def equal_sources?(lock_sources, replacement_sources)
|
214
|
-
lock_sources.sort_by(&:to_s) == replacement_sources.sort_by(&:to_s)
|
215
|
-
end
|
216
|
-
|
217
|
-
def equal_source?(source, other_source)
|
218
|
-
return source.include?(other_source) if source.is_a?(Source::Rubygems) && other_source.is_a?(Source::Rubygems)
|
219
|
-
|
220
|
-
source == other_source
|
221
|
-
end
|
222
|
-
|
223
|
-
def equivalent_source?(source, other_source)
|
224
|
-
return false unless Bundler.settings[:allow_deployment_source_credential_changes] && source.is_a?(Source::Rubygems)
|
225
|
-
|
226
|
-
equivalent_rubygems_sources?([source], [other_source])
|
227
|
-
end
|
228
|
-
|
229
213
|
def equivalent_sources?(lock_sources, replacement_sources)
|
230
|
-
|
231
|
-
|
232
|
-
lock_rubygems_sources, lock_other_sources = lock_sources.partition {|s| s.is_a?(Source::Rubygems) }
|
233
|
-
replacement_rubygems_sources, replacement_other_sources = replacement_sources.partition {|s| s.is_a?(Source::Rubygems) }
|
234
|
-
|
235
|
-
equivalent_rubygems_sources?(lock_rubygems_sources, replacement_rubygems_sources) && equal_sources?(lock_other_sources, replacement_other_sources)
|
214
|
+
lock_sources.sort_by(&:identifier) == replacement_sources.sort_by(&:identifier)
|
236
215
|
end
|
237
216
|
|
238
|
-
def
|
239
|
-
|
240
|
-
lock_sources.all? {|s| s.equivalent_remotes?(actual_remotes) }
|
217
|
+
def equivalent_source?(source, other_source)
|
218
|
+
source == other_source
|
241
219
|
end
|
242
220
|
end
|
243
221
|
end
|
data/lib/bundler/spec_set.rb
CHANGED
@@ -73,7 +73,7 @@ m = Module.new do
|
|
73
73
|
|
74
74
|
requirement = bundler_gem_version.approximate_recommendation
|
75
75
|
|
76
|
-
return requirement unless Gem
|
76
|
+
return requirement unless Gem.rubygems_version < Gem::Version.new("2.7.0")
|
77
77
|
|
78
78
|
requirement += ".a" if bundler_gem_version.prerelease?
|
79
79
|
|
@@ -14,7 +14,10 @@ gem "rake-compiler"
|
|
14
14
|
|
15
15
|
gem "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>"
|
16
16
|
<%- end -%>
|
17
|
-
<%- if config[:
|
17
|
+
<%- if config[:linter] == "rubocop" -%>
|
18
18
|
|
19
|
-
gem "rubocop", "~> <%= config[:
|
19
|
+
gem "rubocop", "~> <%= config[:linter_version] %>"
|
20
|
+
<%- elsif config[:linter] == "standard" -%>
|
21
|
+
|
22
|
+
gem "standard", "~> <%= config[:linter_version] %>"
|
20
23
|
<%- end -%>
|
@@ -3,7 +3,16 @@
|
|
3
3
|
require "bundler/gem_tasks"
|
4
4
|
<% default_task_names = [config[:test_task]].compact -%>
|
5
5
|
<% case config[:test] -%>
|
6
|
-
<% when "minitest"
|
6
|
+
<% when "minitest" -%>
|
7
|
+
require "rake/testtask"
|
8
|
+
|
9
|
+
Rake::TestTask.new(:test) do |t|
|
10
|
+
t.libs << "test"
|
11
|
+
t.libs << "lib"
|
12
|
+
t.test_files = FileList["test/**/test_*.rb"]
|
13
|
+
end
|
14
|
+
|
15
|
+
<% when "test-unit" -%>
|
7
16
|
require "rake/testtask"
|
8
17
|
|
9
18
|
Rake::TestTask.new(:test) do |t|
|
@@ -18,12 +27,16 @@ require "rspec/core/rake_task"
|
|
18
27
|
RSpec::Core::RakeTask.new(:spec)
|
19
28
|
|
20
29
|
<% end -%>
|
21
|
-
<% if config[:
|
30
|
+
<% if config[:linter] == "rubocop" -%>
|
22
31
|
<% default_task_names << :rubocop -%>
|
23
32
|
require "rubocop/rake_task"
|
24
33
|
|
25
34
|
RuboCop::RakeTask.new
|
26
35
|
|
36
|
+
<% elsif config[:linter] == "standard" -%>
|
37
|
+
<% default_task_names << :standard -%>
|
38
|
+
require "standard/rake"
|
39
|
+
|
27
40
|
<% end -%>
|
28
41
|
<% if config[:ext] -%>
|
29
42
|
<% default_task_names.unshift(:clobber, :compile) -%>
|