bundler 1.16.1 → 1.17.3

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 (143) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +195 -0
  3. data/README.md +5 -1
  4. data/bundler.gemspec +9 -2
  5. data/lib/bundler/build_metadata.rb +19 -4
  6. data/lib/bundler/cli/add.rb +15 -5
  7. data/lib/bundler/cli/binstubs.rb +8 -2
  8. data/lib/bundler/cli/check.rb +1 -1
  9. data/lib/bundler/cli/doctor.rb +47 -1
  10. data/lib/bundler/cli/exec.rb +4 -4
  11. data/lib/bundler/cli/gem.rb +5 -2
  12. data/lib/bundler/cli/init.rb +5 -0
  13. data/lib/bundler/cli/install.rb +10 -7
  14. data/lib/bundler/cli/list.rb +41 -5
  15. data/lib/bundler/cli/outdated.rb +8 -2
  16. data/lib/bundler/cli/pristine.rb +4 -0
  17. data/lib/bundler/cli/remove.rb +18 -0
  18. data/lib/bundler/cli/update.rb +3 -3
  19. data/lib/bundler/cli.rb +66 -22
  20. data/lib/bundler/compact_index_client/updater.rb +10 -1
  21. data/lib/bundler/current_ruby.rb +8 -1
  22. data/lib/bundler/definition.rb +48 -39
  23. data/lib/bundler/dep_proxy.rb +2 -2
  24. data/lib/bundler/dependency.rb +3 -2
  25. data/lib/bundler/deprecate.rb +2 -1
  26. data/lib/bundler/dsl.rb +19 -3
  27. data/lib/bundler/endpoint_specification.rb +1 -1
  28. data/lib/bundler/env.rb +10 -8
  29. data/lib/bundler/feature_flag.rb +7 -0
  30. data/lib/bundler/fetcher/downloader.rb +10 -5
  31. data/lib/bundler/fetcher/index.rb +2 -2
  32. data/lib/bundler/fetcher.rb +3 -3
  33. data/lib/bundler/friendly_errors.rb +2 -0
  34. data/lib/bundler/gem_helper.rb +1 -1
  35. data/lib/bundler/gem_version_promoter.rb +16 -2
  36. data/lib/bundler/injector.rb +173 -14
  37. data/lib/bundler/installer/gem_installer.rb +9 -2
  38. data/lib/bundler/installer/parallel_installer.rb +6 -1
  39. data/lib/bundler/installer.rb +41 -10
  40. data/lib/bundler/lazy_specification.rb +1 -1
  41. data/lib/bundler/mirror.rb +2 -2
  42. data/lib/bundler/plugin/events.rb +61 -0
  43. data/lib/bundler/plugin/index.rb +7 -2
  44. data/lib/bundler/plugin.rb +12 -5
  45. data/lib/bundler/process_lock.rb +1 -1
  46. data/lib/bundler/resolver/spec_group.rb +0 -5
  47. data/lib/bundler/resolver.rb +11 -10
  48. data/lib/bundler/ruby_version.rb +1 -1
  49. data/lib/bundler/rubygems_gem_installer.rb +7 -0
  50. data/lib/bundler/rubygems_integration.rb +9 -3
  51. data/lib/bundler/runtime.rb +10 -4
  52. data/lib/bundler/settings/validator.rb +23 -0
  53. data/lib/bundler/settings.rb +24 -3
  54. data/lib/bundler/shared_helpers.rb +33 -5
  55. data/lib/bundler/source/git/git_proxy.rb +6 -1
  56. data/lib/bundler/source/git.rb +2 -1
  57. data/lib/bundler/source/metadata.rb +2 -3
  58. data/lib/bundler/source/rubygems/remote.rb +4 -1
  59. data/lib/bundler/source/rubygems.rb +11 -2
  60. data/lib/bundler/source.rb +9 -9
  61. data/lib/bundler/spec_set.rb +4 -1
  62. data/lib/bundler/templates/Executable +1 -1
  63. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +1 -0
  64. data/lib/bundler/templates/newgem/newgem.gemspec.tt +8 -2
  65. data/lib/bundler/templates/newgem/travis.yml.tt +2 -0
  66. data/lib/bundler/ui/shell.rb +3 -1
  67. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +11 -1
  68. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +7 -2
  69. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  70. data/lib/bundler/version.rb +1 -1
  71. data/lib/bundler.rb +38 -16
  72. data/man/bundle-add.1 +18 -3
  73. data/man/bundle-add.1.txt +17 -5
  74. data/man/bundle-add.ronn +13 -2
  75. data/man/bundle-binstubs.1 +4 -4
  76. data/man/bundle-binstubs.1.txt +4 -4
  77. data/man/bundle-binstubs.ronn +3 -3
  78. data/man/bundle-check.1 +4 -4
  79. data/man/bundle-check.1.txt +6 -5
  80. data/man/bundle-check.ronn +3 -3
  81. data/man/bundle-clean.1 +1 -1
  82. data/man/bundle-clean.1.txt +1 -1
  83. data/man/bundle-config.1 +48 -6
  84. data/man/bundle-config.1.txt +64 -26
  85. data/man/bundle-config.ronn +34 -9
  86. data/man/bundle-doctor.1 +44 -0
  87. data/man/bundle-doctor.1.txt +44 -0
  88. data/man/bundle-doctor.ronn +33 -0
  89. data/man/bundle-exec.1 +4 -4
  90. data/man/bundle-exec.1.txt +9 -9
  91. data/man/bundle-exec.ronn +3 -3
  92. data/man/bundle-gem.1 +2 -2
  93. data/man/bundle-gem.1.txt +2 -2
  94. data/man/bundle-gem.ronn +1 -1
  95. data/man/bundle-info.1 +1 -1
  96. data/man/bundle-info.1.txt +1 -1
  97. data/man/bundle-init.1 +9 -4
  98. data/man/bundle-init.1.txt +16 -6
  99. data/man/bundle-init.ronn +15 -4
  100. data/man/bundle-inject.1 +4 -4
  101. data/man/bundle-inject.1.txt +5 -5
  102. data/man/bundle-inject.ronn +3 -3
  103. data/man/bundle-install.1 +7 -4
  104. data/man/bundle-install.1.txt +119 -108
  105. data/man/bundle-install.ronn +13 -4
  106. data/man/bundle-list.1 +32 -2
  107. data/man/bundle-list.1.txt +24 -2
  108. data/man/bundle-list.ronn +19 -1
  109. data/man/bundle-lock.1 +2 -2
  110. data/man/bundle-lock.1.txt +2 -2
  111. data/man/bundle-lock.ronn +1 -1
  112. data/man/bundle-open.1 +1 -1
  113. data/man/bundle-open.1.txt +1 -1
  114. data/man/bundle-outdated.1 +7 -3
  115. data/man/bundle-outdated.1.txt +11 -7
  116. data/man/bundle-outdated.ronn +5 -1
  117. data/man/bundle-package.1 +3 -3
  118. data/man/bundle-package.1.txt +6 -6
  119. data/man/bundle-package.ronn +3 -3
  120. data/man/bundle-platform.1 +1 -1
  121. data/man/bundle-platform.1.txt +1 -1
  122. data/man/bundle-pristine.1 +1 -1
  123. data/man/bundle-pristine.1.txt +1 -1
  124. data/man/bundle-remove.1 +31 -0
  125. data/man/bundle-remove.1.txt +34 -0
  126. data/man/bundle-remove.ronn +23 -0
  127. data/man/bundle-show.1 +3 -3
  128. data/man/bundle-show.1.txt +6 -4
  129. data/man/bundle-show.ronn +3 -2
  130. data/man/bundle-update.1 +17 -13
  131. data/man/bundle-update.1.txt +68 -63
  132. data/man/bundle-update.ronn +19 -15
  133. data/man/bundle-viz.1 +2 -2
  134. data/man/bundle-viz.1.txt +3 -2
  135. data/man/bundle-viz.ronn +1 -1
  136. data/man/bundle.1 +32 -28
  137. data/man/bundle.1.txt +31 -28
  138. data/man/bundle.ronn +30 -27
  139. data/man/gemfile.5 +19 -9
  140. data/man/gemfile.5.ronn +24 -9
  141. data/man/gemfile.5.txt +114 -97
  142. data/man/index.txt +2 -0
  143. metadata +16 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1740d2e5ead04fc448d7676f9e57b2621dfdc16c
4
- data.tar.gz: e36b94d810b1eba94863fcd681157abacbed3516
2
+ SHA256:
3
+ metadata.gz: 57be2a031c802a256fffbddca6f7cac7814f550ba22a5228ca4d69ffc6219ca0
4
+ data.tar.gz: f1928fbdadc8b1e2dbbedfb9361a7afed83b8d51b5fea407c5bef0857f93fd03
5
5
  SHA512:
6
- metadata.gz: 29116c83cab200dc0a8103736f80ba25d238b129f2b650947f67e0aae871f655383ee6933683a5162a0de3c2209303c69aa8aae99136effdaec3fd633939371f
7
- data.tar.gz: 635d4a391d1c24695b9bb0f313b51f16f832462dfb5384fd8201c57c89537a78cc1919cce4ec4134b4518683fd6fd33fcfabd2196c40852f47ac22e255dfcb45
6
+ metadata.gz: '08986fab1b004158cb55a6f0ef41e4a17e4b85561a97b24e85a731056af327f801e1d105915e6760e99b4b006da7f9a3c79b388d3ca998d2d12492e9accf7ad6'
7
+ data.tar.gz: fb07fcd0f42267952e5ce1a929825b7c1d7e42cd489f025a03a3a8846616bcd60bb477d12e437206dbb188f4e7c575fc6d0e6f89ab8adaf1bb6b01e91739fe21
data/CHANGELOG.md CHANGED
@@ -1,3 +1,198 @@
1
+ ## 1.17.3 (2018-12-27)
2
+
3
+ Bugfixes:
4
+
5
+ - Fix a Bundler error when installing gems on old versions of RubyGems ([#6839](https://github.com/bundler/bundler/issues/6839), @colby-swandale)
6
+ - Fix a rare issue where Bundler was removing itself after a `bundle clean` ([#6829](https://github.com/bundler/bundler/issues/6829), @colby-swandale)
7
+
8
+ Documentation:
9
+
10
+ - Add entry for the `bundle remove` command to the main Bundler manual page
11
+
12
+ ## 1.17.2 (2018-12-11)
13
+
14
+ - Add compatibility for bundler merge with Ruby 2.6
15
+
16
+ ## 1.17.1 (2018-10-25)
17
+
18
+ - Convert `Pathname`s to `String`s before sorting them, fixing #6760 and #6758 ([#6761](https://github.com/bundler/bundler/pull/6761), @alexggordon)
19
+
20
+ ## 1.17.0 (2018-10-25)
21
+
22
+ No new changes.
23
+
24
+ ## 1.17.0.pre.2 (2018-10-13)
25
+
26
+ Features:
27
+
28
+ - Configure Bundler home, cache, config and plugin directories with `BUNDLE_USER_HOME`, `BUNDLE_USER_CACHE`, `BUNDLE_USER_CONFIG` and `BUNDLE_USER_PLUGIN` env vars ([#4333](https://github.com/bundler/bundler/issues/4333), @gwerbin)
29
+ - Add `--all` option to `bundle binstubs` that will generate an executable file for all gems with commands in the bundle
30
+ - Add `bundle remove` command to remove gems from the Gemfile via the CLI
31
+ - Improve checking file permissions and asking for `sudo` in Bundler when it doesn't need to
32
+ - Add error message to `bundle add` to check adding duplicate gems to the Gemfile
33
+ - When asking for `sudo`, Bundler will show a list of folders/files that require elevated permissions to write to.
34
+
35
+ The following new features are available but are not enabled by default. These are intended to be tested by users for the upcoming release of Bundler 2.
36
+
37
+ - Improve deprecation warning message for `bundle show` command
38
+ - Improve deprecation warning message for the `--force` option in `bundle install`
39
+
40
+ ## 1.17.0.pre.1 (2018-09-24)
41
+
42
+ Features:
43
+
44
+ - Check folder/file permissions of the Bundle home directory in the `bundle doctor` command ([#5786](https://github.com/bundler/bundler/issues/5786), @ajwann)
45
+ - Remove compiled gem extensions when running `bundle clean` ([#5596](https://github.com/bundler/bundler/issues/5596), @akhramov)
46
+ - Add `--paths` option to `bundle list` command ([#6172](https://github.com/bundler/bundler/issues/6172), @colby-swandale)
47
+ - Add base error class to gems generated from `bundle gem` ([#6260](https://github.com/bundler/bundler/issues/6260), @christhekeele)
48
+ - Correctly re-install gem extensions with a git source when running `bundle pristine` ([#6294](https://github.com/bundler/bundler/issues/6294), @wagenet)
49
+ - Add config option to disable platform warnings ([#6124](https://github.com/bundler/bundler/issues/6124), @agrim123)
50
+ - Add `--skip-install` option to `bundle add` command to add gems to the Gemfile without installation ([#6511](https://github.com/bundler/bundler/issues/6511), @agrim123)
51
+ - Add `--only-explicit` option to `bundle outdated` to list only outdated gems in the Gemfile ([#5366](https://github.com/bundler/bundler/issues/5366), @peret)
52
+ - Support adding multiple gems to the Gemfile with `bundle add` ([#6543](https://github.com/bundler/bundler/issues/6543), @agrim123)
53
+ - Make registered plugin events easier to manage in the Plugin API (@jules2689)
54
+ - Add new gem install hooks to the Plugin API (@jules2689)
55
+ - Add `--optimistic` and `--strict` options to `bundle add` ([#6553](https://github.com/bundler/bundler/issues/6553), @agrim123)
56
+ - Add `--without-group` and `--only-group` options to `bundle list` ([#6564](https://github.com/bundler/bundler/issues/6564), @agrim123)
57
+ - Add `--gemfile` option to the `bundle exec` command ([#5924](https://github.com/bundler/bundler/issues/5924), @ankitkataria)
58
+
59
+ The following new features are available but are not enabled by default. These are intended to be tested by users for the upcoming release of Bundler 2.
60
+
61
+ - Make `install --path` relative to the current working directory ([#2048](https://github.com/bundler/bundler/issues/2048), @igorbozato)
62
+ - Auto-configure job count ([#5808](https://github.com/bundler/bundler/issues/5808), @segiddins)
63
+ - Use the Gem Version Promoter for major gem updates ([#5993](https://github.com/bundler/bundler/issues/5993), @segiddins)
64
+ - Add config option to add the Ruby scope to `bundle config path` when configured globally (@segiddins)
65
+
66
+ ## 1.16.6 (2018-10-05)
67
+
68
+ Changes:
69
+
70
+ - Add an error message when adding a gem with `bundle add` that's already in the bundle ([#6341](https://github.com/bundler/bundler/issues/6341), @agrim123)
71
+ - Add Homepage, Source Code and Chanagelog URI metadata fields to the `bundle gem` gemspec template (@walf443)
72
+
73
+ Bugfixes:
74
+
75
+ - Fix issue where updating a gem resulted in the gem's version being downgraded when `BUNDLE_ONLY_UPDATE_TO_NEWER_VERSIONS` was set ([#6529](https://github.com/bundler/bundler/issues/6529), @theflow)
76
+ - Fix some rescue calls that don't specifiy error type (@utilum)
77
+ - Fix an issue when the Lockfile would contain platform-specific gems that it didn't need ([#6491](https://github.com/bundler/bundler/issues/6491), @segiddins)
78
+ - Improve handlding of adding new gems with only a single group to the Gemfile in `bundle add` (@agrim123)
79
+ - Refactor check for OpenSSL in `bundle env` (@voxik)
80
+ - Remove an unnecessary assignment in Metadata (@voxik)
81
+
82
+ Documentation:
83
+
84
+ - Update docs to reflect revised guidance to check in Gemfile.lock into version control for gems ([#5879](https://github.com/bundler/bundler/issues/5879), @arbonap)
85
+ - Add documentation for the `--all` flag in `bundle update` (@agrim123)
86
+ - Update README to use `bundle add` in usage examples (@hdf1986)
87
+
88
+ ## 1.16.5 (2018-09-18)
89
+
90
+ Changes:
91
+
92
+ - Add support for TruffleRuby (@eregon)
93
+
94
+ Bugfixes:
95
+
96
+ - Avoid printing git errors when checking the version on incorrectly packaged versions of Bundler ([#6453](https://github.com/bundler/bundler/issues/6453), @greysteil)
97
+ - Fix issue where Bundler does not check the given class when comparing equality in DepProxy (@ChrisBr)
98
+ - Handle `RangeNotSatisfiable` error in Compact Index (@MaxLap)
99
+ - Check for initialized `search` variable in `LazySpecification` (@voxik)
100
+ - Fix LoadError occurring in nested bundle exec calls ([#6537](https://github.com/bundler/bundler/issues/6537), @colby-swandale)
101
+ - Check that Bundler::Deprecate is not an autoload constant ([#6163](https://github.com/bundler/bundler/issues/6163), @eregon)
102
+ - Prefer non-pre-release versions when performing a `bundle update --patch` ([#6684](https://github.com/bundler/bundler/issues/6684), @segiddins)
103
+
104
+ ## 1.16.4 (2018-08-17)
105
+
106
+ Changes:
107
+
108
+ - Welcome new members to the Bundler core team (@indirect)
109
+ - Don't mutate original error trees when determining version_conflict_message (@greysteil)
110
+ - Update vendored Molinillo to 0.6.6 (@segiddins)
111
+
112
+ Bugfixes:
113
+
114
+ - Reword bundle update regression message to be more clear to the user when a gem's version is downgraded ([#6584](https://github.com/bundler/bundler/issues/6584), @ralphbolo)
115
+ - Respect --conservative flag when updating a dependency group ([#6560](https://github.com/bundler/bundler/issues/6560), @greysteil)
116
+ - Fix issue where a pre-release version was not being selected when it's specified in the Gemfile ([#6449](https://github.com/bundler/bundler/issues/6449), @akihiro17)
117
+ - Fix issue where `Etc` was not loaded when getting the user's home dir ([#6640](https://github.com/bundler/bundler/issues/6640), @colby-swandale)
118
+ - Use UTF-8 for reading files including Gemfile ([#6660](https://github.com/bundler/bundler/issues/6660), @eregon)
119
+ - Remove unnecessary `while` loop in path resolver helper (@ojab)
120
+
121
+ Documentation:
122
+
123
+ - Document that `bundle show [--paths]` sorts results by name (@kemitchell)
124
+
125
+ ## 1.16.3 (2018-07-17)
126
+
127
+ Features:
128
+
129
+ - Support URI::File of Ruby 2.6 (@hsbt)
130
+
131
+ Bugfixes:
132
+
133
+ - Expand symlinks during setup to allow Bundler to load correctly when using symlinks in $GEM_HOME ([#6465](https://github.com/bundler/bundler/issues/6465), @ojab, @indirect)
134
+ - Dont let Bundler create temporary folders for gem installs which are owned by root ([#6258](https://github.com/bundler/bundler/issues/6258), @colby-swandale)
135
+ - Don't fallback to using temporary directories when needed directories already exist ([#6546](https://github.com/bundler/bundler/issues/6546), @brodock)
136
+ - Use SharedHelpers.filesystem_access when reading a Gemfile so friendly error messages can be given to the user ([#6541](https://github.com/bundler/bundler/issues/6541), @segiddins)
137
+ - Check if source responds to `#remotes` before printing gem install error message ([#6211](https://github.com/bundler/bundler/issues/6211), @colby-swandale)
138
+ - Handle Errno::ENOTSUP in the Bundler Process Lock to prevent exceptions when using NFS mounts ([#6566](https://github.com/bundler/bundler/issues/6566), @colby-swandale)
139
+ - Respect encodings when reading gemspecs ([#6598](https://github.com/bundler/bundler/issues/6598), @deivid-rodriguez)
140
+
141
+ Documentation:
142
+
143
+ - Fix links between manual pages (@BanzaiMan)
144
+ - Add warning to Gemfile documentation for the use of the `source` option when declaring gems ([#6280](https://github.com/bundler/bundler/issues/6280), @forestgagnon)
145
+
146
+ ## 1.16.2 (2018-04-20)
147
+
148
+ Changes:
149
+
150
+ - Include the gem's source in the gem install error message when available (@papanikge)
151
+ - Remove unnecessary executable bit from gem template (@voxik)
152
+ - Dont add the timestamp comment with gems added to the Gemfile via `bundle add` ([#6193](https://github.com/bundler/bundler/issues/6193), @cpgo)
153
+ - Improve yanked gem error message (@alyssais)
154
+ - Use `Bundler.rubygems.inflate` instead of the Gem::Util method directly (@segiddins)
155
+ - Remove unused instance variable (@segiddins)
156
+
157
+ Bugfixes:
158
+
159
+ - Only trap INT signal and have Ruby's signal default handler be invoked (@shayonj)
160
+ - Fix warning about the use of `__FILE__` in RubyGems integration testing (@MSP-Greg)
161
+ - Skip the outdated bundler check when MD5 is not available ([#6032](https://github.com/bundler/bundler/issues/6032), @segiddins)
162
+ - Fallback to the original error if the friendly message raises (@segiddins)
163
+ - Rename Bundler.frozen? to avoid Object method conflict ([#6252](https://github.com/bundler/bundler/issues/6252), @segiddins)
164
+ - Ensure the bindir exists before installing gems (@segiddins)
165
+ - Handle gzip corruption errors in the compact index client ([#6261](https://github.com/bundler/bundler/issues/6261), @colby-swandale)
166
+ - Check if the current directory is writeable when writing files in `bundle gem` ([#6219](https://github.com/bundler/bundler/issues/6219), @nilsding)
167
+ - Fix hang when gemspec has incompatible encoding (@deivid-rodriguez)
168
+ - Gracefully handle when the lockfile is missing spec entries for the current platform ([#6079](https://github.com/bundler/bundler/issues/6079), @segiddins)
169
+ - Use Gem::Util.inflate instead of Gem.inflate (@hsbt)
170
+ - Update binstub generator to use new ERB.new arity in Ruby 2.6 (@koic)
171
+ - Fix `source_location` call in rubygems integration (@MSP-Greg)
172
+ - Use `filesystem_access` when copying files in Compact Index Updater ([#6289](https://github.com/bundler/bundler/issues/6289), @segiddins)
173
+ - Fail gracefully when resetting git gems to the given revision fails ([#6324](https://github.com/bundler/bundler/issues/6324), @segiddins)
174
+ - Handle exceptions that do not have a backtrace ([#6342](https://github.com/bundler/bundler/issues/6342), @nesaulov)
175
+ - Check if stderr was closed before writing to it (@shime)
176
+ - Handle updating a specific gem for a non-local platform ([#6350](https://github.com/bundler/bundler/issues/6350), @greysteil)
177
+ - Bump the `bundle_binstub` check-length to 300 characters (@tduffield)
178
+ - Fix specifying alterntive Lockfile with `bundle lock` when default gemfile is present ([#6460](https://github.com/bundler/bundler/issues/6460), @agrim123)
179
+ - Allow installing dependencies when the path is set to `.` ([#6475](https://github.com/bundler/bundler/issues/6475), @segiddins)
180
+ - Support Bundler installing on a readonly filesystem without a home directory ([#6461](https://github.com/bundler/bundler/issues/6461), @grosser)
181
+ - Filter git uri credentials in source description (@segiddins)
182
+
183
+ Documentation:
184
+
185
+ - Correct typos in `bundle binstubs` man page (@erikj, @samueloph)
186
+ - Update links in `bundle gem` command documentation to use https (@KrauseFx)
187
+ - Fix broken links between bundler man pages (@segiddins)
188
+ - Add man page for the `bundle doctor` command ([#6243](https://github.com/bundler/bundler/issues/6243), @nholden)
189
+ - Document `# frozen_string_literal` in `bundle init` Gemfile (@315tky)
190
+ - Explain the gemspec files attribute in `bundle gem` template and print a link to bundler.io guides when running `bundle gem` ([#6246](https://github.com/bundler/bundler/issues/6246), @nesaulov)
191
+ - Small copy tweaks & removed redundant phrasing in the bundler man page (@rubymorillo)
192
+ - Improve the documentation of the settings load order in Bundler (@rubymorillo)
193
+ - Added license info to main README (@rubymorillo)
194
+ - Document parameters and return value of Injector#inject (@tobias-grasse)
195
+
1
196
  ## 1.16.1 (2017-12-12)
2
197
 
3
198
  Bugfixes:
data/README.md CHANGED
@@ -24,7 +24,7 @@ Bundler is most commonly used to manage your application's dependencies. For exa
24
24
 
25
25
  ```
26
26
  bundle init
27
- echo 'gem "rspec"' >> Gemfile
27
+ bundle add rspec
28
28
  bundle install
29
29
  bundle exec rspec
30
30
  ```
@@ -57,3 +57,7 @@ While some Bundler contributors are compensated by Ruby Together, the project ma
57
57
  ### Code of Conduct
58
58
 
59
59
  Everyone interacting in the Bundler project’s codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [Bundler code of conduct](https://github.com/bundler/bundler/blob/master/CODE_OF_CONDUCT.md).
60
+
61
+ ### License
62
+
63
+ [MIT License](https://github.com/bundler/bundler/blob/master/LICENSE.md)
data/bundler.gemspec CHANGED
@@ -1,7 +1,13 @@
1
1
  # coding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
- require File.expand_path("../lib/bundler/version", __FILE__)
4
+ begin
5
+ require File.expand_path("../lib/bundler/version", __FILE__)
6
+ rescue LoadError
7
+ # for Ruby core repository
8
+ require File.expand_path("../bundler/version", __FILE__)
9
+ end
10
+
5
11
  require "shellwords"
6
12
 
7
13
  Gem::Specification.new do |s|
@@ -9,7 +15,8 @@ Gem::Specification.new do |s|
9
15
  s.version = Bundler::VERSION
10
16
  s.license = "MIT"
11
17
  s.authors = [
12
- "André Arko", "Samuel Giddins", "Chris Morris", "James Wen", "Tim Moore",
18
+ "André Arko", "Samuel Giddins", "Colby Swandale", "Hiroshi Shibata",
19
+ "David Rodríguez", "Grey Baker", "Stephanie Morillo", "Chris Morris", "James Wen", "Tim Moore",
13
20
  "André Medeiros", "Jessica Lynn Suttles", "Terence Lee", "Carl Lerche",
14
21
  "Yehuda Katz"
15
22
  ]
@@ -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 = "2017-12-21".freeze
8
- @git_commit_sha = "0034ef341".freeze
7
+ @built_at = "2018-12-27".freeze
8
+ @git_commit_sha = "d7089abb6".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -25,9 +25,24 @@ module Bundler
25
25
 
26
26
  # The SHA for the git commit the bundler gem was built from.
27
27
  def self.git_commit_sha
28
- @git_commit_sha ||= Dir.chdir(File.expand_path("..", __FILE__)) do
29
- `git rev-parse --short HEAD`.strip.freeze
28
+ return @git_commit_sha if @git_commit_sha
29
+
30
+ # If Bundler has been installed without its .git directory and without a
31
+ # commit instance variable then we can't determine its commits SHA.
32
+ git_dir = File.join(File.expand_path("../../..", __FILE__), ".git")
33
+ if File.directory?(git_dir)
34
+ return @git_commit_sha = Dir.chdir(git_dir) { `git rev-parse --short HEAD`.strip.freeze }
35
+ end
36
+
37
+ # If Bundler is a submodule in RubyGems, get the submodule commit
38
+ git_sub_dir = File.join(File.expand_path("../../../..", __FILE__), ".git")
39
+ if File.directory?(git_sub_dir)
40
+ return @git_commit_sha = Dir.chdir(git_sub_dir) do
41
+ `git ls-tree --abbrev=8 HEAD bundler`.split(/\s/).fetch(2, "").strip.freeze
42
+ end
30
43
  end
44
+
45
+ @git_commit_sha ||= "unknown"
31
46
  end
32
47
 
33
48
  # Whether this is an official release build of Bundler.
@@ -2,13 +2,18 @@
2
2
 
3
3
  module Bundler
4
4
  class CLI::Add
5
- def initialize(options, gem_name)
6
- @gem_name = gem_name
5
+ def initialize(options, gems)
6
+ @gems = gems
7
7
  @options = options
8
8
  @options[:group] = @options[:group].split(",").map(&:strip) if !@options[:group].nil? && !@options[:group].empty?
9
9
  end
10
10
 
11
11
  def run
12
+ raise InvalidOption, "You can not specify `--strict` and `--optimistic` at the same time." if @options[:strict] && @options[:optimistic]
13
+
14
+ # raise error when no gems are specified
15
+ raise InvalidOption, "Please specify gems to add." if @gems.empty?
16
+
12
17
  version = @options[:version].nil? ? nil : @options[:version].split(",").map(&:strip)
13
18
 
14
19
  unless version.nil?
@@ -16,10 +21,15 @@ module Bundler
16
21
  raise InvalidOption, "Invalid gem requirement pattern '#{v}'" unless Gem::Requirement::PATTERN =~ v.to_s
17
22
  end
18
23
  end
19
- dependency = Bundler::Dependency.new(@gem_name, version, @options)
20
24
 
21
- Injector.inject([dependency], :conservative_versioning => @options[:version].nil?) # Perform conservative versioning only when version is not specified
22
- Installer.install(Bundler.root, Bundler.definition)
25
+ dependencies = @gems.map {|g| Bundler::Dependency.new(g, version, @options) }
26
+
27
+ Injector.inject(dependencies,
28
+ :conservative_versioning => @options[:version].nil?, # Perform conservative versioning only when version is not specified
29
+ :optimistic => @options[:optimistic],
30
+ :strict => @options[:strict])
31
+
32
+ Installer.install(Bundler.root, Bundler.definition) unless @options["skip-install"]
23
33
  end
24
34
  end
25
35
  end
@@ -16,7 +16,13 @@ module Bundler
16
16
  Bundler.settings.set_command_option_if_given :shebang, options["shebang"]
17
17
  installer = Installer.new(Bundler.root, Bundler.definition)
18
18
 
19
- if gems.empty?
19
+ installer_opts = { :force => options[:force], :binstubs_cmd => true }
20
+
21
+ if options[:all]
22
+ raise InvalidOption, "Cannot specify --all with specific gems" unless gems.empty?
23
+ @gems = Bundler.definition.specs.map(&:name)
24
+ installer_opts.delete(:binstubs_cmd)
25
+ elsif gems.empty?
20
26
  Bundler.ui.error "`bundle binstubs` needs at least one gem to run."
21
27
  exit 1
22
28
  end
@@ -35,7 +41,7 @@ module Bundler
35
41
  installer.generate_standalone_bundler_executable_stubs(spec)
36
42
  end
37
43
  else
38
- installer.generate_bundler_executable_stubs(spec, :force => options[:force], :binstubs_cmd => true)
44
+ installer.generate_bundler_executable_stubs(spec, installer_opts)
39
45
  end
40
46
  end
41
47
  end
@@ -26,7 +26,7 @@ module Bundler
26
26
  not_installed.each {|s| Bundler.ui.error " * #{s.name} (#{s.version})" }
27
27
  Bundler.ui.warn "Install missing gems with `bundle install`"
28
28
  exit 1
29
- elsif !Bundler.default_lockfile.file? && Bundler.frozen?
29
+ elsif !Bundler.default_lockfile.file? && Bundler.frozen_bundle?
30
30
  Bundler.ui.error "This bundle has been frozen, but there is no #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} present"
31
31
  exit 1
32
32
  else
@@ -78,6 +78,8 @@ module Bundler
78
78
  end
79
79
  end
80
80
 
81
+ permissions_valid = check_home_permissions
82
+
81
83
  if broken_links.any?
82
84
  message = "The following gems are missing OS dependencies:"
83
85
  broken_links.map do |spec, paths|
@@ -86,9 +88,53 @@ module Bundler
86
88
  end
87
89
  end.flatten.sort.each {|m| message += m }
88
90
  raise ProductionError, message
89
- else
91
+ elsif !permissions_valid
90
92
  Bundler.ui.info "No issues found with the installed bundle"
91
93
  end
92
94
  end
95
+
96
+ private
97
+
98
+ def check_home_permissions
99
+ require "find"
100
+ files_not_readable_or_writable = []
101
+ files_not_rw_and_owned_by_different_user = []
102
+ files_not_owned_by_current_user_but_still_rw = []
103
+ Find.find(Bundler.home.to_s).each do |f|
104
+ if !File.writable?(f) || !File.readable?(f)
105
+ if File.stat(f).uid != Process.uid
106
+ files_not_rw_and_owned_by_different_user << f
107
+ else
108
+ files_not_readable_or_writable << f
109
+ end
110
+ elsif File.stat(f).uid != Process.uid
111
+ files_not_owned_by_current_user_but_still_rw << f
112
+ end
113
+ end
114
+
115
+ ok = true
116
+ if files_not_owned_by_current_user_but_still_rw.any?
117
+ Bundler.ui.warn "Files exist in the Bundler home that are owned by another " \
118
+ "user, but are still readable/writable. These files are:\n - #{files_not_owned_by_current_user_but_still_rw.join("\n - ")}"
119
+
120
+ ok = false
121
+ end
122
+
123
+ if files_not_rw_and_owned_by_different_user.any?
124
+ Bundler.ui.warn "Files exist in the Bundler home that are owned by another " \
125
+ "user, and are not readable/writable. These files are:\n - #{files_not_rw_and_owned_by_different_user.join("\n - ")}"
126
+
127
+ ok = false
128
+ end
129
+
130
+ if files_not_readable_or_writable.any?
131
+ Bundler.ui.warn "Files exist in the Bundler home that are not " \
132
+ "readable/writable by the current user. These files are:\n - #{files_not_readable_or_writable.join("\n - ")}"
133
+
134
+ ok = false
135
+ end
136
+
137
+ ok
138
+ end
93
139
  end
94
140
  end
@@ -6,7 +6,7 @@ module Bundler
6
6
  class CLI::Exec
7
7
  attr_reader :options, :args, :cmd
8
8
 
9
- RESERVED_SIGNALS = %w[SEGV BUS ILL FPE VTALRM KILL STOP].freeze
9
+ TRAPPED_SIGNALS = %w[INT].freeze
10
10
 
11
11
  def initialize(options, args)
12
12
  @options = options
@@ -70,15 +70,14 @@ module Bundler
70
70
  ui = Bundler.ui
71
71
  Bundler.ui = nil
72
72
  require "bundler/setup"
73
- signals = Signal.list.keys - RESERVED_SIGNALS
74
- signals.each {|s| trap(s, "DEFAULT") }
73
+ TRAPPED_SIGNALS.each {|s| trap(s, "DEFAULT") }
75
74
  Kernel.load(file)
76
75
  rescue SystemExit, SignalException
77
76
  raise
78
77
  rescue Exception => e # rubocop:disable Lint/RescueException
79
78
  Bundler.ui = ui
80
79
  Bundler.ui.error "bundler: failed to load command: #{cmd} (#{file})"
81
- backtrace = e.backtrace.take_while {|bt| !bt.start_with?(__FILE__) }
80
+ backtrace = e.backtrace ? e.backtrace.take_while {|bt| !bt.start_with?(__FILE__) } : []
82
81
  abort "#{e.class}: #{e.message}\n #{backtrace.join("\n ")}"
83
82
  end
84
83
 
@@ -90,6 +89,7 @@ module Bundler
90
89
  possibilities = [
91
90
  "#!/usr/bin/env ruby\n",
92
91
  "#!/usr/bin/env jruby\n",
92
+ "#!/usr/bin/env truffleruby\n",
93
93
  "#!#{Gem.ruby}\n",
94
94
  ]
95
95
 
@@ -105,7 +105,7 @@ module Bundler
105
105
  if ask_and_set(:mit, "Do you want to license your code permissively under the MIT license?",
106
106
  "This means that any other developer or company will be legally allowed to use your code " \
107
107
  "for free as long as they admit you created it. You can read more about the MIT license " \
108
- "at http://choosealicense.com/licenses/mit.")
108
+ "at https://choosealicense.com/licenses/mit.")
109
109
  config[:mit] = true
110
110
  Bundler.ui.info "MIT License enabled in config"
111
111
  templates.merge!("LICENSE.txt.tt" => "LICENSE.txt")
@@ -118,7 +118,7 @@ module Bundler
118
118
  "of enforcing it, so be sure that you are prepared to do that. Be sure that your email " \
119
119
  "address is specified as a contact in the generated code of conduct so that people know " \
120
120
  "who to contact in case of a violation. For suggestions about " \
121
- "how to enforce codes of conduct, see http://bit.ly/coc-enforcement.")
121
+ "how to enforce codes of conduct, see https://bit.ly/coc-enforcement.")
122
122
  config[:coc] = true
123
123
  Bundler.ui.info "Code of conduct enabled in config"
124
124
  templates.merge!("CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md")
@@ -158,6 +158,9 @@ module Bundler
158
158
 
159
159
  # Open gemspec in editor
160
160
  open_editor(options["edit"], target.join("#{name}.gemspec")) if options[:edit]
161
+
162
+ Bundler.ui.info "Gem '#{name}' was successfully created. " \
163
+ "For more information on making a RubyGem visit https://bundler.io/guides/creating_gem.html"
161
164
  rescue Errno::EEXIST => e
162
165
  raise GenericSystemCallError.new(e, "There was a conflict while creating the new gem.")
163
166
  end
@@ -13,6 +13,11 @@ module Bundler
13
13
  exit 1
14
14
  end
15
15
 
16
+ unless File.writable?(Dir.pwd)
17
+ Bundler.ui.error "Can not create #{gemfile} as the current directory is not writable."
18
+ exit 1
19
+ end
20
+
16
21
  if options[:gemspec]
17
22
  gemspec = File.expand_path(options[:gemspec])
18
23
  unless File.exist?(gemspec)
@@ -23,7 +23,7 @@ module Bundler
23
23
 
24
24
  check_trust_policy
25
25
 
26
- if options[:deployment] || options[:frozen] || Bundler.frozen?
26
+ if options[:deployment] || options[:frozen] || Bundler.frozen_bundle?
27
27
  unless Bundler.default_lockfile.exist?
28
28
  flag = "--deployment flag" if options[:deployment]
29
29
  flag ||= "--frozen flag" if options[:frozen]
@@ -63,7 +63,7 @@ module Bundler
63
63
  definition.validate_runtime!
64
64
 
65
65
  installer = Installer.install(Bundler.root, definition, options)
66
- Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen?
66
+ Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
67
67
 
68
68
  Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}."
69
69
  Bundler::CLI::Common.output_without_groups_message
@@ -71,8 +71,7 @@ module Bundler
71
71
  if Bundler.use_system_gems?
72
72
  Bundler.ui.confirm "Use `bundle info [gemname]` to see where a bundled gem is installed."
73
73
  else
74
- absolute_path = File.expand_path(Bundler.configured_bundle_path.base_path)
75
- relative_path = absolute_path.sub(File.expand_path(".") + File::SEPARATOR, "." + File::SEPARATOR)
74
+ relative_path = Bundler.configured_bundle_path.base_path_relative_to_pwd
76
75
  Bundler.ui.confirm "Bundled gems are installed into `#{relative_path}`"
77
76
  end
78
77
 
@@ -169,9 +168,13 @@ module Bundler
169
168
 
170
169
  def normalize_settings
171
170
  Bundler.settings.set_command_option :path, nil if options[:system]
172
- Bundler.settings.set_command_option :path, "vendor/bundle" if options[:deployment]
173
- Bundler.settings.set_command_option_if_given :path, options["path"]
174
- Bundler.settings.set_command_option :path, "bundle" if options["standalone"] && Bundler.settings[:path].nil?
171
+ Bundler.settings.temporary(:path_relative_to_cwd => false) do
172
+ Bundler.settings.set_command_option :path, "vendor/bundle" if options[:deployment]
173
+ end
174
+ Bundler.settings.set_command_option_if_given :path, options[:path]
175
+ Bundler.settings.temporary(:path_relative_to_cwd => false) do
176
+ Bundler.settings.set_command_option :path, "bundle" if options["standalone"] && Bundler.settings[:path].nil?
177
+ end
175
178
 
176
179
  bin_option = options["binstubs"]
177
180
  bin_option = nil if bin_option && bin_option.empty?
@@ -7,16 +7,52 @@ module Bundler
7
7
  end
8
8
 
9
9
  def run
10
- specs = Bundler.load.specs.reject {|s| s.name == "bundler" }.sort_by(&:name)
11
- return specs.each {|s| Bundler.ui.info s.name } if @options["name-only"]
10
+ raise InvalidOption, "The `--only-group` and `--without-group` options cannot be used together" if @options["only-group"] && @options["without-group"]
11
+
12
+ raise InvalidOption, "The `--name-only` and `--paths` options cannot be used together" if @options["name-only"] && @options[:paths]
13
+
14
+ specs = if @options["only-group"] || @options["without-group"]
15
+ filtered_specs_by_groups
16
+ else
17
+ Bundler.load.specs
18
+ end.reject {|s| s.name == "bundler" }.sort_by(&:name)
12
19
 
13
20
  return Bundler.ui.info "No gems in the Gemfile" if specs.empty?
21
+
22
+ return specs.each {|s| Bundler.ui.info s.name } if @options["name-only"]
23
+ return specs.each {|s| Bundler.ui.info s.full_gem_path } if @options["paths"]
24
+
14
25
  Bundler.ui.info "Gems included by the bundle:"
15
- specs.each do |s|
16
- Bundler.ui.info " * #{s.name} (#{s.version}#{s.git_version})"
17
- end
26
+
27
+ specs.each {|s| Bundler.ui.info " * #{s.name} (#{s.version}#{s.git_version})" }
18
28
 
19
29
  Bundler.ui.info "Use `bundle info` to print more detailed information about a gem"
20
30
  end
31
+
32
+ private
33
+
34
+ def verify_group_exists(groups)
35
+ raise InvalidOption, "`#{@options["without-group"]}` group could not be found." if @options["without-group"] && !groups.include?(@options["without-group"].to_sym)
36
+
37
+ raise InvalidOption, "`#{@options["only-group"]}` group could not be found." if @options["only-group"] && !groups.include?(@options["only-group"].to_sym)
38
+ end
39
+
40
+ def filtered_specs_by_groups
41
+ definition = Bundler.definition
42
+ groups = definition.groups
43
+
44
+ verify_group_exists(groups)
45
+
46
+ show_groups =
47
+ if @options["without-group"]
48
+ groups.reject {|g| g == @options["without-group"].to_sym }
49
+ elsif @options["only-group"]
50
+ groups.select {|g| g == @options["only-group"].to_sym }
51
+ else
52
+ groups
53
+ end.map(&:to_sym)
54
+
55
+ definition.specs_for(show_groups)
56
+ end
21
57
  end
22
58
  end
@@ -66,7 +66,13 @@ module Bundler
66
66
  current_dependencies.key? spec.name
67
67
  end
68
68
 
69
- (gemfile_specs + dependency_specs).sort_by(&:name).each do |current_spec|
69
+ specs = if options["only-explicit"]
70
+ gemfile_specs
71
+ else
72
+ gemfile_specs + dependency_specs
73
+ end
74
+
75
+ specs.sort_by(&:name).each do |current_spec|
70
76
  next if !gems.empty? && !gems.include?(current_spec.name)
71
77
 
72
78
  dependency = current_dependencies[current_spec.name]
@@ -213,7 +219,7 @@ module Bundler
213
219
  end
214
220
 
215
221
  def check_for_deployment_mode
216
- return unless Bundler.frozen?
222
+ return unless Bundler.frozen_bundle?
217
223
  suggested_command = if Bundler.settings.locations("frozen")[:global]
218
224
  "bundle config --delete frozen"
219
225
  elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
@@ -30,6 +30,10 @@ module Bundler
30
30
  FileUtils.rm_rf spec.full_gem_path
31
31
  when Source::Git
32
32
  source.remote!
33
+ if extension_cache_path = source.extension_cache_path(spec)
34
+ FileUtils.rm_rf extension_cache_path
35
+ end
36
+ FileUtils.rm_rf spec.extension_dir if spec.respond_to?(:extension_dir)
33
37
  FileUtils.rm_rf spec.full_gem_path
34
38
  else
35
39
  Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is sourced from local path.")