bundler 1.13.7 → 1.14.0.pre.1

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 (112) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.rubocop_todo.yml +100 -18
  4. data/.travis.yml +32 -18
  5. data/CHANGELOG.md +64 -2
  6. data/DEVELOPMENT.md +5 -3
  7. data/ISSUES.md +17 -0
  8. data/README.md +7 -0
  9. data/Rakefile +34 -23
  10. data/bin/rubocop +1 -1
  11. data/bundler.gemspec +2 -2
  12. data/exe/bundle +4 -6
  13. data/lib/bundler.rb +57 -5
  14. data/lib/bundler/cli.rb +51 -38
  15. data/lib/bundler/cli/binstubs.rb +1 -1
  16. data/lib/bundler/cli/cache.rb +1 -1
  17. data/lib/bundler/cli/check.rb +1 -1
  18. data/lib/bundler/cli/clean.rb +1 -1
  19. data/lib/bundler/cli/common.rb +30 -0
  20. data/lib/bundler/cli/doctor.rb +17 -19
  21. data/lib/bundler/cli/exec.rb +6 -0
  22. data/lib/bundler/cli/gem.rb +18 -4
  23. data/lib/bundler/cli/install.rb +9 -25
  24. data/lib/bundler/cli/lock.rb +8 -7
  25. data/lib/bundler/cli/outdated.rb +163 -56
  26. data/lib/bundler/cli/platform.rb +1 -1
  27. data/lib/bundler/cli/show.rb +1 -1
  28. data/lib/bundler/cli/update.rb +10 -23
  29. data/lib/bundler/compact_index_client.rb +108 -0
  30. data/lib/bundler/compact_index_client/cache.rb +119 -0
  31. data/lib/bundler/compact_index_client/updater.rb +88 -0
  32. data/lib/bundler/current_ruby.rb +4 -3
  33. data/lib/bundler/definition.rb +107 -17
  34. data/lib/bundler/dependency.rb +6 -0
  35. data/lib/bundler/dsl.rb +3 -2
  36. data/lib/bundler/env.rb +27 -18
  37. data/lib/bundler/errors.rb +22 -0
  38. data/lib/bundler/feature_flag.rb +32 -0
  39. data/lib/bundler/fetcher.rb +2 -2
  40. data/lib/bundler/fetcher/compact_index.rb +17 -5
  41. data/lib/bundler/fetcher/dependency.rb +1 -1
  42. data/lib/bundler/fetcher/downloader.rb +11 -0
  43. data/lib/bundler/friendly_errors.rb +28 -7
  44. data/lib/bundler/gem_helper.rb +1 -1
  45. data/lib/bundler/gem_helpers.rb +69 -1
  46. data/lib/bundler/gemdeps.rb +28 -0
  47. data/lib/bundler/index.rb +9 -4
  48. data/lib/bundler/inline.rb +3 -3
  49. data/lib/bundler/installer.rb +3 -2
  50. data/lib/bundler/installer/gem_installer.rb +2 -2
  51. data/lib/bundler/installer/parallel_installer.rb +40 -9
  52. data/lib/bundler/lazy_specification.rb +16 -1
  53. data/lib/bundler/lockfile_parser.rb +1 -2
  54. data/lib/bundler/match_platform.rb +12 -3
  55. data/lib/bundler/plugin.rb +4 -2
  56. data/lib/bundler/plugin/api.rb +2 -1
  57. data/lib/bundler/plugin/api/source.rb +1 -1
  58. data/lib/bundler/postit_trampoline.rb +12 -7
  59. data/lib/bundler/remote_specification.rb +5 -0
  60. data/lib/bundler/resolver.rb +59 -49
  61. data/lib/bundler/retry.rb +4 -1
  62. data/lib/bundler/ruby_version.rb +5 -0
  63. data/lib/bundler/rubygems_ext.rb +5 -0
  64. data/lib/bundler/rubygems_gem_installer.rb +60 -0
  65. data/lib/bundler/rubygems_integration.rb +28 -2
  66. data/lib/bundler/runtime.rb +2 -1
  67. data/lib/bundler/settings.rb +29 -5
  68. data/lib/bundler/setup.rb +1 -1
  69. data/lib/bundler/shared_helpers.rb +26 -15
  70. data/lib/bundler/source.rb +5 -0
  71. data/lib/bundler/source/git.rb +1 -1
  72. data/lib/bundler/source/git/git_proxy.rb +5 -0
  73. data/lib/bundler/source/path.rb +6 -1
  74. data/lib/bundler/source/rubygems.rb +11 -1
  75. data/lib/bundler/spec_set.rb +32 -13
  76. data/lib/bundler/templates/newgem/README.md.tt +1 -1
  77. data/lib/bundler/templates/newgem/bin/console.tt +1 -1
  78. data/lib/bundler/templates/newgem/gitignore.tt +5 -0
  79. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +1 -1
  80. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +10 -1
  81. data/lib/bundler/ui/shell.rb +4 -0
  82. data/lib/bundler/ui/silent.rb +9 -0
  83. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +7 -0
  84. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +1 -1
  85. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +2 -2
  86. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +2 -2
  87. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +62 -0
  88. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
  89. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +12 -1
  90. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +2 -2
  91. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
  92. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  93. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +22 -13
  94. data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/faster.rb +1 -0
  95. data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent.rb +24 -23
  96. data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent/ssl_reuse.rb +2 -1
  97. data/lib/bundler/vendored_persistent.rb +9 -4
  98. data/lib/bundler/version.rb +1 -1
  99. data/lib/bundler/worker.rb +27 -5
  100. data/lib/bundler/yaml_serializer.rb +1 -1
  101. data/man/bundle-config.ronn +29 -2
  102. data/man/bundle-install.ronn +1 -1
  103. data/man/bundle-lock.ronn +47 -0
  104. data/man/bundle-outdated.ronn +107 -0
  105. data/man/bundle-update.ronn +152 -3
  106. data/man/bundle.ronn +27 -9
  107. data/man/gemfile.5.ronn +8 -0
  108. metadata +37 -31
  109. data/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb +0 -79
  110. data/lib/bundler/vendor/compact_index_client/lib/compact_index_client/cache.rb +0 -112
  111. data/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb +0 -80
  112. data/lib/bundler/vendor/compact_index_client/lib/compact_index_client/version.rb +0 -4
@@ -7,7 +7,7 @@
7
7
  # This class is an implementation detail and is subject to change or removal
8
8
  # at any time.
9
9
 
10
- class Net::HTTP::Persistent::SSLReuse < Net::HTTP
10
+ class Bundler::Persistent::Net::HTTP::Persistent::SSLReuse < Net::HTTP
11
11
 
12
12
  @is_proxy_class = false
13
13
  @proxy_addr = nil
@@ -126,3 +126,4 @@ class Net::HTTP::Persistent::SSLReuse < Net::HTTP
126
126
  private :connect
127
127
 
128
128
  end
129
+
@@ -6,7 +6,12 @@ begin
6
6
  rescue LoadError
7
7
  # some Ruby builds don't have OpenSSL
8
8
  end
9
-
10
- vendor = File.expand_path("../vendor", __FILE__)
11
- $:.unshift(vendor) unless $:.include?(vendor)
12
- require "net/http/persistent"
9
+ module Bundler
10
+ module Persistent
11
+ module Net
12
+ module HTTP
13
+ end
14
+ end
15
+ end
16
+ end
17
+ require "bundler/vendor/net-http-persistent/lib/net/http/persistent"
@@ -7,5 +7,5 @@ module Bundler
7
7
  # We're doing this because we might write tests that deal
8
8
  # with other versions of bundler and we are unsure how to
9
9
  # handle this better.
10
- VERSION = "1.13.7" unless defined?(::Bundler::VERSION)
10
+ VERSION = "1.14.0.pre.1" unless defined?(::Bundler::VERSION)
11
11
  end
@@ -25,11 +25,8 @@ module Bundler
25
25
  @request_queue = Queue.new
26
26
  @response_queue = Queue.new
27
27
  @func = func
28
- @threads = Array.new(size) do |i|
29
- Thread.start { process_queue(i) }.tap do |thread|
30
- thread.name = "#{name} Worker ##{i}" if thread.respond_to?(:name=)
31
- end
32
- end
28
+ @size = size
29
+ @threads = nil
33
30
  trap("INT") { abort_threads }
34
31
  end
35
32
 
@@ -37,6 +34,7 @@ module Bundler
37
34
  #
38
35
  # @param obj [String] mostly it is name of spec that should be downloaded
39
36
  def enq(obj)
37
+ create_threads unless @threads
40
38
  @request_queue.enq obj
41
39
  end
42
40
 
@@ -70,13 +68,37 @@ module Bundler
70
68
  # Stop the worker threads by sending a poison object down the request queue
71
69
  # so as worker threads after retrieving it, shut themselves down
72
70
  def stop_threads
71
+ return unless @threads
73
72
  @threads.each { @request_queue.enq POISON }
74
73
  @threads.each(&:join)
74
+ @threads = nil
75
75
  end
76
76
 
77
77
  def abort_threads
78
+ return unless @threads
78
79
  @threads.each(&:exit)
79
80
  exit 1
80
81
  end
82
+
83
+ def create_threads
84
+ creation_errors = []
85
+
86
+ @threads = Array.new(@size) do |i|
87
+ begin
88
+ Thread.start { process_queue(i) }.tap do |thread|
89
+ thread.name = "#{name} Worker ##{i}" if thread.respond_to?(:name=)
90
+ end
91
+ rescue ThreadError => e
92
+ creation_errors << e
93
+ nil
94
+ end
95
+ end.compact
96
+
97
+ return if creation_errors.empty?
98
+
99
+ message = "Failed to create threads for the #{name} worker: #{creation_errors.map(&:to_s).uniq.join(", ")}"
100
+ raise ThreadCreationError, message if @threads.empty?
101
+ Bundler.ui.info message
102
+ end
81
103
  end
82
104
  end
@@ -52,7 +52,7 @@ module Bundler
52
52
  stack = [res]
53
53
  last_hash = nil
54
54
  last_empty_key = nil
55
- str.split("\n").each do |line|
55
+ str.split(/\r?\n/).each do |line|
56
56
  if match = HASH_REGEX.match(line)
57
57
  indent, key, _, val = match.captures
58
58
  key = convert_to_backward_compatible_key(key)
@@ -65,7 +65,7 @@ The options that can be configured are:
65
65
  The location to install the specified gems to. This defaults to Rubygems'
66
66
  setting. Bundler shares this location with Rubygems, `gem install ...` will
67
67
  have gem installed there, too. Therefore, gems installed without a
68
- `--path ...` setting will show up by calling `gem list`. Accodingly, gems
68
+ `--path ...` setting will show up by calling `gem list`. Accordingly, gems
69
69
  installed to other locations will not get listed.
70
70
 
71
71
  * `without`:
@@ -142,7 +142,7 @@ learn more about their operation in [bundle install(1)][bundle-install].
142
142
  and key in PEM format.
143
143
  * `cache_path` (`BUNDLE_CACHE_PATH`): The directory that bundler will place
144
144
  cached gems in when running <code>bundle package</code>, and that bundler
145
- will look in when installing gems.
145
+ will look in when installing gems. Defaults to `vendor/bundle`.
146
146
  * `disable_multisource` (`BUNDLE_DISABLE_MULTISOURCE`): When set, Gemfiles
147
147
  containing multiple sources will produce errors instead of warnings. Use
148
148
  `bundle config --delete disable_multisource` to unset.
@@ -155,6 +155,20 @@ learn more about their operation in [bundle install(1)][bundle-install].
155
155
  The number of redirects allowed for network requests. Defaults to `5`.
156
156
  * `timeout` (`BUNDLE_TIMEOUT`):
157
157
  The seconds allowed before timing out for network requests. Defaults to `10`.
158
+ * `force_ruby_platform` (`BUNDLE_FORCE_RUBY_PLATFORM`):
159
+ Ignore the current machine's platform and install only `ruby` platform gems.
160
+ As a result, gems with native extensions will be compiled from source.
161
+ * `specific_platform` (`BUNDLE_SPECIFIC_PLATFORM`):
162
+ Allow bundler to resolve for the specific running platform and store it in
163
+ the lockfile, instead of only using a generic platform.
164
+ A specific platform is the exact platform triple reported by
165
+ `Gem::Platform.local`, such as `x86_64-darwin-16` or `universal-java-1.8`.
166
+ On the other hand, generic platforms are those such as `ruby`, `mswin`, or
167
+ `java`. In this example, `x86_64-darwin-16` would map to `ruby` and
168
+ `universal-java-1.8` to `java`.
169
+ * `disable_checksum_validation` (`BUNDLE_DISABLE_CHECKSUM_VALIDATION`):
170
+ Allow installing gems even if they do not match the checksum provided by
171
+ RubyGems.
158
172
 
159
173
  In general, you should set these settings per-application by using the applicable
160
174
  flag to the [bundle install(1)][bundle-install] or [bundle package(1)][bundle-package] command.
@@ -223,3 +237,16 @@ For example, to save the credentials of user `claudette` for the gem source at
223
237
  Or you can set the credentials as an environment variable like this:
224
238
 
225
239
  export BUNDLE_GEMS__LONGEROUS__COM="claudette:s00pers3krit"
240
+
241
+ For gems with a git source with HTTP(S) URL you can specify credentials like so:
242
+
243
+ bundle config https://github.com/bundler/bundler.git username:password
244
+
245
+ Or you can set the credentials as an environment variable like so:
246
+
247
+ export BUNDLE_GITHUB__COM=username:password
248
+
249
+ This is especially useful for private repositories on hosts such as Github,
250
+ where you can use personal OAuth tokens:
251
+
252
+ export BUNDLE_GITHUB__COM=abcd0123generatedtoken:x-oauth-basic
@@ -110,7 +110,7 @@ time `bundle install` is run, use `bundle config` (see bundle-config(1)).
110
110
  The location to install the specified gems to. This defaults to Rubygems'
111
111
  setting. Bundler shares this location with Rubygems, `gem install ...` will
112
112
  have gem installed there, too. Therefore, gems installed without a
113
- `--path ...` setting will show up by calling `gem list`. Accodingly, gems
113
+ `--path ...` setting will show up by calling `gem list`. Accordingly, gems
114
114
  installed to other locations will not get listed.
115
115
 
116
116
  * `--quiet`:
@@ -7,6 +7,14 @@ bundle-lock(1) -- Creates / Updates a lockfile without installing
7
7
  [--local]
8
8
  [--print]
9
9
  [--lockfile=PATH]
10
+ [--full-index]
11
+ [--add-platform]
12
+ [--remove-platform]
13
+ [--patch]
14
+ [--minor]
15
+ [--major]
16
+ [--strict]
17
+ [--conservative]
10
18
 
11
19
  ## DESCRIPTION
12
20
 
@@ -30,6 +38,31 @@ Lock the gems specified in Gemfile.
30
38
  * `--lockfile=<path>`:
31
39
  The path where the lockfile should be written to.
32
40
 
41
+ * `--full-index`:
42
+ Fall back to using the single-file index of all gems.
43
+
44
+ * `--add-platform`:
45
+ Add a new platform to the lockfile, re-resolving for the addition of that
46
+ platform.
47
+
48
+ * `--remove-platform`:
49
+ Remove a platform from the lockfile.
50
+
51
+ * `--patch`:
52
+ If updating, prefer updating only to next patch version.
53
+
54
+ * `--minor`:
55
+ If updating, prefer updating only to next minor version.
56
+
57
+ * `--major`:
58
+ If updating, prefer updating to next major version (default).
59
+
60
+ * `--strict`:
61
+ If updating, do not allow any gem to be updated past latest --patch | --minor | --major.
62
+
63
+ * `--conservative`:
64
+ If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated.
65
+
33
66
  ## UPDATING ALL GEMS
34
67
 
35
68
  If you run `bundle lock` with `--update` option without list of gems, bundler will
@@ -45,3 +78,17 @@ For instance, you only want to update `nokogiri`, run `bundle lock --update noko
45
78
 
46
79
  Bundler will update `nokogiri` and any of its dependencies, but leave the rest of the
47
80
  gems that you specified locked to the versions in the `Gemfile.lock`.
81
+
82
+ ## SUPPORTING OTHER PLATFORMS
83
+
84
+ If you want your bundle to support platforms other than the one you're running
85
+ locally, you can run `bundle lock --add-platform PLATFORM` to add PLATFORM to
86
+ the lockfile, force bundler to re-resolve and consider the new platform when
87
+ picking gems, all without needing to have a machine that matches PLATFORM handy
88
+ to install those platform-specific gems on.
89
+
90
+ For a full explanation of gem platforms, see `gem help platform`.
91
+
92
+ ## PATCH LEVEL OPTIONS
93
+
94
+ See [bundle update(1)][bundle-update] for details.
@@ -0,0 +1,107 @@
1
+ bundle-outdated(1) -- List installed gems with newer versions available
2
+ =======================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bundle outdated` [GEM] [--local]
7
+ [--pre]
8
+ [--source]
9
+ [--strict]
10
+ [--parseable | --porcelain]
11
+ [--group=GROUP]
12
+ [--groups]
13
+ [--update-strict]
14
+ [--patch|--minor|--major]
15
+ [--filter-major]
16
+ [--filter-minor]
17
+ [--filter-patch]
18
+
19
+ ## DESCRIPTION
20
+
21
+ Outdated lists the names and versions of gems that have a newer version available
22
+ in the given source. Calling outdated with [GEM [GEM]] will only check for newer
23
+ versions of the given gems. Prerelease gems are ignored by default. If your gems
24
+ are up to date, Bundler will exit with a status of 0. Otherwise, it will exit 1.
25
+
26
+ ## OPTIONS
27
+
28
+ * `--local`:
29
+ Do not attempt to fetch gems remotely and use the gem cache instead.
30
+
31
+ * `--pre`:
32
+ Check for newer pre-release gems.
33
+
34
+ * `--source`:
35
+ Check against a specific source.
36
+
37
+ * `--strict`:
38
+ Only list newer versions allowed by your Gemfile requirements.
39
+
40
+ * `--parseable`:
41
+ Use minimal formatting for more parseable output.
42
+
43
+ * `--group`:
44
+ List gems from a specific group.
45
+
46
+ * `--groups`:
47
+ List gems organized by groups.
48
+
49
+ * `--update-strict`:
50
+ Strict conservative resolution, do not allow any gem to be updated past latest --patch | --minor| --major.
51
+
52
+ * `--minor`:
53
+ Prefer updating only to next minor version.
54
+
55
+ * `--major`:
56
+ Prefer updating to next major version (default).
57
+
58
+ * `--patch`:
59
+ Prefer updating only to next patch version.
60
+
61
+ * `--filter-major`:
62
+ Only list major newer versions.
63
+
64
+ * `--filter-minor`:
65
+ Only list minor newer versions.
66
+
67
+ * `--filter-patch`:
68
+ Only list patch newer versions.
69
+
70
+ ## PATCH LEVEL OPTIONS
71
+
72
+ See [bundle update(1)][bundle-update] for details.
73
+
74
+ One difference between the patch level options in `bundle update` and here is the `--strict` option.
75
+ `--strict` was already an option on outdated before the patch level options were added. `--strict`
76
+ wasn't altered, and the `--update-strict` option on `outdated` reflects what `--strict` does on
77
+ `bundle update`.
78
+
79
+ ## FILTERING OUTPUT
80
+
81
+ The 3 filtering options do not affect the resolution of versions, merely what versions are shown
82
+ in the output.
83
+
84
+ If the regular output shows the following:
85
+
86
+ * faker (newest 1.6.6, installed 1.6.5, requested ~> 1.4) in groups "development, test"
87
+ * hashie (newest 3.4.6, installed 1.2.0, requested = 1.2.0) in groups "default"
88
+ * headless (newest 2.3.1, installed 2.2.3) in groups "test"
89
+
90
+ `--filter-major` would only show:
91
+
92
+ * hashie (newest 3.4.6, installed 1.2.0, requested = 1.2.0) in groups "default"
93
+
94
+ `--filter-minor` would only show:
95
+
96
+ * headless (newest 2.3.1, installed 2.2.3) in groups "test"
97
+
98
+ `--filter-patch` would only show:
99
+
100
+ * faker (newest 1.6.6, installed 1.6.5, requested ~> 1.4) in groups "development, test"
101
+
102
+ Filter options can be combined. `--filter-minor` and `--filter-patch` would show:
103
+
104
+ * faker (newest 1.6.6, installed 1.6.5, requested ~> 1.4) in groups "development, test"
105
+ * headless (newest 2.3.1, installed 2.2.3) in groups "test"
106
+
107
+ Combining all three `filter` options would be the same result as providing none of them.
@@ -3,7 +3,18 @@ bundle-update(1) -- Update your gems to the latest available versions
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `bundle update` <*gems> [--group=NAME] [--source=NAME] [--local] [--ruby]
6
+ `bundle update` <*gems> [--group=NAME]
7
+ [--source=NAME]
8
+ [--local]
9
+ [--ruby]
10
+ [--bundler[=VERSION]]
11
+ [--full-index]
12
+ [--jobs=JOBS]
13
+ [--quiet]
14
+ [--force]
15
+ [--patch|--minor|--major]
16
+ [--strict]
17
+ [--conservative]
7
18
 
8
19
  ## DESCRIPTION
9
20
 
@@ -37,6 +48,33 @@ gem.
37
48
  * `--bundler`:
38
49
  Update the locked version of bundler to the invoked bundler version.
39
50
 
51
+ * `--full-index`:
52
+ Fall back to using the single-file index of all gems.
53
+
54
+ * `--jobs`:
55
+ Specify the number of jobs to run in parallel.
56
+
57
+ * `--quiet`:
58
+ Only output warnings and errors.
59
+
60
+ * `--force`:
61
+ Force downloading every gem.
62
+
63
+ * `--patch`:
64
+ Prefer updating only to next patch version.
65
+
66
+ * `--minor`:
67
+ Prefer updating only to next minor version.
68
+
69
+ * `--major`:
70
+ Prefer updating to next major version (default).
71
+
72
+ * `--strict`:
73
+ Do not allow any gem to be updated past latest `--patch` | `--minor` | `--major`.
74
+
75
+ * `--conservative`:
76
+ Use bundle install conservative update behavior and do not allow shared dependencies to be updated.
77
+
40
78
  ## UPDATING ALL GEMS
41
79
 
42
80
  If you run `bundle update` with no parameters, bundler will ignore
@@ -146,14 +184,125 @@ In this case, the two gems have their own set of dependencies, but they share
146
184
  `bundle update thin` will update `rack` even though it's _also_ a dependency of
147
185
  `rack-perftools_profiler`.
148
186
 
149
- `In short`, when you update a gem using `bundle update`, bundler will update all
150
- dependencies of that gem, including those that are also dependencies of another gem.
187
+ In short, by default, when you update a gem using `bundle update`, bundler will
188
+ update all dependencies of that gem, including those that are also dependencies
189
+ of another gem.
190
+
191
+ To prevent updating shared dependencies, prior to version 1.14 the only option
192
+ was the `CONSERVATIVE UPDATING` behavior in [bundle install(1)][bundle-install]:
151
193
 
152
194
  In this scenario, updating the `thin` version manually in the Gemfile(5),
153
195
  and then running [bundle install(1)][bundle-install] will only update `daemons` and `eventmachine`,
154
196
  but not `rack`. For more information, see the `CONSERVATIVE UPDATING` section
155
197
  of [bundle install(1)][bundle-install].
156
198
 
199
+ Starting with 1.14, specifying the `--conservative` option will also prevent shared
200
+ dependencies from being updated.
201
+
202
+ ## PATCH LEVEL OPTIONS
203
+
204
+ Version 1.14 introduced 4 patch-level options that will influence how gem
205
+ versions are resolved. One of the following options can be used: `--patch`,
206
+ `--minor` or `--major`. `--strict` can be added to further influence resolution.
207
+
208
+ * `--patch`:
209
+ Prefer updating only to next patch version.
210
+
211
+ * `--minor`:
212
+ Prefer updating only to next minor version.
213
+
214
+ * `--major`:
215
+ Prefer updating to next major version (default).
216
+
217
+ * `--strict`:
218
+ Do not allow any gem to be updated past latest `--patch` | `--minor` | `--major`.
219
+
220
+ When Bundler is resolving what versions to use to satisfy declared
221
+ requirements in the Gemfile or in parent gems, it looks up all
222
+ available versions, filters out any versions that don't satisfy
223
+ the requirement, and then, by default, sorts them from newest to
224
+ oldest, considering them in that order.
225
+
226
+ Providing one of the patch level options (e.g. `--patch`) changes the
227
+ sort order of the satisfying versions, causing Bundler to consider the
228
+ latest `--patch` or `--minor` version available before other versions.
229
+ Note that versions outside the stated patch level could still be
230
+ resolved to if necessary to find a suitable dependency graph.
231
+
232
+ For example, if gem 'foo' is locked at 1.0.2, with no gem requirement
233
+ defined in the Gemfile, and versions 1.0.3, 1.0.4, 1.1.0, 1.1.1, 2.0.0
234
+ all exist, the default order of preference by default (`--major`) will
235
+ be "2.0.0, 1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2".
236
+
237
+ If the `--patch` option is used, the order of preference will change to
238
+ "1.0.4, 1.0.3, 1.0.2, 1.1.1, 1.1.0, 2.0.0".
239
+
240
+ If the `--minor` option is used, the order of preference will change to
241
+ "1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2, 2.0.0".
242
+
243
+ Combining the `--strict` option with any of the patch level options
244
+ will remove any versions beyond the scope of the patch level option,
245
+ to ensure that no gem is updated that far.
246
+
247
+ To continue the previous example, if both `--patch` and `--strict`
248
+ options are used, the available versions for resolution would be
249
+ "1.0.4, 1.0.3, 1.0.2". If `--minor` and `--strict` are used, it would
250
+ be "1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2".
251
+
252
+ Gem requirements as defined in the Gemfile will still be the first
253
+ determining factor for what versions are available. If the gem
254
+ requirement for `foo` in the Gemfile is '~> 1.0', that will accomplish
255
+ the same thing as providing the `--minor` and `--strict` options.
256
+
257
+ ## PATCH LEVEL EXAMPLES
258
+
259
+ Given the following gem specifications:
260
+
261
+ foo 1.4.3, requires: ~> bar 2.0
262
+ foo 1.4.4, requires: ~> bar 2.0
263
+ foo 1.4.5, requires: ~> bar 2.1
264
+ foo 1.5.0, requires: ~> bar 2.1
265
+ foo 1.5.1, requires: ~> bar 3.0
266
+ bar with versions 2.0.3, 2.0.4, 2.1.0, 2.1.1, 3.0.0
267
+
268
+ Gemfile:
269
+
270
+ gem 'foo'
271
+
272
+ Gemfile.lock:
273
+
274
+ foo (1.4.3)
275
+ bar (~> 2.0)
276
+ bar (2.0.3)
277
+
278
+ Cases:
279
+
280
+ # Command Line Result
281
+ ------------------------------------------------------------
282
+ 1 bundle update --patch 'foo 1.4.5', 'bar 2.1.1'
283
+ 2 bundle update --patch foo 'foo 1.4.5', 'bar 2.1.1'
284
+ 3 bundle update --minor 'foo 1.5.1', 'bar 3.0.0'
285
+ 4 bundle update --minor --strict 'foo 1.5.0', 'bar 2.1.1'
286
+ 5 bundle update --patch --strict 'foo 1.4.4', 'bar 2.0.4'
287
+
288
+ In case 1, bar is upgraded to 2.1.1, a minor version increase, because
289
+ the dependency from foo 1.4.5 required it.
290
+
291
+ In case 2, only foo is requested to be unlocked, but bar is also
292
+ allowed to move because it's not a declared dependency in the Gemfile.
293
+
294
+ In case 3, bar goes up a whole major release, because a minor increase
295
+ is preferred now for foo, and when it goes to 1.5.1, it requires 3.0.0
296
+ of bar.
297
+
298
+ In case 4, foo is preferred up to a minor version, but 1.5.1 won't work
299
+ because the --strict flag removes bar 3.0.0 from consideration since
300
+ it's a major increment.
301
+
302
+ In case 5, both foo and bar have any minor or major increments removed
303
+ from consideration because of the --strict flag, so the most they can
304
+ move is up to 1.4.4 and 2.0.4.
305
+
157
306
  ## RECOMMENDED WORKFLOW
158
307
 
159
308
  In general, when working with an application managed with bundler, you should