bundler 2.2.24 → 2.2.33

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +149 -1
  3. data/README.md +1 -1
  4. data/lib/bundler/build_metadata.rb +2 -2
  5. data/lib/bundler/cli/cache.rb +1 -1
  6. data/lib/bundler/cli/doctor.rb +4 -3
  7. data/lib/bundler/cli/exec.rb +1 -6
  8. data/lib/bundler/cli/gem.rb +90 -10
  9. data/lib/bundler/cli/info.rb +16 -4
  10. data/lib/bundler/cli/install.rb +4 -17
  11. data/lib/bundler/cli/issue.rb +4 -3
  12. data/lib/bundler/cli/list.rb +7 -1
  13. data/lib/bundler/cli/open.rb +1 -2
  14. data/lib/bundler/cli/remove.rb +1 -2
  15. data/lib/bundler/cli/update.rb +3 -3
  16. data/lib/bundler/cli.rb +16 -10
  17. data/lib/bundler/compact_index_client/updater.rb +0 -5
  18. data/lib/bundler/compact_index_client.rb +2 -2
  19. data/lib/bundler/definition.rb +84 -150
  20. data/lib/bundler/digest.rb +71 -0
  21. data/lib/bundler/dsl.rb +32 -4
  22. data/lib/bundler/environment_preserver.rb +4 -1
  23. data/lib/bundler/errors.rb +19 -3
  24. data/lib/bundler/fetcher.rb +2 -1
  25. data/lib/bundler/friendly_errors.rb +5 -30
  26. data/lib/bundler/gem_helper.rb +6 -17
  27. data/lib/bundler/installer/gem_installer.rb +3 -16
  28. data/lib/bundler/installer/standalone.rb +13 -8
  29. data/lib/bundler/installer.rb +0 -1
  30. data/lib/bundler/lazy_specification.rb +17 -1
  31. data/lib/bundler/lockfile_parser.rb +2 -0
  32. data/lib/bundler/man/bundle-add.1 +1 -1
  33. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  34. data/lib/bundler/man/bundle-cache.1 +1 -1
  35. data/lib/bundler/man/bundle-check.1 +1 -1
  36. data/lib/bundler/man/bundle-clean.1 +1 -1
  37. data/lib/bundler/man/bundle-config.1 +3 -3
  38. data/lib/bundler/man/bundle-config.1.ronn +2 -2
  39. data/lib/bundler/man/bundle-doctor.1 +1 -1
  40. data/lib/bundler/man/bundle-exec.1 +1 -1
  41. data/lib/bundler/man/bundle-gem.1 +14 -1
  42. data/lib/bundler/man/bundle-gem.1.ronn +16 -0
  43. data/lib/bundler/man/bundle-info.1 +1 -1
  44. data/lib/bundler/man/bundle-init.1 +1 -1
  45. data/lib/bundler/man/bundle-inject.1 +1 -1
  46. data/lib/bundler/man/bundle-install.1 +1 -1
  47. data/lib/bundler/man/bundle-list.1 +1 -1
  48. data/lib/bundler/man/bundle-lock.1 +1 -1
  49. data/lib/bundler/man/bundle-open.1 +1 -1
  50. data/lib/bundler/man/bundle-outdated.1 +1 -1
  51. data/lib/bundler/man/bundle-platform.1 +1 -1
  52. data/lib/bundler/man/bundle-pristine.1 +1 -1
  53. data/lib/bundler/man/bundle-remove.1 +1 -1
  54. data/lib/bundler/man/bundle-show.1 +1 -1
  55. data/lib/bundler/man/bundle-update.1 +1 -1
  56. data/lib/bundler/man/bundle-viz.1 +1 -1
  57. data/lib/bundler/man/bundle.1 +1 -1
  58. data/lib/bundler/man/gemfile.5 +27 -1
  59. data/lib/bundler/man/gemfile.5.ronn +8 -0
  60. data/lib/bundler/plugin/api/source.rb +1 -0
  61. data/lib/bundler/plugin/installer.rb +2 -0
  62. data/lib/bundler/plugin.rb +23 -6
  63. data/lib/bundler/resolver.rb +8 -17
  64. data/lib/bundler/rubygems_ext.rb +4 -0
  65. data/lib/bundler/rubygems_gem_installer.rb +25 -5
  66. data/lib/bundler/rubygems_integration.rb +28 -9
  67. data/lib/bundler/runtime.rb +17 -8
  68. data/lib/bundler/settings.rb +13 -1
  69. data/lib/bundler/setup.rb +2 -2
  70. data/lib/bundler/shared_helpers.rb +2 -10
  71. data/lib/bundler/source/git/git_proxy.rb +8 -6
  72. data/lib/bundler/source/git.rb +22 -4
  73. data/lib/bundler/source/rubygems.rb +70 -81
  74. data/lib/bundler/source/rubygems_aggregate.rb +4 -0
  75. data/lib/bundler/source.rb +4 -0
  76. data/lib/bundler/source_list.rb +22 -31
  77. data/lib/bundler/spec_set.rb +14 -36
  78. data/lib/bundler/templates/Executable.bundler +6 -6
  79. data/lib/bundler/templates/newgem/Gemfile.tt +5 -2
  80. data/lib/bundler/templates/newgem/Rakefile.tt +5 -1
  81. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +13 -2
  82. data/lib/bundler/templates/newgem/newgem.gemspec.tt +16 -14
  83. data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
  84. data/lib/bundler/templates/newgem/standard.yml.tt +2 -0
  85. data/lib/bundler/vendor/.document +1 -0
  86. data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
  87. data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +19 -21
  88. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  89. data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +57 -0
  90. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +39 -74
  91. data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
  92. data/lib/bundler/vendor/molinillo/LICENSE +9 -0
  93. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +2 -2
  94. data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
  95. data/lib/bundler/vendor/thor/LICENSE.md +20 -0
  96. data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
  97. data/lib/bundler/vendor/tsort/lib/tsort.rb +453 -0
  98. data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
  99. data/lib/bundler/vendored_tsort.rb +4 -0
  100. data/lib/bundler/version.rb +1 -1
  101. data/lib/bundler/worker.rb +19 -4
  102. data/lib/bundler.rb +13 -22
  103. metadata +20 -7
  104. 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: 2bc6a3aafe599f19f103462212788c65ebd7558c7c0ba8208730b58f06a07d2a
4
- data.tar.gz: 36328d242818c34ef2a7477ea918941cbbd9469d3e747eed35eacbc178709a65
3
+ metadata.gz: 889ebea9ec62ae3ec9d4c7cfc9e5d99db2e48244890b93c3c1e5e6636cbbaae3
4
+ data.tar.gz: 28c8ff7149d6182d8cea46d9576d74e8a41115ef5243f253c6c7d023c23f28a4
5
5
  SHA512:
6
- metadata.gz: 1bbd69e10ba06b85eba9d4d282c0ca7337b2d97c614418dfa036883ae9cf0ff34eb50ecfb025a7555abf65026d64359b061ade7fdb76a57558d3f9b025ffff8e
7
- data.tar.gz: affea641347f4d123b2d24b39ea6b2eb0f0a97fb8377b9d3a52812dab08faa7c0a134f41a33cf785fc498ba3cf32162f5d213a33f825d24bcdd053ed90332b20
6
+ metadata.gz: 1d949abc82fbe2f91e1ffebacb9dcb6f3366b4f0650ce96bfedd671965622e75d1a9cf2f6be762e8b7aa05a86eea2085f7834c2f23457c29b851eece9df81f78
7
+ data.tar.gz: f997fd1c1bfef3b9164cfefe9a4c5f092c870967dfc0352f5ac4b01a16bb2bb9c974511fb6b5126563672b736dc020f450a7b3ebfb0156757d26f41c3a2651de
data/CHANGELOG.md CHANGED
@@ -1,3 +1,151 @@
1
+ # 2.2.33 (December 7, 2021)
2
+
3
+ ## Security fixes:
4
+
5
+ - Pass "--" to git commands to separate positional and optional args [#5142](https://github.com/rubygems/rubygems/pull/5142)
6
+
7
+ ## Enhancements:
8
+
9
+ - Accept pull request URLs as github source [#5126](https://github.com/rubygems/rubygems/pull/5126)
10
+ - Add `--version` parameter to `bundle info` command [#5137](https://github.com/rubygems/rubygems/pull/5137)
11
+ - Let original `Errno::EACCES` error be raised in compact index updater [#5110](https://github.com/rubygems/rubygems/pull/5110)
12
+ - Improve gemfile-lockfile source equivalence errors [#5120](https://github.com/rubygems/rubygems/pull/5120)
13
+ - Avoid float-to-string loss of characters in GitHub Actions configuration labels in new gem template [#5089](https://github.com/rubygems/rubygems/pull/5089)
14
+ - Add an initial rbs template to `bundle gem` skeleton [#5041](https://github.com/rubygems/rubygems/pull/5041)
15
+ - Avoid shared libraries not getting environment passed right after argv in memory when `bundle exec` is used [#4815](https://github.com/rubygems/rubygems/pull/4815)
16
+
17
+ ## Bug fixes:
18
+
19
+ - Don't cleanup paths from gems already activated from `$LOAD_PATH` [#5111](https://github.com/rubygems/rubygems/pull/5111)
20
+ - Fix handling prereleases of 0 versions, like 0.0.0.dev or 0.0.0.SNAPSHOT [#5116](https://github.com/rubygems/rubygems/pull/5116)
21
+ - Fix escape of filenames in `bundle doctor` [#5102](https://github.com/rubygems/rubygems/pull/5102)
22
+ - Don't unlock dependencies when running `bundle install` after changing global source [#5090](https://github.com/rubygems/rubygems/pull/5090)
23
+ - Fix missing locked specs when depended on another platform [#5092](https://github.com/rubygems/rubygems/pull/5092)
24
+ - Fix `bundle info` sometimes claiming that bundler has been deleted [#5097](https://github.com/rubygems/rubygems/pull/5097)
25
+
26
+ ## Documentation:
27
+
28
+ - Ignore to generate the documentation from vendored libraries [#5118](https://github.com/rubygems/rubygems/pull/5118)
29
+
30
+ # 2.2.32 (November 23, 2021)
31
+
32
+ ## Enhancements:
33
+
34
+ - Clarify `bundle viz` deprecation [#5083](https://github.com/rubygems/rubygems/pull/5083)
35
+ - Unlock dependencies that no longer match lockfile [#5068](https://github.com/rubygems/rubygems/pull/5068)
36
+ - Use `shellsplit` instead of array of strings for git push [#5062](https://github.com/rubygems/rubygems/pull/5062)
37
+ - Re-enable `default_ignores` option for standard [#5003](https://github.com/rubygems/rubygems/pull/5003)
38
+
39
+ ## Bug fixes:
40
+
41
+ - Fix downgrading dependencies by changing the `Gemfile` and running `bundle update` [#5078](https://github.com/rubygems/rubygems/pull/5078)
42
+
43
+ # 2.2.31 (November 8, 2021)
44
+
45
+ ## Enhancements:
46
+
47
+ - Link to working `bundler-graph` plugin in `bundle viz` deprecation message [#5061](https://github.com/rubygems/rubygems/pull/5061)
48
+ - Memoize materialized specs when requiring `bundler/setup` [#5033](https://github.com/rubygems/rubygems/pull/5033)
49
+ - Allow custom LicenseRef [#5013](https://github.com/rubygems/rubygems/pull/5013)
50
+ - Better error when installing a lockfile with git sources and git is not installed [#5036](https://github.com/rubygems/rubygems/pull/5036)
51
+ - Only delete cached gem when it's corrupted [#5031](https://github.com/rubygems/rubygems/pull/5031)
52
+ - Support gemified `tsort` [#5032](https://github.com/rubygems/rubygems/pull/5032)
53
+ - Add standard option alongside rubocop to `bundle gem` [#4411](https://github.com/rubygems/rubygems/pull/4411)
54
+
55
+ ## Bug fixes:
56
+
57
+ - Fix system man pages no longer working after bundler overrides `MANPATH` [#5039](https://github.com/rubygems/rubygems/pull/5039)
58
+ - Don't warn when a lockfile is locked to a dev version [#5018](https://github.com/rubygems/rubygems/pull/5018)
59
+
60
+ # 2.2.30 (October 26, 2021)
61
+
62
+ ## Enhancements:
63
+
64
+ - 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)
65
+ - Ensure vendored gems have licenses [#4998](https://github.com/rubygems/rubygems/pull/4998)
66
+ - Update broken link in Bundler::Fetcher::CertificateFailureError [#4987](https://github.com/rubygems/rubygems/pull/4987)
67
+ - Give better errors for some permission issues [#4965](https://github.com/rubygems/rubygems/pull/4965)
68
+ - Print better errors when `bundler/gem_tasks` fail [#4872](https://github.com/rubygems/rubygems/pull/4872)
69
+ - Fix `bundle install` to reinstall deleted gems [#4974](https://github.com/rubygems/rubygems/pull/4974)
70
+ - Unify issue template and ISSUES.md document [#4980](https://github.com/rubygems/rubygems/pull/4980)
71
+ - Bump vendored connection_pool to 2.2.5 [#4738](https://github.com/rubygems/rubygems/pull/4738)
72
+
73
+ ## Bug fixes:
74
+
75
+ - Fix error message pointing to non existing file when using a global gem cache [#4999](https://github.com/rubygems/rubygems/pull/4999)
76
+ - Fix install crash when lockfile has missing dependencies for the current platform [#4941](https://github.com/rubygems/rubygems/pull/4941)
77
+ - Make `bundle info` show a proper warning every time it finds a deleted gem [#4971](https://github.com/rubygems/rubygems/pull/4971)
78
+
79
+ # 2.2.29 (October 8, 2021)
80
+
81
+ ## Enhancements:
82
+
83
+ - Require at least Ruby 2.6.0 for gems created with recent rubies [#4920](https://github.com/rubygems/rubygems/pull/4920)
84
+ - Include glob information in string representation of git sources to make generated lockfiles deterministic [#4947](https://github.com/rubygems/rubygems/pull/4947)
85
+ - Add missing `rubygem_push` prerequisite [#4930](https://github.com/rubygems/rubygems/pull/4930)
86
+
87
+ # 2.2.28 (September 23, 2021)
88
+
89
+ ## Enhancements:
90
+
91
+ - 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)
92
+ - Deprecate `--install` flag to `bundle remove` and trigger install by default [#4891](https://github.com/rubygems/rubygems/pull/4891)
93
+
94
+ # 2.2.27 (September 3, 2021)
95
+
96
+ ## Enhancements:
97
+
98
+ - Optimize some requires [#4887](https://github.com/rubygems/rubygems/pull/4887)
99
+ - Correctly redact credentials when using x-oauth-basic [#4866](https://github.com/rubygems/rubygems/pull/4866)
100
+
101
+ ## Bug fixes:
102
+
103
+ - Add missing key `branches:` to template for GitHub Actions [#4883](https://github.com/rubygems/rubygems/pull/4883)
104
+ - Fix `bundle plugin install` detection of already installed plugins [#4869](https://github.com/rubygems/rubygems/pull/4869)
105
+ - Make plugin installation idempotent [#4864](https://github.com/rubygems/rubygems/pull/4864)
106
+ - Fix `bundle check` showing duplicated gems when multiple platforms are locked [#4854](https://github.com/rubygems/rubygems/pull/4854)
107
+ - Fix `bundle check` incorrectly considering cached gems [#4853](https://github.com/rubygems/rubygems/pull/4853)
108
+
109
+ # 2.2.26 (August 17, 2021)
110
+
111
+ ## Enhancements:
112
+
113
+ - Remove `RUBYGEMS_GEMDEPS` warning [#4827](https://github.com/rubygems/rubygems/pull/4827)
114
+ - Better defaults for GitHub Actions template generated by `bundle gem` [#4619](https://github.com/rubygems/rubygems/pull/4619)
115
+ - Make `bundle exec` keep file descriptors by default [#4812](https://github.com/rubygems/rubygems/pull/4812)
116
+ - Exclude gemspec file itself from file list of gems generated by `bundle gem` [#4650](https://github.com/rubygems/rubygems/pull/4650)
117
+ - Fix a couple small typos in deprecation / error messages [#4806](https://github.com/rubygems/rubygems/pull/4806)
118
+ - Make script generated by `bundle install --standalone` resilient to moving the application to a differently nested folder when `path` sources are used [#4792](https://github.com/rubygems/rubygems/pull/4792)
119
+ - Exclude CI files and issue templates from file list of gems generated by `bundle gem` [#4033](https://github.com/rubygems/rubygems/pull/4033)
120
+
121
+ ## Bug fixes:
122
+
123
+ - Respect `BUNDLE_USER_HOME` env when choosing config location [#4828](https://github.com/rubygems/rubygems/pull/4828)
124
+ - Fix `bundle gem` on path with spaces [#4816](https://github.com/rubygems/rubygems/pull/4816)
125
+ - Fix bundler hitting the network in some cases where not allowed [#4805](https://github.com/rubygems/rubygems/pull/4805)
126
+
127
+ # 2.2.25 (July 30, 2021)
128
+
129
+ ## Deprecations:
130
+
131
+ - Deprecate Gemfile without an explicit global source [#4779](https://github.com/rubygems/rubygems/pull/4779)
132
+ - Deprecate `bundle cache --path` [#4496](https://github.com/rubygems/rubygems/pull/4496)
133
+
134
+ ## Enhancements:
135
+
136
+ - Give better errors when materialization fails [#4788](https://github.com/rubygems/rubygems/pull/4788)
137
+ - Lazily load `shellwords` library [#4786](https://github.com/rubygems/rubygems/pull/4786)
138
+ - Show original error and backtrace directly on `bundle install` errors instead of a more brittle `gem install` hint [#4778](https://github.com/rubygems/rubygems/pull/4778)
139
+ - Remove LoadError message in regards to requiring a relative file [#4772](https://github.com/rubygems/rubygems/pull/4772)
140
+
141
+ ## Bug fixes:
142
+
143
+ - Fix `BUNDLE_USER_CONFIG` no longer respected as config location [#4797](https://github.com/rubygems/rubygems/pull/4797)
144
+ - Fix `--standalone` installation of default gems [#4782](https://github.com/rubygems/rubygems/pull/4782)
145
+ - Fix `--quiet` flag not printing warnings [#4781](https://github.com/rubygems/rubygems/pull/4781)
146
+ - Fix bundler binstub version selection [#4775](https://github.com/rubygems/rubygems/pull/4775)
147
+ - Fix interrupt handling in Bundler workers [#4767](https://github.com/rubygems/rubygems/pull/4767)
148
+
1
149
  # 2.2.24 (July 15, 2021)
2
150
 
3
151
  ## Bug fixes:
@@ -37,7 +185,7 @@
37
185
  - Fix `bundle doctor` crashing when finding a broken symlink [#4707](https://github.com/rubygems/rubygems/pull/4707)
38
186
  - Fix incorrect re-resolve edge case [#4700](https://github.com/rubygems/rubygems/pull/4700)
39
187
  - Fix some gems being unintentionally locked under multiple lockfile sections [#4701](https://github.com/rubygems/rubygems/pull/4701)
40
- - Fix `--conservative` flag unexpectedly updating indirect dependencies [#4692](https://github.com/rubygems/rubygems/pull/4692)
188
+ - 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)
41
189
 
42
190
  # 2.2.21 (June 23, 2021)
43
191
 
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](doc/contributing/ISSUES.md).
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-07-15".freeze
8
- @git_commit_sha = "d78b1ee235".freeze
7
+ @built_at = "2021-12-07".freeze
8
+ @git_commit_sha = "9b5e2a350b".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -9,7 +9,7 @@ module Bundler
9
9
  end
10
10
 
11
11
  def run
12
- Bundler.ui.level = "error" if options[:quiet]
12
+ Bundler.ui.level = "warn" if options[:quiet]
13
13
  Bundler.settings.set_command_option_if_given :path, options[:path]
14
14
  Bundler.settings.set_command_option_if_given :cache_path, options["cache-path"]
15
15
 
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "rbconfig"
4
+ require "shellwords"
4
5
 
5
6
  module Bundler
6
7
  class CLI::Doctor
@@ -22,14 +23,14 @@ module Bundler
22
23
  end
23
24
 
24
25
  def dylibs_darwin(path)
25
- output = `/usr/bin/otool -L "#{path}"`.chomp
26
+ output = `/usr/bin/otool -L #{path.shellescape}`.chomp
26
27
  dylibs = output.split("\n")[1..-1].map {|l| l.match(DARWIN_REGEX).captures[0] }.uniq
27
28
  # ignore @rpath and friends
28
29
  dylibs.reject {|dylib| dylib.start_with? "@" }
29
30
  end
30
31
 
31
32
  def dylibs_ldd(path)
32
- output = `/usr/bin/ldd "#{path}"`.chomp
33
+ output = `/usr/bin/ldd #{path.shellescape}`.chomp
33
34
  output.split("\n").map do |l|
34
35
  match = l.match(LDD_REGEX)
35
36
  next if match.nil?
@@ -61,7 +62,7 @@ module Bundler
61
62
  end
62
63
 
63
64
  def run
64
- Bundler.ui.level = "error" if options[:quiet]
65
+ Bundler.ui.level = "warn" if options[:quiet]
65
66
  Bundler.settings.validate!
66
67
  check!
67
68
 
@@ -12,12 +12,7 @@ module Bundler
12
12
  @options = options
13
13
  @cmd = args.shift
14
14
  @args = args
15
-
16
- if !Bundler.current_ruby.jruby?
17
- @args << { :close_others => !options.keep_file_descriptors? }
18
- elsif options.keep_file_descriptors?
19
- Bundler.ui.warn "Ruby version #{RUBY_VERSION} defaults to keeping non-standard file descriptors on Kernel#exec."
20
- end
15
+ @args << { :close_others => !options.keep_file_descriptors? } unless Bundler.current_ruby.jruby?
21
16
  end
22
17
 
23
18
  def run
@@ -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 => Gem.ruby_version < Gem::Version.new("2.4.a") ? "2.3.0" : "2.4.0",
71
+ :required_ruby_version => required_ruby_version,
72
72
  }
73
73
  ensure_safe_gem_name(name, constant_array)
74
74
 
@@ -76,6 +76,7 @@ module Bundler
76
76
  "#{Bundler.preferred_gemfile_name}.tt" => Bundler.preferred_gemfile_name,
77
77
  "lib/newgem.rb.tt" => "lib/#{namespaced_path}.rb",
78
78
  "lib/newgem/version.rb.tt" => "lib/#{namespaced_path}/version.rb",
79
+ "sig/newgem.rbs.tt" => "sig/#{namespaced_path}.rbs",
79
80
  "newgem.gemspec.tt" => "#{name}.gemspec",
80
81
  "Rakefile.tt" => "Rakefile",
81
82
  "README.md.tt" => "README.md",
@@ -163,15 +164,16 @@ module Bundler
163
164
  templates.merge!("CHANGELOG.md.tt" => "CHANGELOG.md")
164
165
  end
165
166
 
166
- if ask_and_set(:rubocop, "Do you want to add rubocop as a dependency for gems you generate?",
167
- "RuboCop is a static code analyzer that has out-of-the-box rules for many " \
168
- "of the guidelines in the community style guide. " \
169
- "For more information, see the RuboCop docs (https://docs.rubocop.org/en/stable/) " \
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"
167
+ config[:linter] = ask_and_set_linter
168
+ case config[:linter]
169
+ when "rubocop"
170
+ config[:linter_version] = rubocop_version
173
171
  Bundler.ui.info "RuboCop enabled in config"
174
172
  templates.merge!("rubocop.yml.tt" => ".rubocop.yml")
173
+ when "standard"
174
+ config[:linter_version] = standard_version
175
+ Bundler.ui.info "Standard enabled in config"
176
+ templates.merge!("standard.yml.tt" => ".standard.yml")
175
177
  end
176
178
 
177
179
  templates.merge!("exe/newgem.tt" => "exe/#{name}") if config[:exe]
@@ -184,14 +186,15 @@ module Bundler
184
186
  )
185
187
  end
186
188
 
187
- if File.exist?(target) && !File.directory?(target)
189
+ if target.exist? && !target.directory?
188
190
  Bundler.ui.error "Couldn't create a new gem named `#{gem_name}` because there's an existing file named `#{gem_name}`."
189
191
  exit Bundler::BundlerError.all_errors[Bundler::GenericSystemCallError]
190
192
  end
191
193
 
192
194
  if use_git
193
195
  Bundler.ui.info "Initializing git repo in #{target}"
194
- `git init #{target}`
196
+ require "shellwords"
197
+ `git init #{target.to_s.shellescape}`
195
198
 
196
199
  config[:git_default_branch] = File.read("#{target}/.git/HEAD").split("/").last.chomp
197
200
  end
@@ -316,6 +319,58 @@ module Bundler
316
319
  ci_template
317
320
  end
318
321
 
322
+ def ask_and_set_linter
323
+ linter_template = options[:linter] || Bundler.settings["gem.linter"]
324
+ linter_template = deprecated_rubocop_option if linter_template.nil?
325
+
326
+ if linter_template.to_s.empty?
327
+ Bundler.ui.confirm "Do you want to add a code linter and formatter to your gem? " \
328
+ "Supported Linters:\n" \
329
+ "* RuboCop: https://rubocop.org\n" \
330
+ "* Standard: https://github.com/testdouble/standard\n" \
331
+ "\n"
332
+ Bundler.ui.info hint_text("linter")
333
+
334
+ result = Bundler.ui.ask "Enter a linter. rubocop/standard/(none):"
335
+ if result =~ /rubocop|standard/
336
+ linter_template = result
337
+ else
338
+ linter_template = false
339
+ end
340
+ end
341
+
342
+ if Bundler.settings["gem.linter"].nil?
343
+ Bundler.settings.set_global("gem.linter", linter_template)
344
+ end
345
+
346
+ # Once gem.linter safely set, unset the deprecated gem.rubocop
347
+ unless Bundler.settings["gem.rubocop"].nil?
348
+ Bundler.settings.set_global("gem.rubocop", nil)
349
+ end
350
+
351
+ if options[:linter] == Bundler.settings["gem.linter"]
352
+ Bundler.ui.info "#{options[:linter]} is already configured, ignoring --linter flag."
353
+ end
354
+
355
+ linter_template
356
+ end
357
+
358
+ def deprecated_rubocop_option
359
+ if !options[:rubocop].nil?
360
+ if options[:rubocop]
361
+ Bundler::SharedHelpers.major_deprecation 2, "--rubocop is deprecated, use --linter=rubocop"
362
+ "rubocop"
363
+ else
364
+ Bundler::SharedHelpers.major_deprecation 2, "--no-rubocop is deprecated, use --linter"
365
+ false
366
+ end
367
+ elsif !Bundler.settings["gem.rubocop"].nil?
368
+ Bundler::SharedHelpers.major_deprecation 2,
369
+ "config gem.rubocop is deprecated; we've updated your config to use gem.linter instead"
370
+ Bundler.settings["gem.rubocop"] ? "rubocop" : false
371
+ end
372
+ end
373
+
319
374
  def bundler_dependency_version
320
375
  v = Gem::Version.new(Bundler::VERSION)
321
376
  req = v.segments[0..1]
@@ -349,5 +404,30 @@ module Bundler
349
404
  def open_editor(editor, file)
350
405
  thor.run(%(#{editor} "#{file}"))
351
406
  end
407
+
408
+ def required_ruby_version
409
+ if Gem.ruby_version < Gem::Version.new("2.4.a") then "2.3.0"
410
+ elsif Gem.ruby_version < Gem::Version.new("2.5.a") then "2.4.0"
411
+ elsif Gem.ruby_version < Gem::Version.new("2.6.a") then "2.5.0"
412
+ else
413
+ "2.6.0"
414
+ end
415
+ end
416
+
417
+ def rubocop_version
418
+ if Gem.ruby_version < Gem::Version.new("2.4.a") then "0.81.0"
419
+ elsif Gem.ruby_version < Gem::Version.new("2.5.a") then "1.12"
420
+ else
421
+ "1.21"
422
+ end
423
+ end
424
+
425
+ def standard_version
426
+ if Gem.ruby_version < Gem::Version.new("2.4.a") then "0.2.5"
427
+ elsif Gem.ruby_version < Gem::Version.new("2.5.a") then "1.0"
428
+ else
429
+ "1.3"
430
+ end
431
+ end
352
432
  end
353
433
  end
@@ -18,6 +18,7 @@ module Bundler
18
18
 
19
19
  if spec
20
20
  return print_gem_path(spec) if @options[:path]
21
+ return print_gem_version(spec) if @options[:version]
21
22
  print_gem_info(spec)
22
23
  end
23
24
  end
@@ -39,13 +40,18 @@ module Bundler
39
40
  raise GemNotFound, Bundler::CLI::Common.gem_not_found_message(gem_name, Bundler.definition.dependencies)
40
41
  end
41
42
 
43
+ def print_gem_version(spec)
44
+ Bundler.ui.info spec.version.to_s
45
+ end
46
+
42
47
  def print_gem_path(spec)
43
- if spec.name == "bundler"
48
+ name = spec.name
49
+ if name == "bundler"
44
50
  path = File.expand_path("../../../..", __FILE__)
45
51
  else
46
52
  path = spec.full_gem_path
47
- unless File.directory?(path)
48
- return Bundler.ui.warn "The gem #{gem_name} has been deleted. It was installed at: #{path}"
53
+ if spec.deleted_gem?
54
+ return Bundler.ui.warn "The gem #{name} has been deleted. It was installed at: #{path}"
49
55
  end
50
56
  end
51
57
 
@@ -54,8 +60,9 @@ module Bundler
54
60
 
55
61
  def print_gem_info(spec)
56
62
  metadata = spec.metadata
63
+ name = spec.name
57
64
  gem_info = String.new
58
- gem_info << " * #{spec.name} (#{spec.version}#{spec.git_version})\n"
65
+ gem_info << " * #{name} (#{spec.version}#{spec.git_version})\n"
59
66
  gem_info << "\tSummary: #{spec.summary}\n" if spec.summary
60
67
  gem_info << "\tHomepage: #{spec.homepage}\n" if spec.homepage
61
68
  gem_info << "\tDocumentation: #{metadata["documentation_uri"]}\n" if metadata.key?("documentation_uri")
@@ -67,6 +74,11 @@ module Bundler
67
74
  gem_info << "\tMailing List: #{metadata["mailing_list_uri"]}\n" if metadata.key?("mailing_list_uri")
68
75
  gem_info << "\tPath: #{spec.full_gem_path}\n"
69
76
  gem_info << "\tDefault Gem: yes" if spec.respond_to?(:default_gem?) && spec.default_gem?
77
+
78
+ if name != "bundler" && spec.deleted_gem?
79
+ return Bundler.ui.warn "The gem #{name} has been deleted. Gemspec information is still available though:\n#{gem_info}"
80
+ end
81
+
70
82
  Bundler.ui.info gem_info
71
83
  end
72
84
  end
@@ -8,7 +8,7 @@ module Bundler
8
8
  end
9
9
 
10
10
  def run
11
- Bundler.ui.level = "error" if options[:quiet]
11
+ Bundler.ui.level = "warn" if options[:quiet]
12
12
 
13
13
  warn_if_root
14
14
 
@@ -60,7 +60,7 @@ module Bundler
60
60
  installer = Installer.install(Bundler.root, definition, options)
61
61
 
62
62
  Bundler.settings.temporary(:cache_all_platforms => options[:local] ? false : Bundler.settings[:cache_all_platforms]) do
63
- Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
63
+ Bundler.load.cache(nil, options[:local]) if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
64
64
  end
65
65
 
66
66
  Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}."
@@ -83,22 +83,9 @@ module Bundler
83
83
  end
84
84
 
85
85
  Bundler::CLI::Common.output_fund_metadata_summary
86
- rescue GemNotFound, VersionConflict => e
87
- if options[:local] && Bundler.app_cache.exist?
88
- Bundler.ui.warn "Some gems seem to be missing from your #{Bundler.settings.app_cache_path} directory."
89
- end
90
-
91
- unless Bundler.definition.has_rubygems_remotes?
92
- Bundler.ui.warn <<-WARN, :wrap => true
93
- Your Gemfile has no gem server sources. If you need gems that are \
94
- not already on your machine, add a line like this to your Gemfile:
95
- source 'https://rubygems.org'
96
- WARN
97
- end
98
- raise e
99
- rescue Gem::InvalidSpecificationException => e
86
+ rescue Gem::InvalidSpecificationException
100
87
  Bundler.ui.warn "You have one or more invalid gemspecs that need to be fixed."
101
- raise e
88
+ raise
102
89
  end
103
90
 
104
91
  private
@@ -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. Please
24
- view the Filing Issues guide for more information:
25
- https://github.com/rubygems/rubygems/blob/master/bundler/doc/contributing/ISSUES.md
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
 
@@ -16,7 +16,13 @@ module Bundler
16
16
  specs = if @only_group.any? || @without_group.any?
17
17
  filtered_specs_by_groups
18
18
  else
19
- Bundler.load.specs
19
+ begin
20
+ Bundler.load.specs
21
+ rescue GemNotFound => e
22
+ Bundler.ui.error e.message
23
+ Bundler.ui.warn "Install missing gems with `bundle install`."
24
+ exit 1
25
+ end
20
26
  end.reject {|s| s.name == "bundler" }.sort_by(&:name)
21
27
 
22
28
  return Bundler.ui.info "No gems in the Gemfile" if specs.empty?
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shellwords"
4
-
5
3
  module Bundler
6
4
  class CLI::Open
7
5
  attr_reader :options, :name
@@ -19,6 +17,7 @@ module Bundler
19
17
  else
20
18
  path = spec.full_gem_path
21
19
  Dir.chdir(path) do
20
+ require "shellwords"
22
21
  command = Shellwords.split(editor) + [path]
23
22
  Bundler.with_original_env do
24
23
  system(*command)
@@ -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
@@ -9,7 +9,7 @@ module Bundler
9
9
  end
10
10
 
11
11
  def run
12
- Bundler.ui.level = "error" if options[:quiet]
12
+ Bundler.ui.level = "warn" if options[:quiet]
13
13
 
14
14
  Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
15
15
 
@@ -66,7 +66,7 @@ module Bundler
66
66
 
67
67
  if locked_gems = Bundler.definition.locked_gems
68
68
  previous_locked_info = locked_gems.specs.reduce({}) do |h, s|
69
- h[s.name] = { :spec => s, :version => s.version, :source => s.source.to_s }
69
+ h[s.name] = { :spec => s, :version => s.version, :source => s.source.identifier }
70
70
  h
71
71
  end
72
72
  end
@@ -95,7 +95,7 @@ module Bundler
95
95
  end
96
96
 
97
97
  locked_source = locked_info[:source]
98
- new_source = new_spec.source.to_s
98
+ new_source = new_spec.source.identifier
99
99
  next if locked_source != new_source
100
100
 
101
101
  new_version = new_spec.version