bundler 2.2.27 → 2.2.31
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 +52 -1
- data/README.md +1 -1
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli/gem.rb +86 -8
- data/lib/bundler/cli/info.rb +11 -4
- data/lib/bundler/cli/issue.rb +4 -3
- data/lib/bundler/cli/remove.rb +1 -2
- data/lib/bundler/cli.rb +4 -1
- data/lib/bundler/compact_index_client.rb +2 -2
- data/lib/bundler/definition.rb +14 -9
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/errors.rb +18 -2
- data/lib/bundler/fetcher.rb +2 -1
- data/lib/bundler/friendly_errors.rb +5 -30
- data/lib/bundler/gem_helper.rb +6 -17
- data/lib/bundler/lockfile_parser.rb +1 -0
- 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 +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 +3 -3
- data/lib/bundler/man/bundle-config.1.ronn +2 -2
- 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 +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 +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 +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 +1 -1
- data/lib/bundler/rubygems_ext.rb +4 -0
- data/lib/bundler/rubygems_gem_installer.rb +20 -4
- data/lib/bundler/rubygems_integration.rb +26 -9
- data/lib/bundler/runtime.rb +2 -2
- data/lib/bundler/source/git/git_proxy.rb +5 -2
- data/lib/bundler/source/git.rb +22 -4
- data/lib/bundler/source/rubygems.rb +36 -72
- data/lib/bundler/spec_set.rb +1 -1
- data/lib/bundler/templates/newgem/Gemfile.tt +5 -2
- data/lib/bundler/templates/newgem/Rakefile.tt +5 -1
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +13 -13
- data/lib/bundler/templates/newgem/standard.yml.tt +4 -0
- data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +19 -21
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +57 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +39 -74
- data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/lib/bundler/vendor/molinillo/LICENSE +9 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +2 -2
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +453 -0
- data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/worker.rb +2 -2
- data/lib/bundler.rb +2 -1
- metadata +18 -7
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f37ed81265b4005a7aa68cf2ed66ccae92c7b53298d15f7881e88703666ffee5
|
4
|
+
data.tar.gz: 9f18b35034d82ae88c044595ea977e194cc815ce248e95ae7d5ae0cf0f66704b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 800285d9a12c9d99c01f3418128f4913a96e7e739f9f4fc054c58014eca019d39b9fc3a15455f685db3a0510a523a8c2defa8d0df888ca30a7603e04910bae5f
|
7
|
+
data.tar.gz: 2407199f530007e4cd4eac12b339438074d9ac327a4aef3b96b7fc62e33abaed79da79e5b0d7b2604b6f58857097026c926635a083c2e830cec1ab67f7c97ca0
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,54 @@
|
|
1
|
+
# 2.2.31 (November 8, 2021)
|
2
|
+
|
3
|
+
## Enhancements:
|
4
|
+
|
5
|
+
- Link to working `bundler-graph` plugin in `bundle viz` deprecation message [#5061](https://github.com/rubygems/rubygems/pull/5061)
|
6
|
+
- Memoize materialized specs when requiring `bundler/setup` [#5033](https://github.com/rubygems/rubygems/pull/5033)
|
7
|
+
- Allow custom LicenseRef [#5013](https://github.com/rubygems/rubygems/pull/5013)
|
8
|
+
- Better error when installing a lockfile with git sources and git is not installed [#5036](https://github.com/rubygems/rubygems/pull/5036)
|
9
|
+
- Only delete cached gem when it's corrupted [#5031](https://github.com/rubygems/rubygems/pull/5031)
|
10
|
+
- Support gemified `tsort` [#5032](https://github.com/rubygems/rubygems/pull/5032)
|
11
|
+
- Add standard option alongside rubocop to `bundle gem` [#4411](https://github.com/rubygems/rubygems/pull/4411)
|
12
|
+
|
13
|
+
## Bug fixes:
|
14
|
+
|
15
|
+
- Fix system man pages no longer working after bundler overrides `MANPATH` [#5039](https://github.com/rubygems/rubygems/pull/5039)
|
16
|
+
- Don't warn when a lockfile is locked to a dev version [#5018](https://github.com/rubygems/rubygems/pull/5018)
|
17
|
+
|
18
|
+
# 2.2.30 (October 26, 2021)
|
19
|
+
|
20
|
+
## Enhancements:
|
21
|
+
|
22
|
+
- Add a custom SHA1 digest implementation to no longer depend on the digest gem before we know which version to activate [#4989](https://github.com/rubygems/rubygems/pull/4989)
|
23
|
+
- Ensure vendored gems have licenses [#4998](https://github.com/rubygems/rubygems/pull/4998)
|
24
|
+
- Update broken link in Bundler::Fetcher::CertificateFailureError [#4987](https://github.com/rubygems/rubygems/pull/4987)
|
25
|
+
- Give better errors for some permission issues [#4965](https://github.com/rubygems/rubygems/pull/4965)
|
26
|
+
- Print better errors when `bundler/gem_tasks` fail [#4872](https://github.com/rubygems/rubygems/pull/4872)
|
27
|
+
- Fix `bundle install` to reinstall deleted gems [#4974](https://github.com/rubygems/rubygems/pull/4974)
|
28
|
+
- Unify issue template and ISSUES.md document [#4980](https://github.com/rubygems/rubygems/pull/4980)
|
29
|
+
- Bump vendored connection_pool to 2.2.5 [#4738](https://github.com/rubygems/rubygems/pull/4738)
|
30
|
+
|
31
|
+
## Bug fixes:
|
32
|
+
|
33
|
+
- Fix error message pointing to non existing file when using a global gem cache [#4999](https://github.com/rubygems/rubygems/pull/4999)
|
34
|
+
- Fix install crash when lockfile has missing dependencies for the current platform [#4941](https://github.com/rubygems/rubygems/pull/4941)
|
35
|
+
- Make `bundle info` show a proper warning every time it finds a deleted gem [#4971](https://github.com/rubygems/rubygems/pull/4971)
|
36
|
+
|
37
|
+
# 2.2.29 (October 8, 2021)
|
38
|
+
|
39
|
+
## Enhancements:
|
40
|
+
|
41
|
+
- Require at least Ruby 2.6.0 for gems created with recent rubies [#4920](https://github.com/rubygems/rubygems/pull/4920)
|
42
|
+
- Include glob information in string representation of git sources to make generated lockfiles deterministic [#4947](https://github.com/rubygems/rubygems/pull/4947)
|
43
|
+
- Add missing `rubygem_push` prerequisite [#4930](https://github.com/rubygems/rubygems/pull/4930)
|
44
|
+
|
45
|
+
# 2.2.28 (September 23, 2021)
|
46
|
+
|
47
|
+
## Enhancements:
|
48
|
+
|
49
|
+
- Use example.com in new gem template, since it will never have a potentially dangerous backing website [#4918](https://github.com/rubygems/rubygems/pull/4918)
|
50
|
+
- Deprecate `--install` flag to `bundle remove` and trigger install by default [#4891](https://github.com/rubygems/rubygems/pull/4891)
|
51
|
+
|
1
52
|
# 2.2.27 (September 3, 2021)
|
2
53
|
|
3
54
|
## Enhancements:
|
@@ -92,7 +143,7 @@
|
|
92
143
|
- Fix `bundle doctor` crashing when finding a broken symlink [#4707](https://github.com/rubygems/rubygems/pull/4707)
|
93
144
|
- Fix incorrect re-resolve edge case [#4700](https://github.com/rubygems/rubygems/pull/4700)
|
94
145
|
- Fix some gems being unintentionally locked under multiple lockfile sections [#4701](https://github.com/rubygems/rubygems/pull/4701)
|
95
|
-
- Fix `--conservative` flag unexpectedly updating indirect dependencies [#4692](https://github.com/rubygems/rubygems/pull/4692)
|
146
|
+
- Fix `--conservative` flag unexpectedly updating indirect dependencies. NOTE: As part of this bug fix, some undocumented, unintentional code causing `bundle update --source <gem>` to update conservatively was fixed. Use the documented `bundle update --conservative <gem>` instead [#4692](https://github.com/rubygems/rubygems/pull/4692)
|
96
147
|
|
97
148
|
# 2.2.21 (June 23, 2021)
|
98
149
|
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@ See [bundler.io](https://bundler.io) for the full documentation.
|
|
32
32
|
|
33
33
|
For help with common problems, see [TROUBLESHOOTING](doc/TROUBLESHOOTING.md).
|
34
34
|
|
35
|
-
Still stuck? Try [filing an issue](
|
35
|
+
Still stuck? Try [filing an issue](https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md).
|
36
36
|
|
37
37
|
### Other questions
|
38
38
|
|
@@ -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 = "2021-
|
8
|
-
@git_commit_sha = "
|
7
|
+
@built_at = "2021-11-08".freeze
|
8
|
+
@git_commit_sha = "2505ef8972".freeze
|
9
9
|
@release = true
|
10
10
|
# end ivars
|
11
11
|
|
data/lib/bundler/cli/gem.rb
CHANGED
@@ -68,7 +68,7 @@ module Bundler
|
|
68
68
|
:bundler_version => bundler_dependency_version,
|
69
69
|
:git => use_git,
|
70
70
|
:github_username => github_username.empty? ? "[USERNAME]" : github_username,
|
71
|
-
:required_ruby_version =>
|
71
|
+
:required_ruby_version => required_ruby_version,
|
72
72
|
}
|
73
73
|
ensure_safe_gem_name(name, constant_array)
|
74
74
|
|
@@ -163,15 +163,16 @@ module Bundler
|
|
163
163
|
templates.merge!("CHANGELOG.md.tt" => "CHANGELOG.md")
|
164
164
|
end
|
165
165
|
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
"and the Ruby Style Guides (https://github.com/rubocop-hq/ruby-style-guide).")
|
171
|
-
config[:rubocop] = true
|
172
|
-
config[:rubocop_version] = Gem.ruby_version < Gem::Version.new("2.4.a") ? "0.81.0" : "1.7"
|
166
|
+
config[:linter] = ask_and_set_linter
|
167
|
+
case config[:linter]
|
168
|
+
when "rubocop"
|
169
|
+
config[:linter_version] = rubocop_version
|
173
170
|
Bundler.ui.info "RuboCop enabled in config"
|
174
171
|
templates.merge!("rubocop.yml.tt" => ".rubocop.yml")
|
172
|
+
when "standard"
|
173
|
+
config[:linter_version] = standard_version
|
174
|
+
Bundler.ui.info "Standard enabled in config"
|
175
|
+
templates.merge!("standard.yml.tt" => ".standard.yml")
|
175
176
|
end
|
176
177
|
|
177
178
|
templates.merge!("exe/newgem.tt" => "exe/#{name}") if config[:exe]
|
@@ -317,6 +318,58 @@ module Bundler
|
|
317
318
|
ci_template
|
318
319
|
end
|
319
320
|
|
321
|
+
def ask_and_set_linter
|
322
|
+
linter_template = options[:linter] || Bundler.settings["gem.linter"]
|
323
|
+
linter_template = deprecated_rubocop_option if linter_template.nil?
|
324
|
+
|
325
|
+
if linter_template.to_s.empty?
|
326
|
+
Bundler.ui.confirm "Do you want to add a code linter and formatter to your gem? " \
|
327
|
+
"Supported Linters:\n" \
|
328
|
+
"* RuboCop: https://rubocop.org\n" \
|
329
|
+
"* Standard: https://github.com/testdouble/standard\n" \
|
330
|
+
"\n"
|
331
|
+
Bundler.ui.info hint_text("linter")
|
332
|
+
|
333
|
+
result = Bundler.ui.ask "Enter a linter. rubocop/standard/(none):"
|
334
|
+
if result =~ /rubocop|standard/
|
335
|
+
linter_template = result
|
336
|
+
else
|
337
|
+
linter_template = false
|
338
|
+
end
|
339
|
+
end
|
340
|
+
|
341
|
+
if Bundler.settings["gem.linter"].nil?
|
342
|
+
Bundler.settings.set_global("gem.linter", linter_template)
|
343
|
+
end
|
344
|
+
|
345
|
+
# Once gem.linter safely set, unset the deprecated gem.rubocop
|
346
|
+
unless Bundler.settings["gem.rubocop"].nil?
|
347
|
+
Bundler.settings.set_global("gem.rubocop", nil)
|
348
|
+
end
|
349
|
+
|
350
|
+
if options[:linter] == Bundler.settings["gem.linter"]
|
351
|
+
Bundler.ui.info "#{options[:linter]} is already configured, ignoring --linter flag."
|
352
|
+
end
|
353
|
+
|
354
|
+
linter_template
|
355
|
+
end
|
356
|
+
|
357
|
+
def deprecated_rubocop_option
|
358
|
+
if !options[:rubocop].nil?
|
359
|
+
if options[:rubocop]
|
360
|
+
Bundler::SharedHelpers.major_deprecation 2, "--rubocop is deprecated, use --linter=rubocop"
|
361
|
+
"rubocop"
|
362
|
+
else
|
363
|
+
Bundler::SharedHelpers.major_deprecation 2, "--no-rubocop is deprecated, use --linter"
|
364
|
+
false
|
365
|
+
end
|
366
|
+
elsif !Bundler.settings["gem.rubocop"].nil?
|
367
|
+
Bundler::SharedHelpers.major_deprecation 2,
|
368
|
+
"config gem.rubocop is deprecated; we've updated your config to use gem.linter instead"
|
369
|
+
Bundler.settings["gem.rubocop"] ? "rubocop" : false
|
370
|
+
end
|
371
|
+
end
|
372
|
+
|
320
373
|
def bundler_dependency_version
|
321
374
|
v = Gem::Version.new(Bundler::VERSION)
|
322
375
|
req = v.segments[0..1]
|
@@ -350,5 +403,30 @@ module Bundler
|
|
350
403
|
def open_editor(editor, file)
|
351
404
|
thor.run(%(#{editor} "#{file}"))
|
352
405
|
end
|
406
|
+
|
407
|
+
def required_ruby_version
|
408
|
+
if Gem.ruby_version < Gem::Version.new("2.4.a") then "2.3.0"
|
409
|
+
elsif Gem.ruby_version < Gem::Version.new("2.5.a") then "2.4.0"
|
410
|
+
elsif Gem.ruby_version < Gem::Version.new("2.6.a") then "2.5.0"
|
411
|
+
else
|
412
|
+
"2.6.0"
|
413
|
+
end
|
414
|
+
end
|
415
|
+
|
416
|
+
def rubocop_version
|
417
|
+
if Gem.ruby_version < Gem::Version.new("2.4.a") then "0.81.0"
|
418
|
+
elsif Gem.ruby_version < Gem::Version.new("2.5.a") then "1.12"
|
419
|
+
else
|
420
|
+
"1.21"
|
421
|
+
end
|
422
|
+
end
|
423
|
+
|
424
|
+
def standard_version
|
425
|
+
if Gem.ruby_version < Gem::Version.new("2.4.a") then "0.2.5"
|
426
|
+
elsif Gem.ruby_version < Gem::Version.new("2.5.a") then "1.0"
|
427
|
+
else
|
428
|
+
"1.3"
|
429
|
+
end
|
430
|
+
end
|
353
431
|
end
|
354
432
|
end
|
data/lib/bundler/cli/info.rb
CHANGED
@@ -40,12 +40,13 @@ module Bundler
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def print_gem_path(spec)
|
43
|
-
|
43
|
+
name = spec.name
|
44
|
+
if name == "bundler"
|
44
45
|
path = File.expand_path("../../../..", __FILE__)
|
45
46
|
else
|
46
47
|
path = spec.full_gem_path
|
47
|
-
|
48
|
-
return Bundler.ui.warn "The gem #{
|
48
|
+
if spec.deleted_gem?
|
49
|
+
return Bundler.ui.warn "The gem #{name} has been deleted. It was installed at: #{path}"
|
49
50
|
end
|
50
51
|
end
|
51
52
|
|
@@ -54,8 +55,9 @@ module Bundler
|
|
54
55
|
|
55
56
|
def print_gem_info(spec)
|
56
57
|
metadata = spec.metadata
|
58
|
+
name = spec.name
|
57
59
|
gem_info = String.new
|
58
|
-
gem_info << " * #{
|
60
|
+
gem_info << " * #{name} (#{spec.version}#{spec.git_version})\n"
|
59
61
|
gem_info << "\tSummary: #{spec.summary}\n" if spec.summary
|
60
62
|
gem_info << "\tHomepage: #{spec.homepage}\n" if spec.homepage
|
61
63
|
gem_info << "\tDocumentation: #{metadata["documentation_uri"]}\n" if metadata.key?("documentation_uri")
|
@@ -67,6 +69,11 @@ module Bundler
|
|
67
69
|
gem_info << "\tMailing List: #{metadata["mailing_list_uri"]}\n" if metadata.key?("mailing_list_uri")
|
68
70
|
gem_info << "\tPath: #{spec.full_gem_path}\n"
|
69
71
|
gem_info << "\tDefault Gem: yes" if spec.respond_to?(:default_gem?) && spec.default_gem?
|
72
|
+
|
73
|
+
if spec.deleted_gem?
|
74
|
+
return Bundler.ui.warn "The gem #{name} has been deleted. Gemspec information is still available though:\n#{gem_info}"
|
75
|
+
end
|
76
|
+
|
70
77
|
Bundler.ui.info gem_info
|
71
78
|
end
|
72
79
|
end
|
data/lib/bundler/cli/issue.rb
CHANGED
@@ -20,9 +20,10 @@ module Bundler
|
|
20
20
|
|
21
21
|
Hopefully the troubleshooting steps above resolved your problem! If things
|
22
22
|
still aren't working the way you expect them to, please let us know so
|
23
|
-
that we can diagnose and help fix the problem you're having
|
24
|
-
|
25
|
-
https://github.com/rubygems/rubygems/
|
23
|
+
that we can diagnose and help fix the problem you're having, by filling
|
24
|
+
in the new issue form located at
|
25
|
+
https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md,
|
26
|
+
and copy and pasting the information below.
|
26
27
|
|
27
28
|
EOS
|
28
29
|
|
data/lib/bundler/cli/remove.rb
CHANGED
@@ -11,8 +11,7 @@ module Bundler
|
|
11
11
|
raise InvalidOption, "Please specify gems to remove." if @gems.empty?
|
12
12
|
|
13
13
|
Injector.remove(@gems, {})
|
14
|
-
|
15
|
-
Installer.install(Bundler.root, Bundler.definition) if @options["install"]
|
14
|
+
Installer.install(Bundler.root, Bundler.definition)
|
16
15
|
end
|
17
16
|
end
|
18
17
|
end
|
data/lib/bundler/cli.rb
CHANGED
@@ -184,6 +184,7 @@ module Bundler
|
|
184
184
|
method_option "install", :type => :boolean, :banner =>
|
185
185
|
"Runs 'bundle install' after removing the gems from the Gemfile"
|
186
186
|
def remove(*gems)
|
187
|
+
SharedHelpers.major_deprecation(2, "The `--install` flag has been deprecated. `bundle install` is triggered by default.") if ARGV.include?("--install")
|
187
188
|
require_relative "cli/remove"
|
188
189
|
Remove.new(gems, options).run
|
189
190
|
end
|
@@ -551,7 +552,7 @@ module Bundler
|
|
551
552
|
method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version."
|
552
553
|
method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group."
|
553
554
|
def viz
|
554
|
-
SharedHelpers.major_deprecation 2, "The `viz` command has been moved to the `bundle-viz` gem, see https://github.com/
|
555
|
+
SharedHelpers.major_deprecation 2, "The `viz` command has been moved to the `bundle-viz` gem, see https://github.com/rubygems/bundler-graph"
|
555
556
|
require_relative "cli/viz"
|
556
557
|
Viz.new(options.dup).run
|
557
558
|
end
|
@@ -574,6 +575,8 @@ module Bundler
|
|
574
575
|
:desc => "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
|
575
576
|
method_option :ci, :type => :string, :lazy_default => Bundler.settings["gem.ci"] || "",
|
576
577
|
:desc => "Generate CI configuration, either GitHub Actions, Travis CI, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|travis|gitlab|circle)`"
|
578
|
+
method_option :linter, :type => :string, :lazy_default => Bundler.settings["gem.linter"] || "",
|
579
|
+
:desc => "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
|
577
580
|
method_option :github_username, :type => :string, :default => Bundler.settings["gem.github_username"], :banner => "Set your username on GitHub", :desc => "Fill in GitHub username on README so that you don't have to do it manually. Set a default with `bundle config set --global gem.github_username <your_username>`."
|
578
581
|
|
579
582
|
def gem(name)
|
@@ -5,7 +5,7 @@ require "set"
|
|
5
5
|
|
6
6
|
module Bundler
|
7
7
|
class CompactIndexClient
|
8
|
-
DEBUG_MUTEX = Mutex.new
|
8
|
+
DEBUG_MUTEX = Thread::Mutex.new
|
9
9
|
def self.debug
|
10
10
|
return unless ENV["DEBUG_COMPACT_INDEX"]
|
11
11
|
DEBUG_MUTEX.synchronize { warn("[#{self}] #{yield}") }
|
@@ -25,7 +25,7 @@ module Bundler
|
|
25
25
|
@endpoints = Set.new
|
26
26
|
@info_checksums_by_name = {}
|
27
27
|
@parsed_checksums = false
|
28
|
-
@mutex = Mutex.new
|
28
|
+
@mutex = Thread::Mutex.new
|
29
29
|
end
|
30
30
|
|
31
31
|
def execution_mode=(block)
|
data/lib/bundler/definition.rb
CHANGED
@@ -73,7 +73,6 @@ module Bundler
|
|
73
73
|
@lockfile_contents = String.new
|
74
74
|
@locked_bundler_version = nil
|
75
75
|
@locked_ruby_version = nil
|
76
|
-
@locked_specs_incomplete_for_platform = false
|
77
76
|
@new_platform = nil
|
78
77
|
|
79
78
|
if lockfile && File.exist?(lockfile)
|
@@ -139,6 +138,8 @@ module Bundler
|
|
139
138
|
@dependency_changes = converge_dependencies
|
140
139
|
@local_changes = converge_locals
|
141
140
|
|
141
|
+
@locked_specs_incomplete_for_platform = !@locked_specs.for(requested_dependencies & expand_dependencies(locked_dependencies), true, true)
|
142
|
+
|
142
143
|
@requires = compute_requires
|
143
144
|
end
|
144
145
|
|
@@ -228,17 +229,22 @@ module Bundler
|
|
228
229
|
end
|
229
230
|
end
|
230
231
|
|
232
|
+
def locked_dependencies
|
233
|
+
@locked_deps.values
|
234
|
+
end
|
235
|
+
|
231
236
|
def specs_for(groups)
|
232
|
-
|
237
|
+
return specs if groups.empty?
|
233
238
|
deps = dependencies_for(groups)
|
234
|
-
materialize(
|
239
|
+
materialize(deps)
|
235
240
|
end
|
236
241
|
|
237
242
|
def dependencies_for(groups)
|
238
243
|
groups.map!(&:to_sym)
|
239
|
-
current_dependencies.reject do |d|
|
244
|
+
deps = current_dependencies.reject do |d|
|
240
245
|
(d.groups & groups).empty?
|
241
246
|
end
|
247
|
+
expand_dependencies(deps)
|
242
248
|
end
|
243
249
|
|
244
250
|
# Resolve all the dependencies specified in Gemfile. It ensures that
|
@@ -367,8 +373,8 @@ module Bundler
|
|
367
373
|
new_sources = gemfile_sources - @locked_sources
|
368
374
|
deleted_sources = @locked_sources - gemfile_sources
|
369
375
|
|
370
|
-
new_deps = @dependencies -
|
371
|
-
deleted_deps =
|
376
|
+
new_deps = @dependencies - locked_dependencies
|
377
|
+
deleted_deps = locked_dependencies - @dependencies
|
372
378
|
|
373
379
|
# Check if it is possible that the source is only changed thing
|
374
380
|
if (new_deps.empty? && deleted_deps.empty?) && (!new_sources.empty? && !deleted_sources.empty?)
|
@@ -560,7 +566,7 @@ module Bundler
|
|
560
566
|
|
561
567
|
def dependencies_for_source_changed?(source, locked_source = source)
|
562
568
|
deps_for_source = @dependencies.select {|s| s.source == source }
|
563
|
-
locked_deps_for_source =
|
569
|
+
locked_deps_for_source = locked_dependencies.select {|dep| dep.source == locked_source }
|
564
570
|
|
565
571
|
deps_for_source.uniq.sort != locked_deps_for_source.sort
|
566
572
|
end
|
@@ -644,7 +650,7 @@ module Bundler
|
|
644
650
|
|
645
651
|
def converge_dependencies
|
646
652
|
frozen = Bundler.frozen_bundle?
|
647
|
-
(@dependencies +
|
653
|
+
(@dependencies + locked_dependencies).each do |dep|
|
648
654
|
locked_source = @locked_deps[dep.name]
|
649
655
|
# This is to make sure that if bundler is installing in deployment mode and
|
650
656
|
# after locked_source and sources don't match, we still use locked_source.
|
@@ -751,7 +757,6 @@ module Bundler
|
|
751
757
|
end
|
752
758
|
|
753
759
|
resolve = SpecSet.new(converged)
|
754
|
-
@locked_specs_incomplete_for_platform = !resolve.for(expand_dependencies(requested_dependencies & deps), true, true)
|
755
760
|
resolve = SpecSet.new(resolve.for(expand_dependencies(deps, true), false, false).reject{|s| @unlock[:gems].include?(s.name) })
|
756
761
|
diff = nil
|
757
762
|
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This code was extracted from https://github.com/Solistra/ruby-digest which is under public domain
|
4
|
+
module Bundler
|
5
|
+
module Digest
|
6
|
+
# The initial constant values for the 32-bit constant words A, B, C, D, and
|
7
|
+
# E, respectively.
|
8
|
+
SHA1_WORDS = [0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0].freeze
|
9
|
+
|
10
|
+
# The 8-bit field used for bitwise `AND` masking. Defaults to `0xFFFFFFFF`.
|
11
|
+
SHA1_MASK = 0xFFFFFFFF
|
12
|
+
|
13
|
+
class << self
|
14
|
+
def sha1(string)
|
15
|
+
unless string.is_a?(String)
|
16
|
+
raise TypeError, "can't convert #{string.class.inspect} into String"
|
17
|
+
end
|
18
|
+
|
19
|
+
buffer = string.b
|
20
|
+
|
21
|
+
words = SHA1_WORDS.dup
|
22
|
+
generate_split_buffer(buffer) do |chunk|
|
23
|
+
w = []
|
24
|
+
chunk.each_slice(4) do |a, b, c, d|
|
25
|
+
w << (((a << 8 | b) << 8 | c) << 8 | d)
|
26
|
+
end
|
27
|
+
a, b, c, d, e = *words
|
28
|
+
(16..79).each do |i|
|
29
|
+
w[i] = SHA1_MASK & rotate((w[i-3] ^ w[i-8] ^ w[i-14] ^ w[i-16]), 1)
|
30
|
+
end
|
31
|
+
0.upto(79) do |i|
|
32
|
+
case i
|
33
|
+
when 0..19
|
34
|
+
f = ((b & c) | (~b & d))
|
35
|
+
k = 0x5A827999
|
36
|
+
when 20..39
|
37
|
+
f = (b ^ c ^ d)
|
38
|
+
k = 0x6ED9EBA1
|
39
|
+
when 40..59
|
40
|
+
f = ((b & c) | (b & d) | (c & d))
|
41
|
+
k = 0x8F1BBCDC
|
42
|
+
when 60..79
|
43
|
+
f = (b ^ c ^ d)
|
44
|
+
k = 0xCA62C1D6
|
45
|
+
end
|
46
|
+
t = SHA1_MASK & (SHA1_MASK & rotate(a, 5) + f + e + k + w[i])
|
47
|
+
a, b, c, d, e = t, a, SHA1_MASK & rotate(b, 30), c, d # rubocop:disable Style/ParallelAssignment
|
48
|
+
end
|
49
|
+
mutated = [a, b, c, d, e]
|
50
|
+
words.map!.with_index {|word, index| SHA1_MASK & (word + mutated[index]) }
|
51
|
+
end
|
52
|
+
|
53
|
+
words.pack("N*").unpack("H*").first
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
def generate_split_buffer(string, &block)
|
59
|
+
size = string.bytesize * 8
|
60
|
+
buffer = string.bytes << 128
|
61
|
+
buffer << 0 while buffer.size % 64 != 56
|
62
|
+
buffer.concat([size].pack("Q>").bytes)
|
63
|
+
buffer.each_slice(64, &block)
|
64
|
+
end
|
65
|
+
|
66
|
+
def rotate(value, spaces)
|
67
|
+
value << spaces | value >> (32 - spaces)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
data/lib/bundler/errors.rb
CHANGED
@@ -75,10 +75,26 @@ module Bundler
|
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
+
def permission_type
|
79
|
+
case @permission_type
|
80
|
+
when :create
|
81
|
+
"executable permissions for all parent directories and write permissions for `#{parent_folder}`"
|
82
|
+
when :delete
|
83
|
+
permissions = "executable permissions for all parent directories and write permissions for `#{parent_folder}`"
|
84
|
+
permissions += ", and the same thing for all subdirectories inside #{@path}" if File.directory?(@path)
|
85
|
+
permissions
|
86
|
+
else
|
87
|
+
"#{@permission_type} permissions for that path"
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
def parent_folder
|
92
|
+
File.dirname(@path)
|
93
|
+
end
|
94
|
+
|
78
95
|
def message
|
79
96
|
"There was an error while trying to #{action} `#{@path}`. " \
|
80
|
-
"It is likely that you need to grant #{
|
81
|
-
"for that path."
|
97
|
+
"It is likely that you need to grant #{permission_type}."
|
82
98
|
end
|
83
99
|
|
84
100
|
status_code(23)
|
data/lib/bundler/fetcher.rb
CHANGED
@@ -28,7 +28,8 @@ module Bundler
|
|
28
28
|
" is a chance you are experiencing a man-in-the-middle attack, but" \
|
29
29
|
" most likely your system doesn't have the CA certificates needed" \
|
30
30
|
" for verification. For information about OpenSSL certificates, see" \
|
31
|
-
"
|
31
|
+
" https://railsapps.github.io/openssl-certificate-verify-failed.html." \
|
32
|
+
" To connect without using SSL, edit your Gemfile" \
|
32
33
|
" sources and change 'https' to 'http'."
|
33
34
|
end
|
34
35
|
end
|
@@ -63,34 +63,6 @@ module Bundler
|
|
63
63
|
def request_issue_report_for(e)
|
64
64
|
Bundler.ui.error <<-EOS.gsub(/^ {8}/, ""), nil, nil
|
65
65
|
--- ERROR REPORT TEMPLATE -------------------------------------------------------
|
66
|
-
# Error Report
|
67
|
-
|
68
|
-
## Questions
|
69
|
-
|
70
|
-
Please fill out answers to these questions, it'll help us figure out
|
71
|
-
why things are going wrong.
|
72
|
-
|
73
|
-
- **What did you do?**
|
74
|
-
|
75
|
-
I ran the command `#{$PROGRAM_NAME} #{ARGV.join(" ")}`
|
76
|
-
|
77
|
-
- **What did you expect to happen?**
|
78
|
-
|
79
|
-
I expected Bundler to...
|
80
|
-
|
81
|
-
- **What happened instead?**
|
82
|
-
|
83
|
-
Instead, what happened was...
|
84
|
-
|
85
|
-
- **Have you tried any solutions posted on similar issues in our issue tracker, stack overflow, or google?**
|
86
|
-
|
87
|
-
I tried...
|
88
|
-
|
89
|
-
- **Have you read our issues document, https://github.com/rubygems/rubygems/blob/master/bundler/doc/contributing/ISSUES.md?**
|
90
|
-
|
91
|
-
...
|
92
|
-
|
93
|
-
## Backtrace
|
94
66
|
|
95
67
|
```
|
96
68
|
#{e.class}: #{e.message}
|
@@ -109,8 +81,7 @@ module Bundler
|
|
109
81
|
First, try this link to see if there are any existing issue reports for this error:
|
110
82
|
#{issues_url(e)}
|
111
83
|
|
112
|
-
If there aren't any reports for this error yet, please
|
113
|
-
https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md
|
84
|
+
If there aren't any reports for this error yet, please fill in the new issue form located at #{new_issue_url}, and copy and paste the report template above in there.
|
114
85
|
EOS
|
115
86
|
end
|
116
87
|
|
@@ -121,6 +92,10 @@ module Bundler
|
|
121
92
|
"https://github.com/rubygems/rubygems/search?q=" \
|
122
93
|
"#{CGI.escape(message)}&type=Issues"
|
123
94
|
end
|
95
|
+
|
96
|
+
def new_issue_url
|
97
|
+
"https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md"
|
98
|
+
end
|
124
99
|
end
|
125
100
|
|
126
101
|
def self.with_friendly_errors
|
data/lib/bundler/gem_helper.rb
CHANGED
@@ -76,7 +76,7 @@ module Bundler
|
|
76
76
|
tag_version { git_push(args[:remote]) } unless already_tagged?
|
77
77
|
end
|
78
78
|
|
79
|
-
task "release:rubygem_push" do
|
79
|
+
task "release:rubygem_push" => "build" do
|
80
80
|
rubygem_push(built_gem_path) if gem_push?
|
81
81
|
end
|
82
82
|
|
@@ -98,10 +98,7 @@ module Bundler
|
|
98
98
|
built_gem_path ||= build_gem
|
99
99
|
cmd = [*gem_command, "install", built_gem_path.to_s]
|
100
100
|
cmd << "--local" if local
|
101
|
-
|
102
|
-
unless status.success?
|
103
|
-
raise "Couldn't install gem, run `gem install #{built_gem_path}' for more detailed output"
|
104
|
-
end
|
101
|
+
sh(cmd)
|
105
102
|
Bundler.ui.confirm "#{name} (#{version}) installed."
|
106
103
|
end
|
107
104
|
|
@@ -110,7 +107,7 @@ module Bundler
|
|
110
107
|
SharedHelpers.filesystem_access(File.join(base, "checksums")) {|p| FileUtils.mkdir_p(p) }
|
111
108
|
file_name = "#{File.basename(built_gem_path)}.sha512"
|
112
109
|
require "digest/sha2"
|
113
|
-
checksum = Digest::SHA512.new.hexdigest(built_gem_path.to_s)
|
110
|
+
checksum = ::Digest::SHA512.new.hexdigest(built_gem_path.to_s)
|
114
111
|
target = File.join(base, "checksums", file_name)
|
115
112
|
File.write(target, checksum)
|
116
113
|
Bundler.ui.confirm "#{name} #{version} checksum written to checksums/#{file_name}."
|
@@ -132,8 +129,8 @@ module Bundler
|
|
132
129
|
|
133
130
|
def git_push(remote = nil)
|
134
131
|
remote ||= default_remote
|
135
|
-
|
136
|
-
|
132
|
+
sh(%W[git push #{remote} refs/heads/#{current_branch}])
|
133
|
+
sh(%W[git push #{remote} refs/tags/#{version_tag}])
|
137
134
|
Bundler.ui.confirm "Pushed git commits and release tag."
|
138
135
|
end
|
139
136
|
|
@@ -161,13 +158,6 @@ module Bundler
|
|
161
158
|
allowed_push_host || env_rubygems_host || "rubygems.org"
|
162
159
|
end
|
163
160
|
|
164
|
-
def perform_git_push(options = "")
|
165
|
-
cmd = "git push #{options}"
|
166
|
-
out, status = sh_with_status(cmd.shellsplit)
|
167
|
-
return if status.success?
|
168
|
-
raise "Couldn't git push. `#{cmd}' failed with the following output:\n\n#{out}\n"
|
169
|
-
end
|
170
|
-
|
171
161
|
def already_tagged?
|
172
162
|
return false unless sh(%w[git tag]).split(/\n/).include?(version_tag)
|
173
163
|
Bundler.ui.confirm "Tag #{version_tag} has already been created."
|
@@ -218,8 +208,7 @@ module Bundler
|
|
218
208
|
def sh(cmd, &block)
|
219
209
|
out, status = sh_with_status(cmd, &block)
|
220
210
|
unless status.success?
|
221
|
-
|
222
|
-
raise(out.empty? ? "Running `#{cmd}` failed. Run this command directly for more detailed output." : out)
|
211
|
+
raise("Running `#{cmd.shelljoin}` failed with the following output:\n\n#{out}\n")
|
223
212
|
end
|
224
213
|
out
|
225
214
|
end
|
@@ -86,6 +86,7 @@ module Bundler
|
|
86
86
|
|
87
87
|
def warn_for_outdated_bundler_version
|
88
88
|
return unless bundler_version
|
89
|
+
return if bundler_version.segments.last == "dev"
|
89
90
|
prerelease_text = bundler_version.prerelease? ? " --pre" : ""
|
90
91
|
current_version = Gem::Version.create(Bundler::VERSION)
|
91
92
|
return unless current_version < bundler_version
|