bundler 2.2.28 → 2.2.32

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

Potentially problematic release.


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

Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +58 -1
  3. data/README.md +1 -1
  4. data/lib/bundler/build_metadata.rb +2 -2
  5. data/lib/bundler/cli/gem.rb +86 -8
  6. data/lib/bundler/cli/info.rb +11 -4
  7. data/lib/bundler/cli/issue.rb +4 -3
  8. data/lib/bundler/cli.rb +3 -1
  9. data/lib/bundler/compact_index_client.rb +2 -2
  10. data/lib/bundler/definition.rb +49 -78
  11. data/lib/bundler/digest.rb +71 -0
  12. data/lib/bundler/errors.rb +18 -2
  13. data/lib/bundler/fetcher.rb +2 -1
  14. data/lib/bundler/friendly_errors.rb +5 -30
  15. data/lib/bundler/gem_helper.rb +6 -17
  16. data/lib/bundler/lockfile_parser.rb +1 -0
  17. data/lib/bundler/man/bundle-add.1 +1 -1
  18. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  19. data/lib/bundler/man/bundle-cache.1 +1 -1
  20. data/lib/bundler/man/bundle-check.1 +1 -1
  21. data/lib/bundler/man/bundle-clean.1 +1 -1
  22. data/lib/bundler/man/bundle-config.1 +3 -3
  23. data/lib/bundler/man/bundle-config.1.ronn +2 -2
  24. data/lib/bundler/man/bundle-doctor.1 +1 -1
  25. data/lib/bundler/man/bundle-exec.1 +1 -1
  26. data/lib/bundler/man/bundle-gem.1 +14 -1
  27. data/lib/bundler/man/bundle-gem.1.ronn +16 -0
  28. data/lib/bundler/man/bundle-info.1 +1 -1
  29. data/lib/bundler/man/bundle-init.1 +1 -1
  30. data/lib/bundler/man/bundle-inject.1 +1 -1
  31. data/lib/bundler/man/bundle-install.1 +1 -1
  32. data/lib/bundler/man/bundle-list.1 +1 -1
  33. data/lib/bundler/man/bundle-lock.1 +1 -1
  34. data/lib/bundler/man/bundle-open.1 +1 -1
  35. data/lib/bundler/man/bundle-outdated.1 +1 -1
  36. data/lib/bundler/man/bundle-platform.1 +1 -1
  37. data/lib/bundler/man/bundle-pristine.1 +1 -1
  38. data/lib/bundler/man/bundle-remove.1 +1 -1
  39. data/lib/bundler/man/bundle-show.1 +1 -1
  40. data/lib/bundler/man/bundle-update.1 +1 -1
  41. data/lib/bundler/man/bundle-viz.1 +1 -1
  42. data/lib/bundler/man/bundle.1 +1 -1
  43. data/lib/bundler/man/gemfile.5 +1 -1
  44. data/lib/bundler/rubygems_ext.rb +4 -0
  45. data/lib/bundler/rubygems_gem_installer.rb +20 -4
  46. data/lib/bundler/rubygems_integration.rb +26 -9
  47. data/lib/bundler/runtime.rb +2 -2
  48. data/lib/bundler/source/git/git_proxy.rb +5 -2
  49. data/lib/bundler/source/git.rb +22 -4
  50. data/lib/bundler/source/rubygems.rb +36 -72
  51. data/lib/bundler/spec_set.rb +1 -1
  52. data/lib/bundler/templates/newgem/Gemfile.tt +5 -2
  53. data/lib/bundler/templates/newgem/Rakefile.tt +5 -1
  54. data/lib/bundler/templates/newgem/newgem.gemspec.tt +12 -12
  55. data/lib/bundler/templates/newgem/standard.yml.tt +2 -0
  56. data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
  57. data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +19 -21
  58. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  59. data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +57 -0
  60. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +39 -74
  61. data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
  62. data/lib/bundler/vendor/molinillo/LICENSE +9 -0
  63. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +2 -2
  64. data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
  65. data/lib/bundler/vendor/thor/LICENSE.md +20 -0
  66. data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
  67. data/lib/bundler/vendor/tsort/lib/tsort.rb +453 -0
  68. data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
  69. data/lib/bundler/vendored_tsort.rb +4 -0
  70. data/lib/bundler/version.rb +1 -1
  71. data/lib/bundler/worker.rb +2 -2
  72. data/lib/bundler.rb +2 -1
  73. metadata +18 -7
  74. data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
@@ -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 copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
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
@@ -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
- _, status = sh_with_status(cmd)
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
- perform_git_push "#{remote} refs/heads/#{current_branch}"
136
- perform_git_push "#{remote} refs/tags/#{version_tag}"
132
+ sh("git push #{remote} refs/heads/#{current_branch}".shellsplit)
133
+ sh("git push #{remote} refs/tags/#{version_tag}".shellsplit)
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
- cmd = cmd.shelljoin if cmd.respond_to?(:shelljoin)
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
@@ -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\-ADD" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-ADD" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
@@ -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" "June 2021" "" ""
4
+ .TH "BUNDLE\-BINSTUBS" "1" "November 2021" "" ""
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" "June 2021" "" ""
4
+ .TH "BUNDLE\-CACHE" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
@@ -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" "June 2021" "" ""
4
+ .TH "BUNDLE\-CHECK" "1" "November 2021" "" ""
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" "June 2021" "" ""
4
+ .TH "BUNDLE\-CLEAN" "1" "November 2021" "" ""
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" "June 2021" "" ""
4
+ .TH "BUNDLE\-CONFIG" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-config\fR \- Set bundler configuration options
@@ -462,13 +462,13 @@ export BUNDLE_GITHUB__COM=abcd0123generatedtoken:x\-oauth\-basic
462
462
  .IP "" 0
463
463
  .
464
464
  .P
465
- Note that any configured credentials will be redacted by informative commands such as \fBbundle config list\fR or \fBbundle config get\fR, unless you use the \fB\-\-parseable\fR flag\. This is to avoid unintentially leaking credentials when copy\-pasting bundler output\.
465
+ Note that any configured credentials will be redacted by informative commands such as \fBbundle config list\fR or \fBbundle config get\fR, unless you use the \fB\-\-parseable\fR flag\. This is to avoid unintentionally leaking credentials when copy\-pasting bundler output\.
466
466
  .
467
467
  .P
468
468
  Also note that to guarantee a sane mapping between valid environment variable names and valid host names, bundler makes the following transformations:
469
469
  .
470
470
  .IP "\(bu" 4
471
- Any \fB\-\fR characters in a host name are mapped to a triple dash (\fB___\fR) in the corresponding enviroment variable\.
471
+ Any \fB\-\fR characters in a host name are mapped to a triple dash (\fB___\fR) in the corresponding environment variable\.
472
472
  .
473
473
  .IP "\(bu" 4
474
474
  Any \fB\.\fR characters in a host name are mapped to a double dash (\fB__\fR) in the corresponding environment variable\.
@@ -367,14 +367,14 @@ where you can use personal OAuth tokens:
367
367
 
368
368
  Note that any configured credentials will be redacted by informative commands
369
369
  such as `bundle config list` or `bundle config get`, unless you use the
370
- `--parseable` flag. This is to avoid unintentially leaking credentials when
370
+ `--parseable` flag. This is to avoid unintentionally leaking credentials when
371
371
  copy-pasting bundler output.
372
372
 
373
373
  Also note that to guarantee a sane mapping between valid environment variable
374
374
  names and valid host names, bundler makes the following transformations:
375
375
 
376
376
  * Any `-` characters in a host name are mapped to a triple dash (`___`) in the
377
- corresponding enviroment variable.
377
+ corresponding environment variable.
378
378
 
379
379
  * Any `.` characters in a host name are mapped to a double dash (`__`) in the
380
380
  corresponding environment variable.
@@ -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\-DOCTOR" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-DOCTOR" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-doctor\fR \- Checks the bundle for common problems
@@ -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\-EXEC" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-EXEC" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-exec\fR \- Execute a command in the context of the bundle
@@ -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\-GEM" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-GEM" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
@@ -90,6 +90,19 @@ When Bundler is configured to not generate CI files, an interactive prompt will
90
90
  When Bundler is unconfigured, an interactive prompt will be displayed and the answer will be saved in Bundler\'s global config for future \fBbundle gem\fR use\.
91
91
  .
92
92
  .TP
93
+ \fB\-\-linter\fR, \fB\-\-linter=rubocop\fR, \fB\-\-linter=standard\fR
94
+ Specify the linter and code formatter that Bundler should add to the project\'s development dependencies\. Acceptable values are \fBrubocop\fR and \fBstandard\fR\. A configuration file will be generated in the project directory\. Given no option is specified:
95
+ .
96
+ .IP
97
+ When Bundler is configured to add a linter, this defaults to Bundler\'s global config setting \fBgem\.linter\fR\.
98
+ .
99
+ .IP
100
+ When Bundler is configured not to add a linter, an interactive prompt will be displayed and the answer will be used for the current rubygem project\.
101
+ .
102
+ .IP
103
+ When Bundler is unconfigured, an interactive prompt will be displayed and the answer will be saved in Bundler\'s global config for future \fBbundle gem\fR use\.
104
+ .
105
+ .TP
93
106
  \fB\-e\fR, \fB\-\-edit[=EDITOR]\fR
94
107
  Open the resulting GEM_NAME\.gemspec in EDITOR, or the default editor if not specified\. The default is \fB$BUNDLER_EDITOR\fR, \fB$VISUAL\fR, or \fB$EDITOR\fR\.
95
108
  .
@@ -92,6 +92,22 @@ configuration file using the following names:
92
92
  the answer will be saved in Bundler's global config for future `bundle gem`
93
93
  use.
94
94
 
95
+ * `--linter`, `--linter=rubocop`, `--linter=standard`:
96
+ Specify the linter and code formatter that Bundler should add to the
97
+ project's development dependencies. Acceptable values are `rubocop` and
98
+ `standard`. A configuration file will be generated in the project directory.
99
+ Given no option is specified:
100
+
101
+ When Bundler is configured to add a linter, this defaults to Bundler's
102
+ global config setting `gem.linter`.
103
+
104
+ When Bundler is configured not to add a linter, an interactive prompt
105
+ will be displayed and the answer will be used for the current rubygem project.
106
+
107
+ When Bundler is unconfigured, an interactive prompt will be displayed and
108
+ the answer will be saved in Bundler's global config for future `bundle gem`
109
+ use.
110
+
95
111
  * `-e`, `--edit[=EDITOR]`:
96
112
  Open the resulting GEM_NAME.gemspec in EDITOR, or the default editor if not
97
113
  specified. The default is `$BUNDLER_EDITOR`, `$VISUAL`, or `$EDITOR`.
@@ -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\-INFO" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-INFO" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-info\fR \- Show information for the given gem in your bundle
@@ -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\-INIT" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-INIT" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-init\fR \- Generates a Gemfile into the current working 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\-INJECT" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-INJECT" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
@@ -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\-INSTALL" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-INSTALL" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
@@ -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\-LIST" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-LIST" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-list\fR \- List all the gems in the bundle
@@ -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\-LOCK" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-LOCK" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
@@ -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\-OPEN" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-OPEN" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
@@ -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\-OUTDATED" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-OUTDATED" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-outdated\fR \- List installed gems with newer versions available
@@ -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\-PLATFORM" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-PLATFORM" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-platform\fR \- Displays platform compatibility information
@@ -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\-PRISTINE" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-PRISTINE" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
@@ -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\-REMOVE" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-REMOVE" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-remove\fR \- Removes gems from the Gemfile
@@ -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\-SHOW" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-SHOW" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
@@ -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\-UPDATE" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-UPDATE" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-update\fR \- Update your gems to the latest available versions
@@ -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\-VIZ" "1" "June 2021" "" ""
4
+ .TH "BUNDLE\-VIZ" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
@@ -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" "1" "June 2021" "" ""
4
+ .TH "BUNDLE" "1" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\fR \- Ruby Dependency Management
@@ -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 "GEMFILE" "5" "June 2021" "" ""
4
+ .TH "GEMFILE" "5" "November 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
@@ -85,6 +85,10 @@ module Gem
85
85
  dependencies - development_dependencies
86
86
  end
87
87
 
88
+ def deleted_gem?
89
+ !default_gem? && !File.directory?(full_gem_path)
90
+ end
91
+
88
92
  private
89
93
 
90
94
  def dependencies_to_gemfile(dependencies, group = nil)
@@ -16,10 +16,12 @@ module Bundler
16
16
  spec.loaded_from = spec_file
17
17
 
18
18
  # Completely remove any previous gem files
19
- FileUtils.rm_rf gem_dir
20
- FileUtils.rm_rf spec.extension_dir
19
+ strict_rm_rf gem_dir
20
+ strict_rm_rf spec.extension_dir
21
21
 
22
- FileUtils.mkdir_p gem_dir, :mode => 0o755
22
+ SharedHelpers.filesystem_access(gem_dir, :create) do
23
+ FileUtils.mkdir_p gem_dir, :mode => 0o755
24
+ end
23
25
 
24
26
  extract_files
25
27
 
@@ -31,7 +33,10 @@ module Bundler
31
33
  generate_plugins
32
34
 
33
35
  write_spec
34
- write_cache_file
36
+
37
+ SharedHelpers.filesystem_access("#{gem_home}/cache", :write) do
38
+ write_cache_file
39
+ end
35
40
 
36
41
  say spec.post_install_message unless spec.post_install_message.nil?
37
42
 
@@ -87,6 +92,17 @@ module Bundler
87
92
 
88
93
  private
89
94
 
95
+ def strict_rm_rf(dir)
96
+ # FileUtils.rm_rf should probably rise in case of permission issues like
97
+ # `rm -rf` does. However, it fails to delete the folder silently due to
98
+ # https://github.com/ruby/fileutils/issues/57. It should probably be fixed
99
+ # inside `fileutils` but for now I`m checking whether the folder was
100
+ # removed after it completes, and raising otherwise.
101
+ FileUtils.rm_rf dir
102
+
103
+ raise PermissionError.new(dir, :delete) if File.directory?(dir)
104
+ end
105
+
90
106
  def validate_bundler_checksum(checksum)
91
107
  return true if Bundler.settings[:disable_checksum_validation]
92
108
  return true unless checksum
@@ -86,16 +86,12 @@ module Bundler
86
86
  def spec_missing_extensions?(spec, default = true)
87
87
  return spec.missing_extensions? if spec.respond_to?(:missing_extensions?)
88
88
 
89
- return false if spec_default_gem?(spec)
89
+ return false if spec.default_gem?
90
90
  return false if spec.extensions.empty?
91
91
 
92
92
  default
93
93
  end
94
94
 
95
- def spec_default_gem?(spec)
96
- spec.respond_to?(:default_gem?) && spec.default_gem?
97
- end
98
-
99
95
  def spec_matches_for_glob(spec, glob)
100
96
  return spec.matches_for_glob(glob) if spec.respond_to?(:matches_for_glob)
101
97
 
@@ -504,14 +500,15 @@ module Bundler
504
500
  end
505
501
 
506
502
  def fetch_specs(remote, name)
503
+ require "rubygems/remote_fetcher"
507
504
  path = remote.uri.to_s + "#{name}.#{Gem.marshal_version}.gz"
508
505
  fetcher = gem_remote_fetcher
509
506
  fetcher.headers = { "X-Gemfile-Source" => remote.original_uri.to_s } if remote.original_uri
510
507
  string = fetcher.fetch_path(path)
511
508
  Bundler.load_marshal(string)
512
- rescue Gem::RemoteFetcher::FetchError => e
509
+ rescue Gem::RemoteFetcher::FetchError
513
510
  # it's okay for prerelease to fail
514
- raise e unless name == "prerelease_specs"
511
+ raise unless name == "prerelease_specs"
515
512
  end
516
513
 
517
514
  def fetch_all_remote_specs(remote)
@@ -521,12 +518,32 @@ module Bundler
521
518
  specs.concat(pres)
522
519
  end
523
520
 
524
- def download_gem(spec, uri, path)
521
+ def download_gem(spec, uri, cache_dir)
522
+ require "rubygems/remote_fetcher"
525
523
  uri = Bundler.settings.mirror_for(uri)
526
524
  fetcher = gem_remote_fetcher
527
525
  fetcher.headers = { "X-Gemfile-Source" => spec.remote.original_uri.to_s } if spec.remote.original_uri
528
526
  Bundler::Retry.new("download gem from #{uri}").attempts do
529
- fetcher.download(spec, uri, path)
527
+ gem_file_name = spec.file_name
528
+ local_gem_path = File.join cache_dir, gem_file_name
529
+ return if File.exist? local_gem_path
530
+
531
+ begin
532
+ remote_gem_path = uri + "gems/#{gem_file_name}"
533
+ remote_gem_path = remote_gem_path.to_s if provides?("< 3.2.0.rc.1")
534
+
535
+ SharedHelpers.filesystem_access(local_gem_path) do
536
+ fetcher.cache_update_path remote_gem_path, local_gem_path
537
+ end
538
+ rescue Gem::RemoteFetcher::FetchError
539
+ raise if spec.original_platform == spec.platform
540
+
541
+ original_gem_file_name = "#{spec.original_name}.gem"
542
+ raise if gem_file_name == original_gem_file_name
543
+
544
+ gem_file_name = original_gem_file_name
545
+ retry
546
+ end
530
547
  end
531
548
  rescue Gem::RemoteFetcher::FetchError => e
532
549
  raise Bundler::HTTPError, "Could not download gem from #{uri} due to underlying error <#{e.message}>"
@@ -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
 
@@ -291,7 +291,7 @@ module Bundler
291
291
  return unless activated_spec = Bundler.rubygems.loaded_specs(spec.name)
292
292
  return if activated_spec.version == spec.version
293
293
 
294
- suggestion = if Bundler.rubygems.spec_default_gem?(activated_spec)
294
+ suggestion = if activated_spec.default_gem?
295
295
  "Since #{spec.name} is a default gem, you can either remove your dependency on it" \
296
296
  " or try updating to a newer version of bundler that supports #{spec.name} as a default gem."
297
297
  else
@@ -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
@@ -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)