[DRE-commits] [bundler] 01/07: New upstream version 1.15.1

Lucas Nussbaum lucas at moszumanska.debian.org
Mon Jul 3 20:19:30 UTC 2017


This is an automated email from the git hooks/post-receive script.

lucas pushed a commit to branch master
in repository bundler.

commit 02d2f0641d67f5472de4eb7ce559797d0f187280
Author: Lucas Nussbaum <lucas at debian.org>
Date:   Sun Jul 2 09:24:34 2017 +0200

    New upstream version 1.15.1
---
 .gitignore                                         |    2 +
 .rubocop.yml                                       |    5 +-
 .rubocop_todo.yml                                  |  238 +++-
 .travis.yml                                        |   50 +-
 CHANGELOG.md                                       |  243 +++-
 CODE_OF_CONDUCT.md                                 |    2 +-
 CONTRIBUTING.md                                    |   39 +-
 DEVELOPMENT.md                                     |  148 ---
 README.md                                          |   22 +-
 Rakefile                                           |   61 +-
 bin/rubocop                                        |    2 +-
 bundler.gemspec                                    |   19 +-
 doc/README.md                                      |   30 +
 doc/TROUBLESHOOTING.md                             |   64 +
 doc/contributing/BUG_TRIAGE.md                     |   36 +
 doc/contributing/COMMUNITY.md                      |   13 +
 doc/contributing/GETTING_HELP.md                   |   11 +
 doc/contributing/HOW_YOU_CAN_HELP.md               |   27 +
 ISSUES.md => doc/contributing/ISSUES.md            |   61 +-
 doc/contributing/README.md                         |   38 +
 doc/development/NEW_FEATURES.md                    |   10 +
 doc/development/PULL_REQUESTS.md                   |   40 +
 doc/development/README.md                          |   19 +
 doc/development/RELEASING.md                       |    9 +
 doc/development/SETUP.md                           |   29 +
 doc/documentation/README.md                        |   29 +
 doc/documentation/VISION.md                        |   26 +
 doc/documentation/WRITING.md                       |   54 +
 exe/bundle                                         |   15 +-
 lib/bundler.rb                                     |  102 +-
 lib/bundler/cli.rb                                 |  190 ++-
 lib/bundler/cli/add.rb                             |   26 +
 lib/bundler/cli/binstubs.rb                        |    2 +-
 lib/bundler/cli/cache.rb                           |    2 +-
 lib/bundler/cli/check.rb                           |    4 +-
 lib/bundler/cli/clean.rb                           |    2 +-
 lib/bundler/cli/common.rb                          |   37 +
 lib/bundler/cli/config.rb                          |   30 +-
 lib/bundler/cli/doctor.rb                          |   36 +-
 lib/bundler/cli/exec.rb                            |    6 +
 lib/bundler/cli/gem.rb                             |   59 +-
 lib/bundler/cli/info.rb                            |   51 +
 lib/bundler/cli/init.rb                            |    4 +-
 lib/bundler/cli/inject.rb                          |   16 +-
 lib/bundler/cli/install.rb                         |   36 +-
 lib/bundler/cli/issue.rb                           |   40 +
 lib/bundler/cli/lock.rb                            |   16 +-
 lib/bundler/cli/open.rb                            |    3 +-
 lib/bundler/cli/outdated.rb                        |  220 +++-
 lib/bundler/cli/platform.rb                        |    2 +-
 lib/bundler/cli/pristine.rb                        |   33 +
 lib/bundler/cli/show.rb                            |    3 +-
 lib/bundler/cli/update.rb                          |   40 +-
 lib/bundler/cli/viz.rb                             |    2 +-
 lib/bundler/compact_index_client.rb                |  108 ++
 lib/bundler/compact_index_client/cache.rb          |  119 ++
 lib/bundler/compact_index_client/updater.rb        |   88 ++
 lib/bundler/current_ruby.rb                        |    7 +-
 lib/bundler/definition.rb                          |  256 ++--
 lib/bundler/dependency.rb                          |   14 +-
 lib/bundler/dsl.rb                                 |   13 +-
 lib/bundler/endpoint_specification.rb              |    5 +-
 lib/bundler/env.rb                                 |   57 +-
 lib/bundler/errors.rb                              |   23 +
 lib/bundler/feature_flag.rb                        |   32 +
 lib/bundler/fetcher.rb                             |    4 +-
 lib/bundler/fetcher/compact_index.rb               |   21 +-
 lib/bundler/fetcher/dependency.rb                  |    2 +-
 lib/bundler/fetcher/downloader.rb                  |   16 +-
 lib/bundler/friendly_errors.rb                     |   35 +-
 lib/bundler/gem_helper.rb                          |    7 +-
 lib/bundler/gem_helpers.rb                         |   70 +-
 lib/bundler/gemdeps.rb                             |   28 +
 lib/bundler/index.rb                               |   27 +-
 lib/bundler/injector.rb                            |   43 +-
 lib/bundler/inline.rb                              |    8 +-
 lib/bundler/installer.rb                           |    7 +-
 lib/bundler/installer/gem_installer.rb             |    6 +-
 lib/bundler/installer/parallel_installer.rb        |   69 +-
 lib/bundler/lazy_specification.rb                  |   33 +-
 lib/bundler/lockfile_parser.rb                     |   79 +-
 lib/bundler/match_platform.rb                      |   15 +-
 lib/bundler/mirror.rb                              |    2 +
 lib/bundler/plugin.rb                              |   12 +-
 lib/bundler/plugin/api.rb                          |    3 +-
 lib/bundler/plugin/api/source.rb                   |   10 +-
 lib/bundler/plugin/index.rb                        |    2 +
 lib/bundler/postit_trampoline.rb                   |   19 +-
 lib/bundler/remote_specification.rb                |   22 +-
 lib/bundler/resolver.rb                            |  142 ++-
 lib/bundler/retry.rb                               |    5 +-
 lib/bundler/ruby_version.rb                        |   11 +-
 lib/bundler/rubygems_ext.rb                        |   22 +-
 lib/bundler/rubygems_gem_installer.rb              |   60 +
 lib/bundler/rubygems_integration.rb                |  160 ++-
 lib/bundler/runtime.rb                             |   43 +-
 lib/bundler/settings.rb                            |   45 +-
 lib/bundler/setup.rb                               |    4 +-
 lib/bundler/shared_helpers.rb                      |   74 +-
 lib/bundler/source.rb                              |   23 +-
 lib/bundler/source/git.rb                          |   36 +-
 lib/bundler/source/git/git_proxy.rb                |   12 +-
 lib/bundler/source/path.rb                         |   44 +-
 lib/bundler/source/path/installer.rb               |    4 +-
 lib/bundler/source/rubygems.rb                     |   20 +-
 lib/bundler/source/rubygems/remote.rb              |    4 +
 lib/bundler/spec_set.rb                            |   85 +-
 lib/bundler/stub_specification.rb                  |   87 +-
 lib/bundler/templates/Executable                   |    2 +-
 lib/bundler/templates/Executable.standalone        |   10 +-
 lib/bundler/templates/newgem/Gemfile.tt            |    4 +-
 lib/bundler/templates/newgem/LICENSE.txt.tt        |    2 +-
 lib/bundler/templates/newgem/README.md.tt          |   20 +-
 lib/bundler/templates/newgem/Rakefile.tt           |   10 +-
 lib/bundler/templates/newgem/bin/console.tt        |    2 +-
 .../templates/newgem/ext/newgem/newgem.c.tt        |    8 +-
 .../templates/newgem/ext/newgem/newgem.h.tt        |    6 +-
 lib/bundler/templates/newgem/gitignore.tt          |    5 +
 lib/bundler/templates/newgem/lib/newgem.rb.tt      |   12 +-
 .../templates/newgem/lib/newgem/version.rb.tt      |    8 +-
 lib/bundler/templates/newgem/newgem.gemspec.tt     |   18 +-
 .../templates/newgem/test/newgem_test.rb.tt        |    2 +-
 .../templates/newgem/test/test_helper.rb.tt        |    6 +-
 lib/bundler/ui/shell.rb                            |   19 +-
 lib/bundler/ui/silent.rb                           |   21 +-
 .../lib/compact_index_client.rb                    |   79 --
 .../lib/compact_index_client/cache.rb              |  112 --
 .../lib/compact_index_client/updater.rb            |   80 --
 .../lib/compact_index_client/version.rb            |    4 -
 .../net-http-persistent/lib/net/http/faster.rb     |   27 +
 .../net-http-persistent/lib/net/http/persistent.rb | 1231 ++++++++++++++++++++
 .../lib/net/http/persistent/ssl_reuse.rb           |  129 ++
 lib/bundler/vendored_persistent.rb                 |   13 +-
 lib/bundler/vendored_thor.rb                       |    7 +-
 lib/bundler/version.rb                             |   15 +-
 lib/bundler/version_ranges.rb                      |   75 ++
 lib/bundler/worker.rb                              |   35 +-
 lib/bundler/yaml_serializer.rb                     |    2 +-
 man/bundle-add.1                                   |   43 +
 man/bundle-add.1.txt                               |   40 +
 man/bundle-add.ronn                                |   29 +
 man/bundle-binstubs.1                              |   30 +
 man/bundle-binstubs.1.txt                          |   33 +
 man/bundle-check.1                                 |   31 +
 man/bundle-check.1.txt                             |   32 +
 man/bundle-check.ronn                              |   26 +
 man/bundle-clean.1                                 |   24 +
 man/bundle-clean.1.txt                             |   26 +
 man/bundle-clean.ronn                              |   18 +
 man/bundle-config.1                                |  397 +++++++
 man/bundle-config.1.txt                            |  418 +++++++
 man/bundle-config.ronn                             |  101 +-
 man/bundle-exec.1                                  |  162 +++
 man/bundle-exec.1.txt                              |  171 +++
 man/bundle-gem.1                                   |   80 ++
 man/bundle-gem.1.txt                               |   90 ++
 man/bundle-info.1                                  |   20 +
 man/bundle-info.1.txt                              |   21 +
 man/bundle-info.ronn                               |   17 +
 man/bundle-init.1                                  |   20 +
 man/bundle-init.1.txt                              |   24 +
 man/bundle-init.ronn                               |   18 +
 man/bundle-inject.1                                |   33 +
 man/bundle-inject.1.txt                            |   32 +
 man/bundle-inject.ronn                             |   22 +
 man/bundle-install.1                               |  305 +++++
 man/bundle-install.1.txt                           |  385 ++++++
 man/bundle-install.ronn                            |    2 +-
 man/bundle-lock.1                                  |   84 ++
 man/bundle-lock.1.txt                              |   93 ++
 man/bundle-lock.ronn                               |   47 +
 man/bundle-open.1                                  |   32 +
 man/bundle-open.1.txt                              |   29 +
 man/bundle-open.ronn                               |   19 +
 man/bundle-outdated.1                              |  151 +++
 man/bundle-outdated.1.txt                          |  127 ++
 man/bundle-outdated.ronn                           |  107 ++
 man/bundle-package.1                               |   52 +
 man/bundle-package.1.txt                           |   74 ++
 man/bundle-platform.1                              |   61 +
 man/bundle-platform.1.txt                          |   57 +
 man/bundle-pristine.1                              |   16 +
 man/bundle-pristine.1.txt                          |   21 +
 man/bundle-pristine.ronn                           |   13 +
 man/bundle-show.1                                  |   23 +
 man/bundle-show.1.txt                              |   25 +
 man/bundle-show.ronn                               |   20 +
 man/bundle-update.1                                |  390 +++++++
 man/bundle-update.1.txt                            |  388 ++++++
 man/bundle-update.ronn                             |  158 ++-
 man/bundle-viz.1                                   |   39 +
 man/bundle-viz.1.txt                               |   37 +
 man/bundle-viz.ronn                                |   30 +
 man/bundle.1                                       |  137 +++
 man/bundle.1.txt                                   |  128 ++
 man/bundle.ronn                                    |   42 +-
 man/gemfile.5                                      |  653 +++++++++++
 man/gemfile.5.ronn                                 |   72 +-
 man/gemfile.5.txt                                  |  600 ++++++++++
 man/index.txt                                      |    7 +
 task/release.rake                                  |  116 ++
 201 files changed, 11513 insertions(+), 1396 deletions(-)

diff --git a/.gitignore b/.gitignore
index bd5d29d..88730f8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,6 +11,8 @@
 
 # output from ronn
 /lib/bundler/man/
+man/*
+!man/*.ronn
 
 # rspec failure tracking
 .rspec_status
diff --git a/.rubocop.yml b/.rubocop.yml
index b027d4c..96c9106 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -15,7 +15,7 @@ Lint/AssignmentInCondition:
   Enabled: false
 
 Lint/EndAlignment:
-  AlignWith: variable
+  EnforcedStyleAlignWith: variable
   AutoCorrect: true
 
 Lint/UnusedMethodArgument:
@@ -122,6 +122,9 @@ Metrics/CyclomaticComplexity:
 Metrics/ParameterLists:
   Enabled: false
 
+Metrics/BlockLength:
+  Enabled: false
+
 # It will be obvious which code is complex, Rubocop should only lint simple
 # rules for us.
 Metrics/PerceivedComplexity:
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 3a23005..7d16768 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,17 +1,31 @@
 # This configuration was generated by
 # `rubocop --auto-gen-config`
-# on 2016-07-27 12:41:39 -0500 using RuboCop version 0.41.2.
+# on 2017-04-08 17:26:10 -0500 using RuboCop version 0.48.0.
 # The point is for the user to remove these configuration records
 # one by one as the offenses are removed from the code base.
 # Note that changes in the inspected code, or installation of new
 # versions of RuboCop, may require this file to be generated again.
 
-# Offense count: 4
-Lint/Eval:
+# Offense count: 23
+Lint/AmbiguousBlockAssociation:
   Exclude:
-    - 'lib/bundler.rb'
-    - 'lib/bundler/endpoint_specification.rb'
-    - 'spec/support/streams.rb'
+    - 'lib/bundler/definition.rb'
+    - 'lib/bundler/resolver.rb'
+    - 'lib/bundler/runtime.rb'
+    - 'lib/bundler/source/path.rb'
+    - 'spec/bundler/compact_index_client/updater_spec.rb'
+    - 'spec/commands/init_spec.rb'
+    - 'spec/commands/install_spec.rb'
+    - 'spec/install/gems/flex_spec.rb'
+    - 'spec/lock/lockfile_spec.rb'
+    - 'spec/runtime/setup_spec.rb'
+    - 'spec/support/indexes.rb'
+
+# Offense count: 2
+Lint/EmptyWhen:
+  Exclude:
+    - 'lib/bundler/friendly_errors.rb'
+    - 'spec/support/builders.rb'
 
 # Offense count: 4
 Lint/HandleExceptions:
@@ -40,7 +54,14 @@ Lint/RescueException:
     - 'lib/bundler/rubygems_integration.rb'
     - 'lib/bundler/worker.rb'
 
+# Offense count: 2
+Lint/ShadowedException:
+  Exclude:
+    - 'lib/bundler.rb'
+    - 'lib/bundler/rubygems_integration.rb'
+
 # Offense count: 1
+# Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
 Lint/UselessAccessModifier:
   Exclude:
     - 'lib/bundler/fetcher.rb'
@@ -51,18 +72,18 @@ Lint/UselessAssignment:
     - 'lib/bundler/index.rb'
     - 'lib/bundler/installer.rb'
 
-# Offense count: 1686
-# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
+# Offense count: 451
+# Configuration parameters: CountComments, ExcludedMethods.
+Metrics/BlockLength:
+  Max: 988
+
+# Offense count: 2035
+# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
 # URISchemes: http, https
 Metrics/LineLength:
   Max: 207
 
-# Offense count: 3
-# Configuration parameters: CountKeywordArgs.
-Metrics/ParameterLists:
-  Max: 6
-
-# Offense count: 6
+# Offense count: 7
 # Cop supports --auto-correct.
 Performance/RedundantBlockCall:
   Exclude:
@@ -85,35 +106,55 @@ Performance/RedundantMatch:
 Performance/RedundantMerge:
   Exclude:
     - 'lib/bundler/cli/gem.rb'
-    - 'spec/support/helpers.rb'
+
+# Offense count: 4
+Security/Eval:
+  Exclude:
+    - 'lib/bundler.rb'
+    - 'lib/bundler/endpoint_specification.rb'
+    - 'spec/support/streams.rb'
+
+# Offense count: 6
+Security/MarshalLoad:
+  Exclude:
+    - 'lib/bundler.rb'
+    - 'spec/install/gems/resolving_spec.rb'
+    - 'spec/support/artifice/compact_index.rb'
+    - 'spec/support/artifice/endpoint.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+Security/YAMLLoad:
+  Exclude:
+    - 'spec/bundler/yaml_serializer_spec.rb'
+    - 'spec/commands/inject_spec.rb'
 
 # Offense count: 1
 Style/AccessorMethodName:
   Exclude:
     - 'lib/bundler/source/git.rb'
 
-# Offense count: 3
+# Offense count: 4
 Style/CaseEquality:
   Exclude:
     - 'lib/bundler/dsl.rb'
     - 'lib/bundler/match_platform.rb'
     - 'lib/bundler/rubygems_ext.rb'
 
-# Offense count: 23
+# Offense count: 25
 # Configuration parameters: EnforcedStyle, SupportedStyles.
 # SupportedStyles: nested, compact
 Style/ClassAndModuleChildren:
   Enabled: false
 
-# Offense count: 10
+# Offense count: 9
 # Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly.
+# Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly, IncludeTernaryExpressions.
 # SupportedStyles: assign_to_condition, assign_inside_condition
 Style/ConditionalAssignment:
   Exclude:
     - 'lib/bundler/cli.rb'
     - 'lib/bundler/cli/gem.rb'
-    - 'lib/bundler/cli/lock.rb'
     - 'lib/bundler/cli/platform.rb'
     - 'lib/bundler/dsl.rb'
     - 'lib/bundler/lazy_specification.rb'
@@ -122,10 +163,34 @@ Style/ConditionalAssignment:
     - 'lib/bundler/source/git.rb'
     - 'lib/bundler/source/rubygems.rb'
 
-# Offense count: 138
+# Offense count: 158
 Style/Documentation:
   Enabled: false
 
+# Offense count: 304
+# Cop supports --auto-correct.
+Style/EmptyLineAfterMagicComment:
+  Enabled: false
+
+# Offense count: 2
+# Cop supports --auto-correct.
+Style/EmptyLinesAroundExceptionHandlingKeywords:
+  Exclude:
+    - 'Rakefile'
+
+# Offense count: 17
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, SupportedStyles.
+# SupportedStyles: compact, expanded
+Style/EmptyMethod:
+  Exclude:
+    - 'exe/bundle_ruby'
+    - 'lib/bundler/cli.rb'
+    - 'lib/bundler/plugin/api/source.rb'
+    - 'lib/bundler/rubygems_integration.rb'
+    - 'lib/bundler/ui/silent.rb'
+    - 'spec/support/artifice/fail.rb'
+
 # Offense count: 2
 # Cop supports --auto-correct.
 # Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
@@ -133,13 +198,30 @@ Style/ExtraSpacing:
   Exclude:
     - 'lib/bundler/cli.rb'
 
-# Offense count: 4
+# Offense count: 2
 # Configuration parameters: AllowedVariables.
 Style/GlobalVars:
   Exclude:
     - 'lib/bundler/cli.rb'
     - 'spec/spec_helper.rb'
-    - 'spec/support/helpers.rb'
+
+# Offense count: 17
+# Configuration parameters: MinBodyLength.
+Style/GuardClause:
+  Exclude:
+    - 'lib/bundler/cli/cache.rb'
+    - 'lib/bundler/cli/clean.rb'
+    - 'lib/bundler/cli/install.rb'
+    - 'lib/bundler/cli/outdated.rb'
+    - 'lib/bundler/cli/package.rb'
+    - 'lib/bundler/definition.rb'
+    - 'lib/bundler/dsl.rb'
+    - 'lib/bundler/installer.rb'
+    - 'lib/bundler/runtime.rb'
+    - 'lib/bundler/source/path/installer.rb'
+    - 'lib/bundler/source_list.rb'
+    - 'spec/commands/newgem_spec.rb'
+    - 'spec/support/sometimes.rb'
 
 # Offense count: 1
 Style/IfInsideElse:
@@ -151,13 +233,49 @@ Style/IfUnlessModifierOfIfUnless:
   Exclude:
     - 'spec/support/helpers.rb'
 
-# Offense count: 4
+# Offense count: 10
 # Cop supports --auto-correct.
 # Configuration parameters: SupportedStyles, IndentationWidth.
 # SupportedStyles: special_inside_parentheses, consistent, align_brackets
 Style/IndentArray:
   EnforcedStyle: consistent
 
+# Offense count: 34
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, SupportedStyles.
+# SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
+Style/IndentHeredoc:
+  Enabled: false
+
+# Offense count: 9
+# Cop supports --auto-correct.
+# Configuration parameters: InverseMethods, InverseBlocks.
+Style/InverseMethods:
+  Exclude:
+    - 'lib/bundler/cli/doctor.rb'
+    - 'lib/bundler/definition.rb'
+    - 'lib/bundler/dsl.rb'
+    - 'lib/bundler/index.rb'
+    - 'lib/bundler/resolver.rb'
+
+# Offense count: 6
+Style/MethodMissing:
+  Exclude:
+    - 'lib/bundler/dep_proxy.rb'
+    - 'lib/bundler/dsl.rb'
+    - 'lib/bundler/lazy_specification.rb'
+    - 'lib/bundler/plugin/dsl.rb'
+    - 'lib/bundler/remote_specification.rb'
+    - 'spec/support/builders.rb'
+
+# Offense count: 2
+# Configuration parameters: EnforcedStyle, SupportedStyles.
+# SupportedStyles: separated, grouped
+Style/MixinGrouping:
+  Exclude:
+    - 'lib/bundler/spec_set.rb'
+    - 'spec/runtime/setup_spec.rb'
+
 # Offense count: 2
 # Configuration parameters: EnforcedStyle, SupportedStyles.
 # SupportedStyles: module_function, extend_self
@@ -166,6 +284,17 @@ Style/ModuleFunction:
     - 'lib/bundler/shared_helpers.rb'
     - 'spec/support/path.rb'
 
+# Offense count: 11
+# Cop supports --auto-correct.
+Style/MultilineIfModifier:
+  Exclude:
+    - 'bin/with_rubygems'
+    - 'lib/bundler/installer.rb'
+    - 'lib/bundler/psyched_yaml.rb'
+    - 'lib/bundler/rubygems_ext.rb'
+    - 'lib/bundler/runtime.rb'
+    - 'lib/bundler/source/rubygems.rb'
+
 # Offense count: 3
 # Cop supports --auto-correct.
 # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
@@ -183,6 +312,18 @@ Style/NestedParenthesizedCalls:
     - 'spec/commands/lock_spec.rb'
     - 'spec/runtime/setup_spec.rb'
 
+# Offense count: 6
+# Cop supports --auto-correct.
+# Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles.
+# SupportedStyles: predicate, comparison
+Style/NumericPredicate:
+  Exclude:
+    - 'spec/**/*'
+    - 'lib/bundler/gem_helper.rb'
+    - 'lib/bundler/mirror.rb'
+    - 'lib/bundler/source/git/git_proxy.rb'
+    - 'lib/bundler/source/path.rb'
+
 # Offense count: 9
 # Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
 # NamePrefix: is_, has_, have_
@@ -198,12 +339,27 @@ Style/PredicateName:
     - 'lib/bundler/source/git/git_proxy.rb'
     - 'lib/bundler/source/path.rb'
 
-# Offense count: 25
+# Offense count: 24
 # Cop supports --auto-correct.
 # Configuration parameters: EnforcedStyle, SupportedStyles.
 # SupportedStyles: compact, exploded
 Style/RaiseArgs:
-  Enabled: false
+  Exclude:
+    - 'lib/bundler/cli/install.rb'
+    - 'lib/bundler/deployment.rb'
+    - 'lib/bundler/fetcher/downloader.rb'
+    - 'lib/bundler/fetcher/index.rb'
+    - 'lib/bundler/installer/standalone.rb'
+    - 'lib/bundler/rubygems_integration.rb'
+    - 'lib/bundler/shared_helpers.rb'
+    - 'lib/bundler/source/git/git_proxy.rb'
+    - 'lib/bundler/source/rubygems/remote.rb'
+    - 'spec/bundler/endpoint_specification_spec.rb'
+    - 'spec/bundler/fetcher/dependency_spec.rb'
+    - 'spec/bundler/fetcher/downloader_spec.rb'
+    - 'spec/bundler/fetcher/index_spec.rb'
+    - 'spec/bundler/rubygems_integration_spec.rb'
+    - 'spec/bundler/shared_helpers_spec.rb'
 
 # Offense count: 2
 # Cop supports --auto-correct.
@@ -219,14 +375,31 @@ Style/SpaceAroundOperators:
   Exclude:
     - 'lib/bundler/retry.rb'
 
-# Offense count: 10
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces, SpaceBeforeBlockParameters.
+# SupportedStyles: space, no_space
+# SupportedStylesForEmptyBraces: space, no_space
+Style/SpaceInsideBlockBraces:
+  Exclude:
+    - 'lib/bundler/installer/parallel_installer.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, SupportedStyles, AllowSafeAssignment.
+# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex
+Style/TernaryParentheses:
+  Exclude:
+    - 'lib/bundler/cli/common.rb'
+    - 'lib/bundler/gem_version_promoter.rb'
+
+# Offense count: 9
 # Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
-# SupportedStyles: comma, consistent_comma, no_comma
+# Configuration parameters: EnforcedStyleForMultiline, SupportedStylesForMultiline.
+# SupportedStylesForMultiline: comma, consistent_comma, no_comma
 Style/TrailingCommaInLiteral:
   Exclude:
     - 'lib/bundler/cli/gem.rb'
-    - 'lib/bundler/dependency.rb'
     - 'lib/bundler/fetcher.rb'
     - 'lib/bundler/gem_helpers.rb'
     - 'lib/bundler/graph.rb'
@@ -234,7 +407,7 @@ Style/TrailingCommaInLiteral:
     - 'lib/bundler/similarity_detector.rb'
     - 'spec/support/artifice/endpoint.rb'
 
-# Offense count: 18
+# Offense count: 7
 # Cop supports --auto-correct.
 Style/UnneededInterpolation:
   Exclude:
@@ -243,6 +416,3 @@ Style/UnneededInterpolation:
     - 'spec/bundler/shared_helpers_spec.rb'
     - 'spec/cache/git_spec.rb'
     - 'spec/commands/exec_spec.rb'
-    - 'spec/support/artifice/endpoint.rb'
-    - 'spec/support/artifice/endpoint_500.rb'
-    - 'spec/support/fakeweb/windows.rb'
diff --git a/.travis.yml b/.travis.yml
index f8dd2dd..d257d82 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,11 +13,6 @@ branches:
     - /.+-stable$/
 
 notifications:
-  email:
-    # andre
-    - secure: "bCcvqJT7YrBawtkXXwHhT+jOFth7r2Qv/30PkkbhQxk6Jb3xambjCOJ3U6vJ\ngYmiL50exi5lUp3oc3SEbHN5t2CrZqOZDQ6o7P8EAmB5c0oH2RrYaFOkI5Gt\nul/jGH/96A9sj0aMwG7JfdMSfhqj1DUKAm2PnnbXPL853VfmT24="
-    # terence
-    - secure: "MQ8eA5Jb8YzEpAo58DRGfVJklAPcEbAulpBZnTxp0am6ldneDtJHbQk21w6R\nj5GsDHlzr/lMp/GHIimtUZ7rLohfND8fj/W7fs1Dkd4eN02/ERt98x3pHlqv\nvZgSnZ39uVYv+OcphraE24QaRaGWLhWZAMYQTVe/Yz50NyG8g1U="
   slack:
     on_success: change
     on_failure: always
@@ -30,9 +25,10 @@ addons:
       secure: "TrzIv116JLGUxm6PAUskCYrv8KTDguncKROVwbnjVPKTGDAgoDderd8JUdDEXrKoZ9qGLD2TPYKExt9/QDl71E+qHdWnVqWv4HKCUk2P9z/VLKzHuggOUBkCXiJUhjywUieCJhI3N92bfq2EjSBbu2/OFHqWOjLQ+QCooTEBjv8="
 
 rvm:
-  - 2.3.1
-  - 2.2
-  - 2.1
+  - 2.4.1
+  - 2.3.4
+  - 2.2.7
+  - 2.1.10
   - 2.0.0
   - 1.9.3
   - 1.8.7
@@ -43,14 +39,19 @@ env:
   # We need to know if changes to rubygems will break bundler on release
   - RGV=master
   # Test the latest rubygems release with all of our supported rubies
-  - RGV=v2.6.4
-  - RGV=v2.4.8
+  - RGV=v2.6.8
 
 matrix:
   include:
-    # Ruby 2.2, Rubygems 2.4.5 and up (included by RGV above)
+    # Ruby 2.4, Rubygems 2.6.8 and up
+    # Ruby 2.3, Rubygems 2.5.1 and up
+    - rvm: 2.2.6
+      env: RGV=v2.5.2
+    # Ruby 2.2, Rubygems 2.4.5 and up
+    - rvm: 2.2.6
+      env: RGV=v2.4.8
     # Ruby 2.1, Rubygems 2.2.2 and up
-    - rvm: 2.1
+    - rvm: 2.1.10
       env: RGV=v2.2.5
     # Ruby 2.0.0, Rubygems 2.0.0 and up
     - rvm: 2.0.0
@@ -74,9 +75,12 @@ matrix:
       env: RGV=v1.6.2
     - rvm: 1.9.3
       env: RGV=v1.5.3
+
     # Ruby 1.8.7, Rubygems 1.3.6 and up
     - rvm: 1.8.7
       env: RGV=v2.2.5
+    # ALLOWED FAILURES
+    # since the great Travis image outage, frequent random segfaults :'(
     - rvm: 1.8.7
       env: RGV=v2.0.14
     - rvm: 1.8.7
@@ -93,16 +97,26 @@ matrix:
       env: RGV=v1.3.7
     - rvm: 1.8.7
       env: RGV=v1.3.6
-
-    # ALLOWED FAILURES
-    # For no apparent reason, this often goes over the Travis limit
-    - rvm: 1.8.7
-      env: RGV=v2.1.11
     # Ruby-head (we want to know how we're doing, but not fail the build)
     - rvm: ruby-head
       env: RGV=master
 
   allow_failures:
     - rvm: 1.8.7
-      env: RGV=v2.1.11
+      env: RGV=v2.0.14
+    - rvm: 1.8.7
+      env: RGV=v1.8.29
+    - rvm: 1.8.7
+      env: RGV=v1.7.2
+    - rvm: 1.8.7
+      env: RGV=v1.6.2
+    - rvm: 1.8.7
+      env: RGV=v1.5.3
+    - rvm: 1.8.7
+      env: RGV=v1.4.2
+    - rvm: 1.8.7
+      env: RGV=v1.3.7
+    - rvm: 1.8.7
+      env: RGV=v1.3.6
     - rvm: ruby-head
+      env: RGV=master
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c02361f..98929ba 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,223 @@
+## 1.15.1 (2017-06-02)
+
+Bugfixes:
+
+  - `bundle lock --update GEM` will fail gracefully when the gem is not in the lockfile (#5693, @segiddins)
+  - `bundle init --gemspec` will fail gracefully when the gemspec is invalid (@colby-swandale)
+  - `bundle install --force` works when the gemfile contains git gems (#5678, @segiddins)
+  - `bundle env` will print well-formed markdown when there are no settings (#5677, @segiddins)
+
+## 1.15.0 (2017-05-19)
+
+This space intentionally left blank.
+
+## 1.15.0.pre.4 (2017-05-10)
+
+Bugfixes:
+
+  - avoid conflicts when `Gem.finish_resolve` is called after the bundle has been set up (@segiddins)
+  - ensure that `Gem::Specification.find_by_name` always returns an object that can have `#to_spec` called on it (#5592, @jules2689)
+
+## 1.15.0.pre.3 (2017-04-30)
+
+Bugfixes:
+
+  - avoid redundant blank lines in the readme generated by `bundle gem` (@koic)
+  - ensure that `open-uri` is not loaded after `bundle exec` (@segiddins)
+  - print a helpful error message when an activated default gem conflicts with
+    a gem in the gemfile (@segiddins)
+  - only shorten `ref` option for git gems when it is a SHA (#5620, @segiddins)
+
+## 1.15.0.pre.2 (2017-04-23)
+
+Bugfixes:
+
+  - ensure pre-existing fit caches are updated from remote sources (#5423, @alextaylor000)
+  - avoid duplicating specs in the lockfile after updating with the gem uninstalled (#5599, @segiddins)
+  - ensure git gems have their extensions available at runtime (#5594, @jules2689, @segiddins)
+
+## 1.15.0.pre.1 (2017-04-16)
+
+Features:
+
+  - print a notification when a newer version of bundler is available (#4683, @segiddins)
+  - add man pages for all bundler commands (#4988, @feministy)
+  - add the `bundle info` command (@fredrb, @colby-swandale)
+  - all files created with `bundle gem` comply with the bundler style guide (@zachahn)
+  - if installing a gem fails, print out the reason the gem needed to be installed (#5078, @segiddins)
+  - allow setting `gem.push_key` to set the key used when running `rake release` (@DTrierweiler)
+  - print gem versions that are regressing during `bundle update` in yellow (#5506, @brchristian)
+  - avoid printing extraneous dependencies when the resolver encounters a conflict (@segiddins)
+  - add the `bundle issue` command that prints instructions for reporting issues (#4871, @jonathanpike)
+  - add `--source` and `--group` options to the `bundle inject` command (#5452, @Shekharrajak)
+  - add the `bundle add` command to add a gem to the gemfile (@denniss)
+  - add the `bundle pristine` command to re-install gems from cached `.gem` files (#4509, @denniss)
+  - add a `--parseable` option for `bundle config` (@JuanitoFatas, @colby-swandale)
+
+Performance:
+
+  - speed up gemfile initialization by storing locked dependencies as a hash (@jules2689)
+  - speed up gemfile initialization by making locked dependency comparison lazy, avoiding object allocation (@jules2689)
+  - only validate git gems when they are downloaded, instead of every time `Bundler.setup` is run (@segiddins)
+  - avoid regenerating the lockfile when nothing has changed (@segiddins)
+  - avoid diffing large arrays when no sources in the gemfile have changed (@segiddins)
+  - avoid evaluating full gemspecs when running with RubyGems 2.5+ (@segiddins)
+
+Bugfixes:
+
+  - fix cases where `bundle update` would print a resolver conflict instead of updating the selected gems (#5031, #5095, @segiddins)
+  - print out a stack trace after an interrupt when running in debug mode (@segiddins)
+  - print out when bundler starts fetching a gem from a remote server (@segiddins)
+  - fix `bundle gem` failing when `git` is unavailable (#5458, @Shekharrajak, @colby-swandale)
+  - suggest the appropriate command to unfreeze a bundle (#5009, @denniss)
+  - ensure nested calls to `bundle exec` resolve default gems correctly (#5500, @segiddins)
+  - ensure that a plugin failing to install doesn't uninstall other plugins (@kerrizor, @roseaboveit)
+  - ensure `socket` is required before being referenced (#5533, @rafaelfranca)
+  - allow running `bundle outdated` when gems aren't installed locally (#5553, @segiddins)
+  - print a helpful error when `bundle exec`ing to a gem that isn't included in the bundle (#5487, @segiddins)
+  - print an error message when a non-git gem is given a `branch` option (#5530, @colby-swandale)
+  - allow interrupts to exit the process after gems have been installed (@segiddins)
+  - print the underlying error when downloading gem metadata fails (#5579, @segiddins)
+  - avoid deadlocking when installing with a lockfile that is missing dependencies (#5378, #5480, #5519, #5526, #5529, #5549, #5572, @segiddins)
+
+## 1.14.6 (2017-03-03)
+
+Bugfixes:
+
+  - avoid undefined constant `Bundler::Plugin::API::Source` exception (#5409, @segiddins)
+  - avoid incorrect warnings about needing to enable `specific_platform` (@segiddins)
+  - fail gracefully when the compact index does not send an ETag (#5463, @olleolleolle)
+  - ensure `bundle outdated --local` shows all outdated gems (#5430, @denniss)
+  - fix a case where ruby version requirements could lead to incorrect resolver conflicts (#5425, @segiddins)
+
+## 1.14.5 (2017-02-22)
+
+Bugfixes:
+
+  - avoid loading all unused gemspecs during `bundle exec` on RubyGems 2.3+ (@segiddins)
+  - improve resolver performance when dependencies have zero or one total possibilities ignoring requirements (#5444, #5457, @segiddins)
+  - enable compact index when OpenSSL FIPS mode is enabled but not active (#5433, @wjordan)
+  - use github username instead of git name for the github url in `bundle gem` (#5438, @danielpclark)
+  - avoid a TypeError on RubyGems 2.6.8 when no build settings are set for native extensions (@okkez)
+  - fail gracefully when the dependency api is missing runtime dependencies for a gem (@segiddins)
+  - handle when a platform-specific gem has more dependencies than the ruby platform version (#5339, #5426, @segiddins)
+  - allow running bundler on a machine with no home directory where the temporary directory is not writable (#5371, @segiddins)
+  - avoid gem version conflicts on openssl using Ruby 2.5 (#5235, @rhenium)
+  - fail when installing in frozen mode and the dependencies for `gemspec` gems have changed without the lockfile being updated (#5264, @segiddins)
+
+## 1.14.4 (2017-02-12)
+
+Bugfixes:
+
+  - fail gracefully when attempting to overwrite an existing directory with `bundle gem` (#5358, @nodo)
+  - fix a resolver bug that would cause bundler to report conflicts that it could resolve (#5359, #5362, @segiddins)
+  - set native extension build arguments for git gems (#5401, @segiddins)
+  - fix the suggested `bundle lock` command printed when a dependency is unused on any platform (@5t111111)
+  - ensure the version passed to `ruby` in the Gemfile is valid during Gemfile parsing (#5380, @segiddins)
+  - show `bundle inject` usage when too many arguments are passed (#5384, @Shekharrajak)
+  - stop `bundle show --outdated` from implicitly running `bundle update` (#5375, @colby-swandale)
+  - allow the temporary home directory fallback to work for multiple users (@svoop)
+
+## 1.14.3 (2017-01-24)
+
+Bugfixes:
+
+  - fix the resolver attempting to activate ruby-platform gems when the bundle is only for other platforms (#5349, #5356, @segiddins)
+  - avoid re-resolving a locked gemfile that uses `gemspec` and includes development dependencies (#5349, @segiddins)
+
+## 1.14.2 (2017-01-22)
+
+Bugfixes:
+
+  - fix using `force_ruby_platform` on windows (#5344, @segiddins)
+  - fix an incorrect version conflict error when using `gemspec` on multiple platforms (#5340, @segiddins)
+
+## 1.14.1 (2017-01-21)
+
+Bugfixes:
+
+  - work around a ruby 2.2.2 bug that caused a stack consistency error during installation (#5342, @segiddins)
+
+## 1.14.0 (2017-01-20)
+
+Bugfixes:
+
+  - ensure `Settings::Mirror` is autoloaded under the `Settings` namespace
+    (#5238, @segiddins)
+  - fix `bundler/inline` when `BUNDLE_GEMFILE=""` (#5079, @segiddins)
+
+## 1.14.0.pre.2 (2017-01-11)
+
+Bugfixes:
+
+  - allow not selecting a gem when running `bundle open` (#5301, @segiddins)
+  - support installing gems from git branches that contain shell metacharacters (#5295, @segiddins)
+  - fix a resolver error that could leave dependencies unresolved (#5294, @segiddins)
+  - fix a stack overflow error when invoking commands (#5296, @segiddins)
+
+## 1.14.0.pre.1 (2016-12-29)
+
+Features:
+
+  - `bundle doctor` first runs `bundle check` (@segiddins)
+  - the bundler trampoline is automatically enabled when the target version is greater than bundler 2 (@segiddins)
+  - gem checksums returned by rubygems.org are validated when installing gems (#4464, @segiddins)
+  - use the git username as a github username when running `bundle gem` (@JuanitoFatas)
+  - show more context when the resolver conflicts on required ruby and rubygems versions (@segiddins)
+  - improve platform support by allowing bundler to pick the best platform match during dependency resolution, enabled with the `specific_platform` setting (#4295, #4896, @segiddins)
+  - always prompt the user for a password when using `sudo` (#3006, @segiddins)
+  - support running without a home directory (#4778, @segiddins)
+  - print a warning when the gemfile uses a platform conditional that will exclude the gem from all lockfile platforms (@segiddins)
+  - add the `force_ruby_platform` setting to force bundler to install ruby-platform gems, even on other platforms (#4813, @segiddins)
+  - add conservative update options to `bundle lock` (#4912, @chrismo)
+  - improve `bundle outdated` output to group gems by group (@ryanfox1985)
+  - add conservative update options to `bundle update` (#5065, #5076, @chrismo)
+  - print the output of `bundle env` as github-flavored markdown, making it easier to preserve formatting when copy-pasting into a new issue (@segiddins)
+  - configure the persistence file when using `bundle gem` with `rspec` (@segiddins)
+  - add support for the `ruby_25` gemfile filter (@amatsuda)
+  - when installing with a lockfile that is missing dependencies, allow installation to proceed (but without parallelism) (@segiddins)
+
+Performance:
+
+  - improve `require "bundler"` performance by ~5x (@segiddins)
+  - allow install gems in parallel when running on rubygems 2+
+
+Bugfixes:
+
+  - config files with CRLF line endings can be read (#4435, @segiddins)
+  - `bundle lock` activates gems for the current platform even if they were activated under a different platform for a separate dependency (#4896, @segiddins)
+  - running `bundle env` in a directory without a gemfile no longer crashes (@segiddins)
+  - fail gracefully when attempting to use a source with an unknown URI scheme (#4953, @segiddins)
+  - store paths in the lockfile relative to the root gemfile directory when using `eval_gemfile` (#4966, @segiddins)
+  - `bundle lock` will not update without the `--update` flag (#4957, @segiddins)
+  - the `console` binstub generated by `bundle gem` will load `.irbrc` files (@mattbrictson)
+  - print friendly filesystem access errors in the new index (@segiddins)
+  - print a helpful error when running out of memory on jruby (#4673, @segiddins)
+  - load all rubygems plugins when installing gems (#2824, @segiddins)
+  - `bundle clean --dry-run` prints the list of gems without the `--force` option when no path is set (#5027, @hmistry)
+  - local installs no longer print "this gem may have been yanked" (#5022, @hmistry)
+  - avoid leaking `which` output when running `bundle doctor` (@colby-swandale)
+  - print a warning when attempting to `bundle exec` an empty program (#5084, @bronzdoc)
+  - ensure `bundle outdated` lists all outdated gems (#4979, @chrismo)
+  - fail gracefully when attempting to `bundle gem` with an invalid constant name (#5185, @segiddins)
+  - allow `bundler/inline` to work in a directory that contains a gemfile (#5117, @colby-swandale)
+  - ensure that the new index is thread-safe, allowing installation on rbx (#5142, @segiddins)
+  - remove deprecated `rspec` syntax in `bundle gem` output (@gearnode)
+    - fail gracefully when any system error is encountered when touching the filesystem (#5134, @segiddins)
+  - fix compatibility with a machine running with FIPS mode enabled (#4989, @segiddins)
+  - fix `bundle lock --add-platform ruby` (#5230, @segiddins)
+  - print gem post-install messages when running `bundle update` (@smathy)
+  - ensure errors due to a retries are all separated by a newline (@segiddins)
+  - print out the bundle path in gem not found errors (#4854, @diegosteiner)
+  - fail gracefully when creating threads fails (@segiddins)
+  - avoid downloading metadata for gems that are only development dependencies (@Paxa)
+
+## 1.13.7 (2016-12-25)
+
+Features:
+
+  - add support for the `ruby_24` gemfile filter (#5281, @amatsuda)
+
 ## 1.13.6 (2016-10-22)
 
 Bugfixes:
@@ -31,11 +251,11 @@ Bugfixes:
 
   - allow `Settings` to be initialized without a root directory (@m1k3)
   - allow specifying ruby engines in the gemfile as a symbol (#4919, @JuanitoFatas)
-  - avoid an execption when using `bundler/deployment` with Vlad (@srbaker)
+  - avoid an exception when using `bundler/deployment` with Vlad (@srbaker)
   - ensure redefined methods have the same visibility as the one they're replacing, fixing `Kernel.require` failing on JRuby (#4975, @segiddins)
   - ensure that Bundler won't complain about a corrupt lockfile when no lockfile exists when using `gemspec` in the Gemfile (#5006, @segiddins)
   - fail gracefully when parsing the metadata for a gemspec from the compact index fails (@segiddins)
-  - fix invoking bundler with binstubs generated by RubyGems 2.6.2+ (#4974, @chrismo)
+  - fix system gems not being copied to --path on bundle install (e.g. --deployment) (#4974, @chrismo)
 
 Performance:
 
@@ -65,7 +285,7 @@ Features:
   - print gem installation errors after other install output (#4834, @segiddins)
   - add `lock --remove-platform` flag to remove platforms from the lock (#4877, @segiddins)
   - add `only_update_to_newer_versions` setting to prevent downgrades during `update` (@segiddins)
-  - expanded expirimental plugin support to include hooks and sources (@asutoshpalai)
+  - expanded experimental plugin support to include hooks and sources (@asutoshpalai)
 
 Bugfixes:
 
@@ -143,6 +363,11 @@ Bugfixes:
   - allow running `bundle install --deployment` after `bundle package --all` with path gems (#2175, @allenzhao)
   - add support for patchlevels in ruby versions in the gemfile and gemspecs (#4593, @chalkos)
 
+## 1.12.6 (2016-10-10)
+
+Bugfixes:
+  - add support for weak etags to the new index (@segiddins)
+
 ## 1.12.5 (2016-05-25)
 
 Bugfixes:
@@ -1262,13 +1487,13 @@ Bugfixes:
 
 Features:
 
-  - compatibile with Ruby 2.0.0-preview2
-  - compatibile with Rubygems 2.0.0.preview2 (@drbrain, @evanphx)
+  - compatible with Ruby 2.0.0-preview2
+  - compatible with Rubygems 2.0.0.preview2 (@drbrain, @evanphx)
   - ruby 2.0 added to the `:ruby19` ABI-compatible platform
   - lazy load YAML, allowing Psych to be specified in the Gemfile
   - significant performance improvements (@cheald, #2181)
   - `inject` command for scripted Gemfile additions (Engine Yard)
-  - :github option uses slashless arguements as repo owner (@rking)
+  - :github option uses slashless arguments as repo owner (@rking)
   - `open` suggests gem names for typos (@jdelStrother)
   - `update` reports non-existent gems (@jdelStrother)
   - `gem` option --test can generate rspec stubs (@MafcoCinco)
@@ -1692,7 +1917,7 @@ Features:
   - Add bundle clean. Removes unused gems from --path directory
   - Initial Gemcutter Endpoint API work, BAI Fetching source index
   - Added bundle install --standalone
-  - Ignore Gemfile.lock when buliding new gems
+  - Ignore Gemfile.lock when building new gems
   - Make it possible to override a .gemspec dependency's source in the
     Gemfile
 
@@ -1743,7 +1968,7 @@ Bugfixes:
 
 Features:
 
-  - Compatability with Rubygems 1.8.10 installer changes
+  - Compatibility with Rubygems 1.8.10 installer changes
   - Report gem installation failures clearly (@rwilcox, #1380)
   - Useful error for cap and vlad on first deploy (@nexmat, @kirs)
 
@@ -2493,7 +2718,7 @@ Bugfixes:
   - make the tests platform agnostic so we can confirm that they're green on JRuby
   - fixes for Ruby 1.9
 
-## 0.9.5 (Feburary 12, 2010)
+## 0.9.5 (February 12, 2010)
 
 Features:
 
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index 7073fad..9d9cc43 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -14,7 +14,7 @@ Individuals asked to stop any harassing behavior are expected to comply immediat
 
 Maintainers, including the core team, are also subject to the anti-harassment policy.
 
-If anyone engages in abusive, harassing, or otherwise unacceptable behavior, including maintainers, we may take appropriate action, up to and including warning the offender, deletion of comments, removal from the project’s codebase and communication systems, and escalation to Github support.
+If anyone engages in abusive, harassing, or otherwise unacceptable behavior, including maintainers, we may take appropriate action, up to and including warning the offender, deletion of comments, removal from the project’s codebase and communication systems, and escalation to GitHub support.
 
 If you are being harassed, notice that someone else is being harassed, or have any other concerns, please contact a member of [the core team](http://bundler.io/contributors.html) or [email the core team](mailto:team at bundler.io) immediately.
 
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 8349280..8dc0548 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,36 +1,17 @@
-# Contributing
+# Contributing to Bundler
 
-Bundler welcomes contributions from *everyone*. While contributing, please follow the project [code of conduct](http://bundler.io/conduct.html), so that everyone can be included.
-
-If you'd like to help make Bundler better, you totally rock! Here are some ways you can contribute:
-
-  - by using prerelease versions (run `gem install bundler --pre`)
-  - by [reporting bugs you encounter or suggesting new features](https://github.com/bundler/bundler/issues/new)
-  - by adding to or editing [the Bundler documentation website](http://bundler.io) and [Bundler man pages](http://bundler.io/man/bundle.1.html)
-  - by [checking issues for completeness](https://github.com/bundler/bundler/blob/master/DEVELOPMENT.md#bug-triage)
-  - by closing issues that are not complete
-  - by adding a failing test for reproducible [reported bugs](https://github.com/bundler/bundler/issues)
-  - by reviewing [pull requests](https://github.com/bundler/bundler/pulls) and suggesting improvements
-  - by improving existing code, including suggestions from [PullReview](https://www.pullreview.com/github/bundler/bundler/reviews/master) or [CodeClimate](https://codeclimate.com/github/bundler/bundler)
-  - by [writing code](https://github.com/bundler/bundler/blob/master/DEVELOPMENT.md) (no patch is too small! fix typos or bad whitespace)
-  - by backfilling [unit tests](https://github.com/bundler/bundler/tree/master/spec/bundler) for modules that lack [coverage](https://codeclimate.com/github/bundler/bundler/coverage)
-
-If you need help getting started, check out the [DEVELOPMENT.md](https://github.com/bundler/bundler/blob/master/DEVELOPMENT.md) file for steps that will get you up and running.
+Welcome to Bundler! We are so happy that you're here. We know it can be daunting to joining a new open source project, so here's a quick overview of what you can expect from this documentation.
 
-Thanks for helping us make Bundler better.
-
-# Roadmap
-
-If you're interested in reading some of the potential ideas or plans for Bundler, see the official Bundler [Trello Board](https://trello.com/b/DioUaKgx/bundler).
-
-# Troubleshooting
+Bundler welcomes contributions from *everyone*. While contributing, please follow the project [code of conduct](http://bundler.io/conduct.html), so that everyone can be included.
 
-If you're having a problem, please see [ISSUES](https://github.com/bundler/bundler/blob/master/ISSUES.md) for troubleshooting steps and a guide for how to submit a ticket that will help us solve the problem you are having as quickly as possible.
+## Quick start
 
-# Requesting Features
+Some guides you might find useful:
 
-Feel free to discuss your ideas or feature requests on any of the lists or channels listed below or [create an issue](https://github.com/bundler/bundler/issues/new) with the `feature-request` label. Feature-wise, we consider Bundler stable, so the core team does not tend to work on feature suggestions. Pull requests are welcome though!
+* [Submitting pull requests](doc/development/PULL_REQUESTS.md)
+* [Filing an issue](doc/contributing/ISSUES.md)
+* [Bug triage](doc/contributing/BUG_TRIAGE.md)
 
-# Discussing Bundler
+## Comprehensive guides
 
-If you'd like to discuss features, ask questions, or just engage in general Bundler-focused discussion, please see the [#bundler](irc://irc.freenode.net/#bundler) IRC channel on Freenode, and the [Bundler mailing list](http://groups.google.com/group/ruby-bundler) on Google Groups.
+Not finding what you're looking for? More comprehensive guides are [available here](doc/README.md).
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
deleted file mode 100644
index 8964b75..0000000
--- a/DEVELOPMENT.md
+++ /dev/null
@@ -1,148 +0,0 @@
-Great to have you here! Here are a few ways you can help out with [Bundler](http://github.com/bundler/bundler).
-
-# Where should I start?
-
-You can start learning about Bundler by reading [the documentation](http://bundler.io). If you want, you can also read a (lengthy) explanation of [why Bundler exists and what it does](http://bundler.io/rationale.html). You can also check out discussions about Bundler on the [Bundler mailing list](https://groups.google.com/group/ruby-bundler) and in the [Bundler IRC channel](http://webchat.freenode.net/?channels=%23bundler), which is #bundler on Freenode. Please note that this project is  [...]
-
-## Your first commits
-
-If you’re interested in contributing to Bundler, that’s awesome! We’d love your help.
-
-If you have any questions after reading this page, please feel free to contact either [@indirect](https://github.com/indirect), [@segiddins](https://github.com/segiddins), or [@RochesterinNYC](https://github.com/RochesterinNYC). They are all happy to provide help working through your first bug fix or thinking through the problem you’re trying to resolve.
-
-## How you can help
-
-We track [small bugs and features](https://github.com/bundler/bundler/issues?labels=small) so that anyone who wants to help can start with something that's not too overwhelming. We also keep a [list of things anyone can help with, any time](https://github.com/bundler/bundler/blob/master/CONTRIBUTING.md#contributing). If nothing on those lists looks good, talk to us, and we'll figure out what you can help with. We can absolutely use your help, no matter what level of programming skill you [...]
-
-# Development setup
-
-Bundler doesn't use a Gemfile to list development dependencies, because when we tried it we couldn't tell if we were awake or it was just another level of dreams. To work on Bundler, you'll probably want to do a couple of things.
-
-  1. Install `groff-base` and `graphviz` packages using your package manager, e.g for ubuntu
-
-        $ sudo apt-get install graphviz groff-base -y
-
-     and for OS X (with brew installed)
-
-        $ brew install graphviz homebrew/dupes/groff
-
-  2. Install Bundler's development dependencies
-
-        $ bin/rake spec:deps
-
-  3. Run the test suite, to make sure things are working
-
-        $ bin/rake spec
-
-  4. Set up a shell alias to run Bundler from your clone, e.g. a Bash alias:
-
-        $ alias dbundle='BUNDLE_DISABLE_POSTIT=1 ruby -I /path/to/bundler/lib /path/to/bundler/exe/bundle'
-
-     The `BUNDLE_DISABLE_POSTIT` environment variable ensures that the version of Bundler in `/path/to/bundler/lib` will be used. Without that environment setting, Bundler will automatically download, install, and run the version of Bundler listed in `Gemfile.lock`. With that set up, you can test changes you've made to Bundler by running `dbundle`, without interfering with the regular `bundle` command.
-
-# Submitting Pull Requests
-
-Before you submit a pull request, please remember to do the following:
-
-- Make sure the code formatting and styling adheres to the guidelines. We use Rubocop for this. Lack of formatting adherence will result in automatic Travis build failures.
-
-        $ bin/rubocop -a
-
-- Please run the test suite:
-
-        $ bin/rspec
-
-- If you are unable to run the entire test suite, please run the unit test suite and at least the integration specs related to the command or domain of Bundler that your code changes relate to.
-
-- Ex. For a pull request that changes something with `bundle update`, you might run:
-
-        $ bin/rspec spec/bundler
-        $ bin/rspec spec/commands/update_spec.rb
-
-- Please ensure that the commit messages included in the pull request __do not__ have the following:
-  - `@tag` Github user or team references (ex. `@indirect` or `@bundler/core`)
-  - `#id` references to issues or pull requests (ex. `#43` or `bundler/bundler-site#12`)
-
-  If you want to use these mechanisms, please instead include them in the pull request description. This prevents multiple notifications or references being created on commit rebases or pull request/branch force pushes.
-
-- Additionally, do not use `[ci skip]` or `[skip ci]` mechanisms in your pull request titles/descriptions or commit messages. Every potential commit and pull request should run through Bundler's CI system. This applies to all changes/commits (ex. even a change to just documentation or the removal of a comment).
-
-# Bug triage
-
-Triage is the work of processing tickets that have been opened into actionable issues, feature requests, or bug reports. That includes verifying bugs, categorizing the ticket, and ensuring there's enough information to reproduce the bug for anyone who wants to try to fix it.
-
-We've created an [issues guide](https://github.com/bundler/bundler/blob/master/ISSUES.md) to walk Bundler users through the process of troubleshooting issues and reporting bugs.
-
-If you'd like to help, awesome! You can [report a new bug](https://github.com/bundler/bundler/issues/new) or browse our [existing open tickets](https://github.com/bundler/bundler/issues).
-
-Not every ticket will point to a bug in Bundler's code, but open tickets usually mean that there is something we could improve to help that user. Sometimes that means writing additional documentation, sometimes that means making error messages clearer, and sometimes that means explaining to a user that they need to install git to use git gems.
-
-When you're looking at a ticket, here are the main questions to ask:
-
-  * Can I reproduce this bug myself?
-  * Are the steps to reproduce clearly stated in the ticket?
-  * Which versions of Bundler (1.1.x, 1.2.x, git, etc.) manifest this bug?
-  * Which operating systems (OS X, Windows, Ubuntu, CentOS, etc.) manifest this bug?
-  * Which rubies (MRI, JRuby, Rubinius, etc.) and which versions (1.8.7, 1.9.3, etc.) have this bug?
-
-If you can't reproduce an issue, chances are good that the bug has been fixed (hurrah!). That's a good time to post to the ticket explaining what you did and how it worked.
-
-If you can reproduce an issue, you're well on your way to fixing it. :) Fixing issues is similar to adding new features:
-
-  1. Discuss the fix on the existing issue. Coordinating with everyone else saves duplicate work and serves as a great way to get suggestions and ideas if you need any.
-  2. Base your commits on the correct branch. Bugfixes for 1.x versions of Bundler should be based on the matching 1-x-stable branch.
-  3. Commit the code and at least one test covering your changes to a named branch in your fork.
-  4. Put a line in the [CHANGELOG](https://github.com/bundler/bundler/blob/master/CHANGELOG.md) summarizing your changes under the next release under the “Bugfixes” heading.
-  5. Send us a [pull request](https://help.github.com/articles/using-pull-requests) from your bugfix branch.
-
-Finally, the ticket may be a duplicate of another older ticket. If you notice a ticket is a duplicate, simply comment on the ticket noting the original ticket’s number. For example, you could say “This is a duplicate of issue #42, and can be closed”.
-
-
-# Adding New Features
-
-If you would like to add a new feature to Bundler, please follow these steps:
-
-  1. [Create an issue](https://github.com/bundler/bundler/issues/new) with the [`feature-request` label](https://github.com/bundler/bundler/labels/type:%20feature-request) to discuss your feature.
-  2. Base your commits on the master branch, since we follow [SemVer](http://semver.org) and don't add new features to old releases.
-  3. Commit the code and at least one test covering your changes to a feature branch in your fork.
-  4. Send us a [pull request](https://help.github.com/articles/using-pull-requests) from your feature branch.
-
-If you don't hear back immediately, don’t get discouraged! We all have day jobs, but we respond to most tickets within a day or two.
-
-
-# Beta testing
-
-Early releases require heavy testing, especially across various system setups. We :heart: testers, and are big fans of anyone who can run `gem install bundler --pre` and try out upcoming releases in their development and staging environments.
-
-There may not always be prereleases or beta versions of Bundler. The Bundler team will tweet from the [@bundlerio account](http://twitter.com/bundlerio) when a prerelease or beta version becomes available. You are also always welcome to try checking out master and building a gem yourself if you want to try out the latest changes.
-
-
-# Translations
-
-We don't currently have any translations, but please reach out to us if you would like to help get this going.
-
-
-# Documentation
-
-Code needs explanation, and sometimes those who know the code well have trouble explaining it to someone just getting into it. Because of that, we welcome documentation suggestions and patches from everyone, especially if they are brand new to using Bundler.
-
-Bundler has two main sources of documentation: the built-in help (including usage information and man pages) and the [Bundler documentation site](http://bundler.io).
-
-If you’d like to submit a patch to the man pages, follow the steps for submitting a pull request above. All of the man pages are located in the `man` directory. Just use the “Documentation” heading when you describe what you did in the changelog.
-
-If you have a suggestion or proposed change for [bundler.io](http://bundler.io), please open an issue or send a pull request to the [bundler-site](https://github.com/bundler/bundler-site) repository.
-
-
-# Community
-
-Community is an important part of all we do. If you’d like to be part of the Bundler community, you can jump right in and start helping make Bundler better for everyone who uses it.
-
-It would be tremendously helpful to have more people answering questions about Bundler (and often simply about [Rubygems](https://github.com/rubygems/rubygems) or Ruby itself) in our [issue tracker](https://github.com/bundler/bundler/issues) or on [Stack Overflow](http://stackoverflow.com/questions/tagged/bundler).
-
-Additional documentation and explanation is always helpful, too. If you have any suggestions for the Bundler website [bundler.io](http://bundler.io), we would absolutely love it if you opened an issue or pull request on the [bundler-site](https://github.com/bundler/bundler-site) repository.
-
-Finally, sharing your experiences and discoveries by writing them up is a valuable way to help others who have similar problems or experiences in the future. You can write a blog post, create an example and commit it to Github, take screenshots, or make videos.
-
-Publishing examples of how Bundler is used helps everyone, and we’ve discovered that people already use it in ways that we never imagined when we were writing it. If you’re still not sure what to write about, there are also several projects doing interesting things based on Bundler. They could probably use publicity too.
-
-Finally, all contributors to the Bundler project must agree to the contributor [code of conduct](http://bundler.io/conduct.html). By participating in this project you agree to abide by its terms.
diff --git a/README.md b/README.md
index c467673..56ec5c5 100644
--- a/README.md
+++ b/README.md
@@ -11,8 +11,15 @@ It does this by managing the gems that the application depends on. Given a list
 
 ### Installation and usage
 
+To install:
+
 ```
 gem install bundler
+```
+
+Bundler is most commonly used to manage your application's dependencies. To use it for this:
+
+```
 bundle init
 echo 'gem "rspec"' >> Gemfile
 bundle install
@@ -23,17 +30,24 @@ See [bundler.io](http://bundler.io) for the full documentation.
 
 ### Troubleshooting
 
-For help with common problems, see [ISSUES](https://github.com/bundler/bundler/blob/master/ISSUES.md).
+For help with common problems, see [TROUBLESHOOTING](doc/TROUBLESHOOTING.md).
+
+Still stuck? Try [filing an issue](doc/contributing/ISSUES.md).
+
+### Supporting
+
+<a href="https://rubytogether.org/"><img src="https://rubytogether.org/images/rubies.svg" width=200></a><br/>
+Bundler is maintained by <a href="https://rubytogether.org/">Ruby Together</a>, a grassroots initiative committed to supporting the critical Ruby infrastructure you rely on. Contribute today <a href="https://rubytogether.org/developers">as an individual</a> or even better, <a href="https://rubytogether.org/companies">as a company</a>, and ensure that Bundler, RubyGems, and other shared tooling is around for years to come.
 
 ### Other questions
 
-To see what has changed in recent versions of Bundler, see the [CHANGELOG](https://github.com/bundler/bundler/blob/master/CHANGELOG.md).
+To see what has changed in recent versions of Bundler, see the [CHANGELOG](CHANGELOG.md).
 
-Feel free to chat with the Bundler core team (and many other users) on IRC in the  [#bundler](irc://irc.freenode.net/bundler) channel on Freenode, or via email on the [Bundler mailing list](http://groups.google.com/group/ruby-bundler).
+To get in touch with the Bundler core team and other Bundler users, please see [getting help](doc/contributing/GETTING_HELP.md).
 
 ### Contributing
 
-If you'd like to contribute to Bundler, that's awesome, and we <3 you. There's a guide to contributing to Bundler (both code and general help) over in [DEVELOPMENT](https://github.com/bundler/bundler/blob/master/DEVELOPMENT.md).
+If you'd like to contribute to Bundler, that's awesome, and we <3 you. There's a guide to contributing to Bundler (both code and general help) over in [our documentation section](doc/README.md).
 
 ### Code of Conduct
 
diff --git a/Rakefile b/Rakefile
index 7c4a2eb..9b45136 100644
--- a/Rakefile
+++ b/Rakefile
@@ -39,7 +39,7 @@ namespace :spec do
     deps = Hash[BUNDLER_SPEC.development_dependencies.map do |d|
       [d.name, d.requirement.to_s]
     end]
-    deps["rubocop"] ||= "= 0.41.2" if RUBY_VERSION >= "1.9.3" # can't go in the gemspec because of the ruby version requirement
+    deps["rubocop"] ||= "= 0.48.0" if RUBY_VERSION >= "2.0.0" # can't go in the gemspec because of the ruby version requirement
 
     # JRuby can't build ronn or rdiscount, so we skip that
     if defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
@@ -47,10 +47,10 @@ namespace :spec do
       deps.delete("rdiscount")
     end
 
-    deps.sort_by {|name, _| name }.each do |name, version|
-      sh %(#{Gem.ruby} -S gem list -i "^#{name}$" -v "#{version}" || ) +
-        %(#{Gem.ruby} -S gem install #{name} -v "#{version}" --no-ri --no-rdoc)
-    end
+    gem_install_command = "install --no-ri --no-rdoc --conservative " + deps.sort_by {|name, _| name }.map do |name, version|
+      "'#{name}:#{version}'"
+    end.join(" ")
+    sh %(#{Gem.ruby} -S gem #{gem_install_command})
 
     # Download and install gems used inside tests
     $LOAD_PATH.unshift("./spec")
@@ -70,11 +70,11 @@ namespace :spec do
       sh "sudo apt-get install graphviz -y 2>&1 | tail -n 2"
 
       # Install the gems with a consistent version of RubyGems
-      sh "gem update --system 2.6.4"
+      sh "gem update --system 2.6.11"
 
       $LOAD_PATH.unshift("./spec")
       require "support/rubygems_ext"
-      Spec::Rubygems::DEPS["codeclimate-test-reporter"] = nil if RUBY_VERSION >= "2.2.0"
+      Spec::Rubygems::DEPS["codeclimate-test-reporter"] = "~> 0.6.0" if RUBY_VERSION >= "2.2.0"
 
       # Install the other gem deps, etc
       Rake::Task["spec:deps"].invoke
@@ -91,9 +91,9 @@ begin
   RSpec::Core::RakeTask.new
   task :spec => "man:build"
 
-  if RUBY_VERSION >= "1.9.3"
+  if RUBY_VERSION >= "2.0.0"
     # can't go in the gemspec because of the ruby version requirement
-    gem "rubocop", "= 0.41.2"
+    gem "rubocop", "= 0.48.0"
     require "rubocop/rake_task"
     RuboCop::RakeTask.new
   end
@@ -127,7 +127,7 @@ begin
       rubyopt = ENV["RUBYOPT"]
       # When editing this list, also edit .travis.yml!
       branches = %w(master)
-      releases = %w(v1.3.6 v1.3.7 v1.4.2 v1.5.3 v1.6.2 v1.7.2 v1.8.29 v2.0.14 v2.1.11 v2.2.5 v2.4.8 v2.6.4)
+      releases = %w(v1.3.6 v1.3.7 v1.4.2 v1.5.3 v1.6.2 v1.7.2 v1.8.29 v2.0.14 v2.1.11 v2.2.5 v2.4.8 v2.5.2 v2.6.8)
       (branches + releases).each do |rg|
         desc "Run specs with Rubygems #{rg}"
         RSpec::Core::RakeTask.new(rg) do |t|
@@ -190,7 +190,7 @@ begin
     task :travis do
       rg = ENV["RGV"] || raise("Rubygems version is required on Travis!")
 
-      if RUBY_VERSION > "1.9.3"
+      if RUBY_VERSION >= "2.0.0"
         puts "\n\e[1;33m[Travis CI] Running bundler linter\e[m\n\n"
         Rake::Task["rubocop"].invoke
       end
@@ -238,14 +238,15 @@ begin
   require "ronn"
 
   namespace :man do
-    directory "lib/bundler/man"
+    directory "man"
 
     sources = Dir["man/*.ronn"].map {|f| File.basename(f, ".ronn") }
     sources.map do |basename|
       ronn = "man/#{basename}.ronn"
-      roff = "lib/bundler/man/#{basename}"
+      manual_section = ".1" unless basename =~ /.*(\d+)\Z/
+      roff = "man/#{basename}#{manual_section}"
 
-      file roff => ["lib/bundler/man", ronn] do
+      file roff => ["man", ronn] do
         sh "#{Gem.ruby} -S ronn --roff --pipe #{ronn} > #{roff}"
       end
 
@@ -257,9 +258,8 @@ begin
     end
 
     task :clean do
-      leftovers = Dir["lib/bundler/man/*"].reject do |f|
-        basename = File.basename(f).sub(/\.(txt|ronn)/, "")
-        sources.include?(basename)
+      leftovers = Dir["man/*"].reject do |f|
+        File.extname(f) == ".ronn" || f == "man/index.txt"
       end
       rm leftovers if leftovers.any?
     end
@@ -285,13 +285,6 @@ end
 begin
   require "automatiek"
 
-  Automatiek::RakeTask.new("compact_index_client") do |lib|
-    lib.download = { :github => "https://github.com/bundler/compact_index_client" }
-    lib.namespace = "CompactIndexClient"
-    lib.prefix = "Bundler"
-    lib.vendor_lib = "lib/bundler/vendor/compact_index_client"
-  end
-
   Automatiek::RakeTask.new("molinillo") do |lib|
     lib.download = { :github => "https://github.com/CocoaPods/Molinillo" }
     lib.namespace = "Molinillo"
@@ -312,11 +305,29 @@ begin
     lib.prefix = "BundlerVendoredPostIt"
     lib.vendor_lib = "lib/bundler/vendor/postit"
   end
+
+  Automatiek::RakeTask.new("net-http-persistent") do |lib|
+    lib.download = { :github => "https://github.com/drbrain/net-http-persistent" }
+    lib.namespace = "Net::HTTP::Persistent"
+    lib.prefix = "Bundler::Persistent"
+    lib.vendor_lib = "lib/bundler/vendor/net-http-persistent"
+
+    mixin = Module.new do
+      def namespace_files
+        super
+        require_target = vendor_lib.sub(%r{^(.+?/)?lib/}, "") << "/lib"
+        relative_files = files.map {|f| Pathname.new(f).relative_path_from(Pathname.new(vendor_lib) / "lib").sub_ext("").to_s }
+        process_files(/require (['"])(#{Regexp.union(relative_files)})/, "require \\1#{require_target}/\\2")
+      end
+    end
+    lib.send(:extend, mixin)
+  end
 rescue LoadError
   namespace :vendor do
     task(:molinillo) { abort "Install the automatiek gem to be able to vendor gems." }
     task(:thor) { abort "Install the automatiek gem to be able to vendor gems." }
     task(:postit) { abort "Install the automatiek gem to be able to vendor gems." }
+    task("net-http-persistent") { abort "Install the automatiek gem to be able to vendor gems." }
   end
 end
 
@@ -331,3 +342,5 @@ task :build => ["man:build"]
 task :release => ["man:require", "man:build"]
 
 task :default => :spec
+
+Dir["task/*.{rb,rake}"].each(&method(:load))
diff --git a/bin/rubocop b/bin/rubocop
index 78641c5..ab7285f 100755
--- a/bin/rubocop
+++ b/bin/rubocop
@@ -10,7 +10,7 @@ bundler_spec.dependencies.each do |dep|
   gem dep.name, dep.requirement
 end
 
-gem "rubocop", "= 0.41.2"
+gem "rubocop", "= 0.48.0"
 
 Gem.finish_resolve if Gem.respond_to?(:finish_resolve)
 
diff --git a/bundler.gemspec b/bundler.gemspec
index f67c538..38d739b 100644
--- a/bundler.gemspec
+++ b/bundler.gemspec
@@ -7,13 +7,26 @@ require "bundler/version"
 Gem::Specification.new do |s|
   s.name        = "bundler"
   s.version     = Bundler::VERSION
-  s.licenses    = ["MIT"]
-  s.authors     = ["André Arko", "Samuel Giddins"]
+  s.license     = "MIT"
+  s.authors     = [
+    "André Arko", "Samuel Giddins", "Chris Morris", "James Wen", "Tim Moore",
+    "André Medeiros", "Jessica Lynn Suttles", "Terence Lee", "Carl Lerche",
+    "Yehuda Katz"
+  ]
   s.email       = ["team at bundler.io"]
   s.homepage    = "http://bundler.io"
   s.summary     = "The best way to manage your application's dependencies"
   s.description = "Bundler manages an application's dependencies through its entire life, across many machines, systematically and repeatably"
 
+  if s.respond_to?(:metadata=)
+    s.metadata = {
+      "bug_tracker_uri" => "http://github.com/bundler/bundler/issues",
+      "changelog_uri" => "https://github.com/bundler/bundler/blob/master/CHANGELOG.md",
+      "homepage_uri" => "https://bundler.io/",
+      "source_code_uri" => "http://github.com/bundler/bundler/",
+    }
+  end
+
   s.required_ruby_version     = ">= 1.8.7"
   s.required_rubygems_version = ">= 1.3.6"
 
@@ -27,7 +40,7 @@ Gem::Specification.new do |s|
   s.files = `git ls-files -z`.split("\x0").reject {|f| f.match(%r{^(test|spec|features)/}) }
   # we don't check in man pages, but we need to ship them because
   # we use them to generate the long-form help for each command.
-  s.files += Dir.glob("lib/bundler/man/**/*")
+  s.files += Dir.glob("man/**/*")
 
   s.bindir        = "exe"
   s.executables   = %w(bundle bundler)
diff --git a/doc/README.md b/doc/README.md
new file mode 100644
index 0000000..534dd94
--- /dev/null
+++ b/doc/README.md
@@ -0,0 +1,30 @@
+# Docs: Contributing and developing Bundler
+
+_If you're looking for documentation on how to use Bundler: visit [bundler.io](http://bundler.io/), or run `bundle help` from the command line. You may also be interested in [troubleshooting common issues](TROUBLESHOOTING.md) found when using Bundler._
+
+Bundler welcomes contributions from *everyone*. While contributing, please follow the project [code of conduct](http://bundler.io/conduct.html), so that everyone can be included.
+
+If you'd like to help make Bundler better, you totally rock! Thanks for helping us make Bundler better.
+
+## Contributing
+
+* [Overview & getting started](contributing/README.md)
+* [How you can help: your first contributions!](contributing/HOW_YOU_CAN_HELP.md)
+* [Bug triage](contributing/BUG_TRIAGE.md)
+* [Getting help](contributing/GETTING_HELP.md)
+* [Filing issues](contributing/ISSUES.md)
+* [Community](contributing/COMMUNITY.md)
+
+## Development
+
+* [Overview](development/README.md)
+* [Development setup](development/SETUP.md)
+* [Submitting pull requests](development/PULL_REQUESTS.md)
+* [Adding new features](development/NEW_FEATURES.md)
+* [Releasing Bundler](development/RELEASING.md)
+
+## Documentation
+
+* [Overview](documentation/README.md)
+* [Writing docs for man pages](documentation/WRITING.md)
+* [Documentation vision](documentation/VISION.md)
diff --git a/doc/TROUBLESHOOTING.md b/doc/TROUBLESHOOTING.md
new file mode 100644
index 0000000..e9187c5
--- /dev/null
+++ b/doc/TROUBLESHOOTING.md
@@ -0,0 +1,64 @@
+# Troubleshooting common issues
+
+Stuck using Bundler? Browse these common issues before [filing a new issue](contributing/ISSUES.md).
+
+## Permission denied when installing bundler
+
+Certain operating systems such as MacOS and Ubuntu have versions of Ruby that require elevated privileges to install gems.
+
+    ERROR:  While executing gem ... (Gem::FilePermissionError)
+      You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
+
+There are multiple ways to solve this issue. You can install bundler with elevated privilges using `sudo` or `su`.
+
+    sudo gem install bundler
+
+If you cannot elevated your privileges or do not want to globally install Bundler, you can use the `--user-install` option.
+
+    gem install bundler --user-install
+
+This will install Bundler into your home directory. Note that you will need to append `~/.gem/ruby/<ruby version>/bin` to your `$PATH` variable to use `bundle`.
+
+## Heroku errors
+
+Please open a ticket with [Heroku](https://www.heroku.com) if you're having trouble deploying. They have a professional support team who can help you resolve Heroku issues far better than the Bundler team can. If the problem that you are having turns out to be a bug in Bundler itself, [Heroku support](https://www.heroku.com/support) can get the exact details to us.
+
+## Other problems
+
+First, figure out exactly what it is that you're trying to do (see [XY Problem](http://xyproblem.info/)). Then, go to the [Bundler documentation website](http://bundler.io) and see if we have instructions on how to do that.
+
+Second, check [the compatibility
+list](http://bundler.io/compatibility.html), and make sure that the version of Bundler that you are using works with the versions of Ruby and Rubygems that you are using. To see your versions:
+
+    # Bundler version
+    bundle -v
+
+    # Ruby version
+    ruby -v
+
+    # Rubygems version
+    gem -v
+
+If these instructions don't work, or you can't find any appropriate instructions, you can try these troubleshooting steps:
+
+    # Remove user-specific gems and git repos
+    rm -rf ~/.bundle/ ~/.gem/bundler/ ~/.gems/cache/bundler/
+
+    # Remove system-wide git repos and git checkouts
+    rm -rf $GEM_HOME/bundler/ $GEM_HOME/cache/bundler/
+
+    # Remove project-specific settings
+    rm -rf .bundle/
+
+    # Remove project-specific cached gems and repos
+    rm -rf vendor/cache/
+
+    # Remove the saved resolve of the Gemfile
+    rm -rf Gemfile.lock
+
+    # Uninstall the rubygems-bundler and open_gem gems
+    rvm gemset use global # if using rvm
+    gem uninstall rubygems-bundler open_gem
+
+    # Try to install one more time
+    bundle install
diff --git a/doc/contributing/BUG_TRIAGE.md b/doc/contributing/BUG_TRIAGE.md
new file mode 100644
index 0000000..6667805
--- /dev/null
+++ b/doc/contributing/BUG_TRIAGE.md
@@ -0,0 +1,36 @@
+# Bug triage
+
+Triaging is the work of processing tickets that have been opened by users. Common tasks include verifying bugs, categorizing tickets, and ensuring there's enough information to reproduce the bug for anyone who wants to try to fix it.
+
+We've created an [issues guide](ISSUES.md) to walk users through the process of how to report an issue with the Bundler project. We also have a [troubleshooting guide](../TROUBLESHOOTING.md) to diagnose common problems.
+
+Not every ticket will be a bug in Bundler's code, but open tickets usually mean that the there is something we could improve to help that user. Sometimes that means writing additional documentation or making error messages clearer.
+
+## Triaging existing issues
+
+When you're looking at a ticket, here are the main questions to ask:
+
+  * Can I reproduce this bug myself?
+  * Are the steps to reproduce the bug clearly documented in the ticket?
+  * Which versions of Bundler (1.1.x, 1.2.x, git, etc.) manifest this bug?
+  * Which operating systems (OS X, Windows, Ubuntu, CentOS, etc.) manifest this bug?
+  * Which rubies (MRI, JRuby, Rubinius, etc.) and which versions (1.8.7, 1.9.3, etc.) have this bug?
+
+If you can't reproduce the issue, chances are good that the bug has been fixed already (hurrah!). That's a good time to post to the ticket explaining what you did and how it worked.
+
+If you can reproduce an issue, you're well on your way to fixing it. :)
+
+## Fixing your triaged bug
+
+Everyone is welcome and encouraged to fix any open bug, improve an error message or add documentation. If you have a fix or an improvement to a ticket that you would like to contribute, we have a small guide to help:
+
+  1. Discuss the fix on the existing issue. Coordinating with everyone else saves duplicate work and serves as a great way to get suggestions and ideas if you need any.
+  2. Base your commits on the correct branch. Bugfixes for 1.x versions of Bundler should be based on the matching 1-x-stable branch.
+  3. Review the [pull request guide](../development/PULL_REQUESTS.md).
+  4. Commit the code with at least one test covering your changes to a named branch in your fork.
+  5. Put a line in the [CHANGELOG](../../CHANGELOG.md) summarizing your changes under the next release under the “Bugfixes” heading.
+  6. Send us a [pull request](https://help.github.com/articles/using-pull-requests) from your bugfix branch.
+
+## Duplicates!
+
+Finally, the ticket may be a duplicate of another older ticket. If you notice a ticket is a duplicate, simply comment on the ticket noting the original ticket’s number. For example, you could say “This is a duplicate of issue #42, and can be closed”.
diff --git a/doc/contributing/COMMUNITY.md b/doc/contributing/COMMUNITY.md
new file mode 100644
index 0000000..3e5c195
--- /dev/null
+++ b/doc/contributing/COMMUNITY.md
@@ -0,0 +1,13 @@
+# Community
+
+Community is an important part of all we do. If you’d like to be part of the Bundler community, you can jump right in and start helping make Bundler better for everyone who uses it.
+
+It would be tremendously helpful to have more people answering questions about Bundler (and often simply about [Rubygems](https://github.com/rubygems/rubygems) or Ruby itself) in our [issue tracker](https://github.com/bundler/bundler/issues) or on [Stack Overflow](http://stackoverflow.com/questions/tagged/bundler).
+
+Additional documentation and explanation is always helpful, too. If you have any suggestions for the Bundler website [bundler.io](http://bundler.io), we would absolutely love it if you opened an issue or pull request on the [bundler-site](https://github.com/bundler/bundler-site) repository.
+
+Sharing your experiences and discoveries by writing them up is a valuable way to help others who have similar problems or experiences in the future. You can write a blog post, create an example and commit it to GitHub, take screenshots, or make videos.
+
+Publishing examples of how Bundler is used helps everyone, and we’ve discovered that people already use it in ways that we never imagined when we were writing it. If you’re still not sure what to write about, there are also several projects doing interesting things based on Bundler. They could probably use publicity too.
+
+Finally, all contributors to the Bundler project must agree to the contributor [code of conduct](http://bundler.io/conduct.html). By participating in this project you agree to abide by its terms.
diff --git a/doc/contributing/GETTING_HELP.md b/doc/contributing/GETTING_HELP.md
new file mode 100644
index 0000000..55ccb5f
--- /dev/null
+++ b/doc/contributing/GETTING_HELP.md
@@ -0,0 +1,11 @@
+# Getting help
+
+If you have any questions after reading the documentation for contributing, please feel free to contact either [@indirect](https://github.com/indirect), [@segiddins](https://github.com/segiddins), or [@RochesterinNYC](https://github.com/RochesterinNYC). They are all happy to provide help working through your first bug fix or thinking through the problem you’re trying to resolve.
+
+The best ways to get in touch are:
+
+* [Bundler Slack](https://bundler.slack.com).
+  * Not a member of the Slack? Join the Bundler team slack [here](http://slack.bundler.io/)!
+* [Bundler mailing list](http://groups.google.com/group/ruby-bundler)
+
+You may also find our guide on [filing issues](ISSUES.md) to be helpful as well!
diff --git a/doc/contributing/HOW_YOU_CAN_HELP.md b/doc/contributing/HOW_YOU_CAN_HELP.md
new file mode 100644
index 0000000..b1e90de
--- /dev/null
+++ b/doc/contributing/HOW_YOU_CAN_HELP.md
@@ -0,0 +1,27 @@
+# How you can help: your first commits!
+
+If you’re interested in contributing to Bundler, that’s awesome! We’d love your help.
+
+If at any point you get stuck, here's how to [get in touch with the Bundler team for help](GETTING_HELP.md).
+
+## First contribution suggestions
+
+We track [small bugs and features](https://github.com/bundler/bundler/labels/contribution%3A%20small) so that anyone who wants to help can start with something that's not too overwhelming.
+
+Generally, great ways to get started helping out with Bundler are:
+
+  - using prerelease versions (run `gem install bundler --pre`)
+  - [reporting bugs you encounter or suggesting new features](https://github.com/bundler/bundler/issues/new)
+    - see our [issues guide](ISSUES.md) for help on filing issues
+    - see the [new features documentation](../development/NEW_FEATURES.md) for more
+  - adding to or editing [the Bundler documentation website](http://bundler.io) and [Bundler man pages](http://bundler.io/man/bundle.1.html)
+  - [checking issues for completeness](BUG_TRIAGE.md)
+  - closing issues that are not complete
+  - adding a failing test for reproducible [reported bugs](https://github.com/bundler/bundler/issues)
+  - reviewing [pull requests](https://github.com/bundler/bundler/pulls) and suggesting improvements
+  - improving existing code, including suggestions from [PullReview](https://www.pullreview.com/github/bundler/bundler/reviews/master) or [CodeClimate](https://codeclimate.com/github/bundler/bundler)
+  - writing code (no patch is too small! fix typos or bad whitespace)
+    - get started setting up your dev environment with [these instructions](../development/DEVELOPMENT_SETUP.md)
+  - backfilling [unit tests](https://github.com/bundler/bundler/tree/master/spec/bundler) for modules that lack [coverage](https://codeclimate.com/github/bundler/bundler/coverage)
+
+If nothing on those lists looks good, [talk to us](http://slack.bundler.io/), and we'll figure out what you can help with. We can absolutely use your help, no matter what level of programming skill you have at the moment.
diff --git a/ISSUES.md b/doc/contributing/ISSUES.md
similarity index 57%
rename from ISSUES.md
rename to doc/contributing/ISSUES.md
index e0bc56c..df4fa67 100644
--- a/ISSUES.md
+++ b/doc/contributing/ISSUES.md
@@ -1,63 +1,20 @@
-# Bundler Issues
+# Filing Issues: a guide
 
 So! You're having problems with Bundler. This file is here to help. If you're running into an error, try reading the rest of this file for help. If you can't figure out how to solve your problem, there are also instructions on how to report a bug.
 
+Before filing an issue, check our [troubleshooting guide](../TROUBLESHOOTING.md) for quick fixes to common issues.
+
 ## Documentation
 
 Instructions for common Bundler uses can be found on the [Bundler documentation site](http://bundler.io/).
 
 Detailed information about each Bundler command, including help with common problems, can be found in the [Bundler man pages](http://bundler.io/man/bundle.1.html) or [Bundler Command Line Reference](http://bundler.io/v1.11/commands.html).
 
-## Troubleshooting
-
-### Heroku errors
-
-Please open a ticket with [Heroku](https://www.heroku.com) if you're having trouble deploying. They have a professional support team who can help you resolve Heroku issues far better than the Bundler team can. If the problem that you are having turns out to be a bug in Bundler itself, [Heroku support](https://www.heroku.com/support) can get the exact details to us.
-
-### Other problems
-
-First, figure out exactly what it is that you're trying to do (see [XY Problem](http://xyproblem.info/)). Then, go to the [Bundler documentation website](http://bundler.io) and see if we have instructions on how to do that.
-
-Second, check [the compatibility
-list](http://bundler.io/compatibility.html), and make sure that the version of Bundler that you are
-using works with the versions of Ruby and Rubygems that you are using. To see your versions:
-
-    # Bundler version
-    bundle -v
-
-    # Ruby version
-    ruby -v
-
-    # Rubygems version
-    gem -v
-
-If these instructions don't work, or you can't find any appropriate instructions, you can try these troubleshooting steps:
-
-    # Remove user-specific gems and git repos
-    rm -rf ~/.bundle/ ~/.gem/bundler/ ~/.gems/cache/bundler/
-
-    # Remove system-wide git repos and git checkouts
-    rm -rf $GEM_HOME/bundler/ $GEM_HOME/cache/bundler/
-
-    # Remove project-specific settings
-    rm -rf .bundle/
-
-    # Remove project-specific cached gems and repos
-    rm -rf vendor/cache/
-
-    # Remove the saved resolve of the Gemfile
-    rm -rf Gemfile.lock
-
-    # Uninstall the rubygems-bundler and open_gem gems
-    rvm gemset use global # if using rvm
-    gem uninstall rubygems-bundler open_gem
-
-    # Try to install one more time
-    bundle install
-
 ## Reporting unresolved problems
 
-Hopefully the troubleshooting steps above resolved your problem. If things still aren't working the way you expect them to, please let us know so that we can diagnose and hopefully fix the problem you're having.
+Check our [troubleshooting common issues guide](../TROUBLESHOOTING.md) and see if your issues is resolved using the steps provided.
+
+Hopefully the troubleshooting steps above resolved your problem! If things still aren't working the way you expect them to, please let us know so that we can diagnose and hopefully fix the problem you're having.
 
 **The best way to report a bug is by providing a reproduction script.** See these examples:
 
@@ -87,12 +44,6 @@ If your version of Bundler does not have the `bundle env` command, then please i
  - Whether you have the `rubygems-bundler` gem, which can break gem executables (run `gem list rubygems-bundler`)
  - Whether you have the `open_gem` gem, which can cause rake activation conflicts (run `gem list open_gem`)
 
-If you are using Rails 2.3, please also include:
-
-  - Your `boot.rb` file
-  - Your `preinitializer.rb` file
-  - Your `environment.rb` file
-
 If you have either `rubygems-bundler` or `open_gem` installed, please try removing them and then following the troubleshooting steps above before opening a new ticket.
 
 [Create a gist](https://gist.github.com) containing all of that information, then visit the [Bundler issue tracker](https://github.com/bundler/bundler/issues) and [create a ticket](https://github.com/bundler/bundler/issues/new) describing your problem and linking to your gist.
diff --git a/doc/contributing/README.md b/doc/contributing/README.md
new file mode 100644
index 0000000..3b04aab
--- /dev/null
+++ b/doc/contributing/README.md
@@ -0,0 +1,38 @@
+# Contributing to Bundler
+
+Welcome to Bundler! We are so happy that you're here. We know it can be daunting to joining a new open source project, so here's a quick overview of what you can expect from this documentation.
+
+*Something missing?* Send us a [pull request](../development/PULL_REQUESTS.md)!
+
+**Recommended first steps**
+
+- Join us in the Bundler slack! Generate an invite [here](http://slack.bundler.io/)
+- *If you're interested in helping with code:*
+  - Get a quick overview of our [development process](../development/README.md)
+  - [Setup your machine for development](../development/SETUP.md)
+  - Checkout [How you can help: your first contributions!](HOW_YOU_CAN_HELP.md) for a list of suggestions to get started
+- *If you're interested in helping with documentation:*
+  - Read up on [how documentation works for Bundler](../documentation/README.md)
+  - Learn about our [documentation vision](../documentation/VISION.md)
+
+You can start learning about Bundler by reading [the documentation](http://bundler.io). If you want, you can also read a (lengthy) explanation of [why Bundler exists and what it does](http://bundler.io/rationale.html).
+
+##[How you can help: your first contributions!](HOW_YOU_CAN_HELP.md)
+
+A detailed overview of how to get started contributing to Bundler, including a long list of suggestions for your first project.
+
+##[Bug triage](BUG_TRIAGE.md)
+
+Want to take a stab at processing issues? Start here.
+
+##[Getting help](GETTING_HELP.md)
+
+How to get in touch with folks who can help when you're stuck. Don't worry! This happens to all of us. We're really nice, we promise.
+
+##[Filing issues](ISSUES.md)
+
+We see a lot of issues in the Bundler repo! Use this guide to file informative, actionable issues.
+
+##[Community](COMMUNITY.md)
+
+Learn more about our goals for the Bundler community and the ways you can help us build better together.
diff --git a/doc/development/NEW_FEATURES.md b/doc/development/NEW_FEATURES.md
new file mode 100644
index 0000000..9688ef8
--- /dev/null
+++ b/doc/development/NEW_FEATURES.md
@@ -0,0 +1,10 @@
+# Adding New Features
+
+If you would like to add a new feature to Bundler, please follow these steps:
+
+  1. [Create an issue](https://github.com/bundler/bundler/issues/new) with the [`feature-request` label](https://github.com/bundler/bundler/labels/type:%20feature-request) to discuss your feature.
+  2. Base your commits on the master branch, since we follow [SemVer](http://semver.org) and don't add new features to old releases.
+  3. Commit the code and at least one test covering your changes to a feature branch in your fork.
+  4. Send us a [pull request](PULL_REQUESTS.md) from your feature branch.
+
+If you don't hear back immediately, don’t get discouraged! We all have day jobs, but we respond to most tickets within a day or two.
diff --git a/doc/development/PULL_REQUESTS.md b/doc/development/PULL_REQUESTS.md
new file mode 100644
index 0000000..292aacc
--- /dev/null
+++ b/doc/development/PULL_REQUESTS.md
@@ -0,0 +1,40 @@
+# Submitting Pull Requests
+
+Before you submit a pull request, please remember to do the following:
+
+1. Check your code format and style
+2. Run the test suite
+3. Use a meaningful commit message without tags
+
+## Code formatting
+
+Make sure the code formatting and styling adheres to the guidelines. We use RuboCop for this. Lack of formatting adherence will result in automatic Travis build failures.
+
+      $ bin/rubocop -a
+
+## Tests
+
+Prior to submitting your PR, please run the test suite:
+
+      $ bin/rspec
+
+If you are unable to run the entire test suite, please run the unit test suite and at least the integration specs related to the command or domain of Bundler that your code changes relate to.
+
+Ex. For a pull request that changes something with `bundle update`, you might run:
+
+      $ bin/rspec spec/bundler
+      $ bin/rspec spec/commands/update_spec.rb
+
+## Commit messages
+
+Please ensure that the commit messages included in the pull request __do not__ have the following:
+  - `@tag` GitHub user or team references (ex. `@indirect` or `@bundler/core`)
+  - `#id` references to issues or pull requests (ex. `#43` or `bundler/bundler-site#12`)
+
+If you want to use these mechanisms, please instead include them in the pull request description. This prevents multiple notifications or references being created on commit rebases or pull request/branch force pushes.
+
+Additionally, do not use `[ci skip]` or `[skip ci]` mechanisms in your pull request titles/descriptions or commit messages. Every potential commit and pull request should run through Bundler's CI system. This applies to all changes/commits (ex. even a change to just documentation or the removal of a comment).
+
+## CHANGELOG.md
+
+Don't forget to add your changes into the CHANGELOG! If you're submitting documentation, note the changes under the "Documentation" heading.
diff --git a/doc/development/README.md b/doc/development/README.md
new file mode 100644
index 0000000..54cb4a3
--- /dev/null
+++ b/doc/development/README.md
@@ -0,0 +1,19 @@
+# Development
+
+So, you're ready to start contributing to Bundler! You've come to the right place. Here you'll find an overview of how to work on Bundler locally and a description of the process from code to release.
+
+##[Development setup](SETUP.md)
+
+Guidelines for setting up your local development environment.
+
+##[Submitting pull requests](PULL_REQUESTS.md)
+
+An overview of our preferred PR process, including how to run the test suite and what to expect when you submit code for review.
+
+##[Adding new features](NEW_FEATURES.md)
+
+Guidelines for proposing and writing new features for Bundler.
+
+##[Releasing Bundler](RELEASING.md)
+
+A broad-strokes overview of the release process adhered to by the Bundler core team.
diff --git a/doc/development/RELEASING.md b/doc/development/RELEASING.md
new file mode 100644
index 0000000..eb49647
--- /dev/null
+++ b/doc/development/RELEASING.md
@@ -0,0 +1,9 @@
+# Releasing
+
+_Release process documentation is in progress, see [PR 5252](https://github.com/bundler/bundler/pull/5252)._
+
+## Beta testing
+
+Early releases require heavy testing, especially across various system setups. We :heart: testers, and are big fans of anyone who can run `gem install bundler --pre` and try out upcoming releases in their development and staging environments.
+
+There may not always be prereleases or beta versions of Bundler. The Bundler team will tweet from the [@bundlerio account](http://twitter.com/bundlerio) when a prerelease or beta version becomes available. You are also always welcome to try checking out master and building a gem yourself if you want to try out the latest changes.
diff --git a/doc/development/SETUP.md b/doc/development/SETUP.md
new file mode 100644
index 0000000..10f8dd3
--- /dev/null
+++ b/doc/development/SETUP.md
@@ -0,0 +1,29 @@
+# Development setup
+
+Bundler doesn't use a Gemfile to list development dependencies, because when we tried it we couldn't tell if we were awake or it was just another level of dreams. To work on Bundler, you'll probably want to do a couple of things.
+
+1. Install `groff-base` and `graphviz` packages using your package manager, e.g for ubuntu
+
+      $ sudo apt-get install graphviz groff-base -y
+
+   and for OS X (with brew installed)
+
+      $ brew install graphviz homebrew/dupes/groff
+
+2. Install Bundler's development dependencies
+
+      $ bin/rake spec:deps
+
+3. Run the test suite, to make sure things are working
+
+      $ bin/rake spec
+
+4. Set up a shell alias to run Bundler from your clone, e.g. a Bash alias:
+
+      $ alias dbundle='BUNDLE_TRAMPOLINE_DISABLE=1 ruby -I /path/to/bundler/lib /path/to/bundler/exe/bundle'
+
+   The `BUNDLE_TRAMPOLINE_DISABLE` environment variable ensures that the version of Bundler in `/path/to/bundler/lib` will be used. Without that environment setting, Bundler will automatically download, install, and run the version of Bundler listed in `Gemfile.lock`. With that set up, you can test changes you've made to Bundler by running `dbundle`, without interfering with the regular `bundle` command.
+
+## Debugging with `pry`
+
+To dive into the code with Pry: `RUBYOPT=-rpry dbundle` to require pry and then run commands.
diff --git a/doc/documentation/README.md b/doc/documentation/README.md
new file mode 100644
index 0000000..7ebb054
--- /dev/null
+++ b/doc/documentation/README.md
@@ -0,0 +1,29 @@
+# Documentation
+
+Code needs explanation, and sometimes those who know the code well have trouble explaining it to someone just getting into it. Because of that, we welcome documentation suggestions and patches from everyone, especially if they are brand new to using Bundler.
+
+Currently, Bundler has two main sources of documentation:
+
+1. built-in `help` (including usage information and man pages)
+2. [Bundler documentation site](http://bundler.io)
+
+If you have a suggestion or proposed change for [bundler.io](http://bundler.io), please open an issue or send a pull request to the [bundler-site](https://github.com/bundler/bundler-site) repository.
+
+Not sure where to write documentation? In general, follow these guidelines:
+
+* For an explanation of a specific Bundler command (ex: `bundle clean`): make changes to the man pages
+* For longer explanations or usage guides (ex: "Using Bundler with Rails"): create new documentation within the [bundler-site](https://github.com/bundler/bundler-site) repository
+
+If you are unsure where to begin, ping [@feministy](https://github.com/feministy) or [@indirect](https://github.com/indirect) in the Bundler Slack ([get an invite here](../contributing/GETTING_HELP.md)).
+
+## [Writing docs for man pages)](WRITING.md)
+
+If you’d like to submit a patch to the man pages, you're in the right place! Details on editing and previewing changes to man pages can be found here.
+
+## [Documentation vision](VISION.md)
+
+Just like Bundler, we have a grand plan (really, a wish list of sorts) for Bundler documentation. Preview our hopes and dreams for our documentation here.
+
+## Translations
+
+We don't currently have any translations, but please reach out to us if you would like to help get this going.
diff --git a/doc/documentation/VISION.md b/doc/documentation/VISION.md
new file mode 100644
index 0000000..3d660ee
--- /dev/null
+++ b/doc/documentation/VISION.md
@@ -0,0 +1,26 @@
+# Documentation vision
+
+Currently, documentation for using Bundler is spread across two places:
+
+1. built-in `help` (including usage information and man pages)
+2. [Bundler documentation site](http://bundler.io)
+
+Additional documentation about using Bundler to publish gems can also be found on the [RubyGems guides](http://guides.rubygems.org/).
+
+## Goals
+
+Bundler documentation should provide users with assistance:
+
+1. Installing Bundler
+2. Using Bundler to manage an application's dependencies
+3. Using Bundler to create, package, and publish gems
+
+Our goal is to provide three types of documentation:
+
+* High level overviews that provide topical guidance
+* Step-by-step tutorials
+* Command-specific reference material for the CLI
+
+Additionally, this documentation should be readily available in a logical place and easy to follow.
+
+Someday, we'd like to create deep-dive reference material about the inner workings of Bundler. However, while this is part of our overall vision for Bundler documentation, it is not the focus of our current work.
diff --git a/doc/documentation/WRITING.md b/doc/documentation/WRITING.md
new file mode 100644
index 0000000..ce6dcce
--- /dev/null
+++ b/doc/documentation/WRITING.md
@@ -0,0 +1,54 @@
+# Writing docs for man pages
+
+A primary source of help for Bundler users are the man pages: the output printed when you run `bundle help` (or `bundler help`). These pages can be a little tricky to format and preview, but are pretty straightforward once you get the hang of it.
+
+_Note: `bundler` and `bundle` may be used interchangeably in the CLI. This guide uses `bundle` because it's cuter._
+
+## What goes in man pages?
+
+We use man pages for Bundler commands used in the CLI (command line interface). They can vary in length from large (see `bundle install`) to very short (see `bundle clean`).
+
+To see a list of commands available in the Bundler CLI, type:
+
+      $ bundle help
+
+Our goal is to have a man page for every command.
+
+Don't see a man page for a command? Make a new page and send us a PR! We also welcome edits to existing pages.
+
+## Creating a new man page
+
+To create a new man page, simply create a new `.ronn` file in the `man/` directory.
+
+For example: to create a man page for the command `bundle cookies` (not a real command, sadly), I would create a file `man/bundle-cookies.ronn` and add my documentation there.
+
+## Formatting
+
+Our man pages use ronn formatting, a combination of Markdown and standard man page conventions. It can be a little weird getting used to it at first, especially if you've used Markdown a lot.
+
+[The ronn guide formatting guide](https://rtomayko.github.io/ronn/ronn.7.html) provides a good overview of the common types of formatting.
+
+In general, make your page look like the other pages: utilize sections like `##OPTIONS` and formatting like code blocks and definition lists where appropriate.
+
+If you're not sure if the formatting looks right, that's ok! Make a pull request with what you've got and we'll take a peek.
+
+## Previewing
+
+To preview your changes as they will print out for Bundler users, you'll need to run a series of commands:
+
+```
+$ rake spec:deps
+$ rake man:build
+$ man man/bundle-cookies.1
+```
+
+If you make more changes to `bundle-cookies.ronn`, you'll need to run the `rake man:build` again before previewing.
+
+## Testing
+
+We have tests for our documentation! The most important test file to run before you make your pull request is the one for the `help` command and another for documentation quality.
+
+```
+$ rspec ./spec/commands/help_spec.rb
+$ rspec ./spec/quality_spec.rb
+```
diff --git a/exe/bundle b/exe/bundle
index 51a9035..ab2bde1 100755
--- a/exe/bundle
+++ b/exe/bundle
@@ -2,15 +2,16 @@
 # frozen_string_literal: true
 
 # Exit cleanly from an early interrupt
-Signal.trap("INT") { exit 1 }
-
-unless ENV["BUNDLE_DISABLE_POSTIT"]
-  update = "update".start_with?(ARGV.first || " ") && ARGV.find {|a| a.start_with?("--bundler") }
-  update &&= update =~ /--bundler(?:=(.+))?/ && $1 || "> 0.a"
-  ENV["BUNDLER_VERSION"] = update if update
-  require "bundler/postit_trampoline"
+Signal.trap("INT") do
+  Bundler.ui.debug("\n#{caller.join("\n")}") if defined?(Bundler)
+  exit 1
 end
 
+update = "update".start_with?(ARGV.first || " ") && ARGV.find {|a| a.start_with?("--bundler") }
+update &&= update =~ /--bundler(?:=(.+))?/ && $1 || "> 0.a"
+ENV["BUNDLER_VERSION"] = update if update
+require "bundler/postit_trampoline"
+
 require "bundler"
 # Check if an older version of bundler is installed
 $LOAD_PATH.each do |path|
diff --git a/lib/bundler.rb b/lib/bundler.rb
index a152db3..88822f8 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -3,9 +3,10 @@ require "fileutils"
 require "pathname"
 require "rbconfig"
 require "thread"
+require "tmpdir"
+
 require "bundler/errors"
 require "bundler/environment_preserver"
-require "bundler/gem_remote_fetcher"
 require "bundler/plugin"
 require "bundler/rubygems_ext"
 require "bundler/rubygems_integration"
@@ -27,8 +28,10 @@ module Bundler
   autoload :EndpointSpecification,  "bundler/endpoint_specification"
   autoload :Env,                    "bundler/env"
   autoload :Fetcher,                "bundler/fetcher"
+  autoload :FeatureFlag,            "bundler/feature_flag"
   autoload :GemHelper,              "bundler/gem_helper"
   autoload :GemHelpers,             "bundler/gem_helpers"
+  autoload :GemRemoteFetcher,       "bundler/gem_remote_fetcher"
   autoload :GemVersionPromoter,     "bundler/gem_version_promoter"
   autoload :Graph,                  "bundler/graph"
   autoload :Index,                  "bundler/index"
@@ -37,8 +40,6 @@ module Bundler
   autoload :LazySpecification,      "bundler/lazy_specification"
   autoload :LockfileParser,         "bundler/lockfile_parser"
   autoload :MatchPlatform,          "bundler/match_platform"
-  autoload :Mirror,                 "bundler/mirror"
-  autoload :Mirrors,                "bundler/mirror"
   autoload :RemoteSpecification,    "bundler/remote_specification"
   autoload :Resolver,               "bundler/resolver"
   autoload :Retry,                  "bundler/retry"
@@ -54,6 +55,7 @@ module Bundler
   autoload :StubSpecification,      "bundler/stub_specification"
   autoload :UI,                     "bundler/ui"
   autoload :URICredentialsFilter,   "bundler/uri_credentials_filter"
+  autoload :VersionRanges,          "bundler/version_ranges"
 
   class << self
     attr_writer :bundle_path
@@ -90,7 +92,7 @@ module Bundler
       # Return if all groups are already loaded
       return @setup if defined?(@setup) && @setup
 
-      definition.validate_ruby!
+      definition.validate_runtime!
 
       SharedHelpers.print_major_deprecations!
 
@@ -132,7 +134,7 @@ module Bundler
       @locked_gems ||=
         if defined?(@definition) && @definition
           definition.locked_gems
-        elsif Bundler.default_lockfile.exist?
+        elsif Bundler.default_lockfile.file?
           lock = Bundler.read_file(Bundler.default_lockfile)
           LockfileParser.new(lock)
         end
@@ -142,8 +144,44 @@ module Bundler
       "#{Bundler.rubygems.ruby_engine}/#{Bundler.rubygems.config_map[:ruby_version]}"
     end
 
+    def user_home
+      @user_home ||= begin
+        home = Bundler.rubygems.user_home
+
+        warning = if home.nil?
+          "Your home directory is not set."
+        elsif !File.directory?(home)
+          "`#{home}` is not a directory."
+        elsif !File.writable?(home)
+          "`#{home}` is not writable."
+        end
+
+        if warning
+          user_home = tmp_home_path(Etc.getlogin, warning)
+          Bundler.ui.warn "#{warning}\nBundler will use `#{user_home}' as your home directory temporarily.\n"
+          user_home
+        else
+          Pathname.new(home)
+        end
+      end
+    end
+
+    def tmp_home_path(login, warning)
+      login ||= "unknown"
+      path = Pathname.new(Dir.tmpdir).join("bundler", "home")
+      SharedHelpers.filesystem_access(path) do |tmp_home_path|
+        unless tmp_home_path.exist?
+          tmp_home_path.mkpath
+          tmp_home_path.chmod(0o777)
+        end
+        tmp_home_path.join(login).tap(&:mkpath)
+      end
+    rescue => e
+      raise e.exception("#{warning}\nBundler also failed to create a temporary home directory at `#{path}':\n#{e}")
+    end
+
     def user_bundle_path
-      Pathname.new(Bundler.rubygems.user_home).join(".bundle")
+      Pathname.new(user_home).join(".bundle")
     end
 
     def home
@@ -257,6 +295,11 @@ EOF
       with_clean_env { Kernel.exec(*args) }
     end
 
+    def local_platform
+      return Gem::Platform::RUBY if settings[:force_ruby_platform]
+      Gem::Platform.local
+    end
+
     def default_gemfile
       SharedHelpers.default_gemfile
     end
@@ -328,17 +371,23 @@ EOF
     def sudo(str)
       SUDO_MUTEX.synchronize do
         prompt = "\n\n" + <<-PROMPT.gsub(/^ {6}/, "").strip + " "
-        Your user account isn't allowed to install to the system Rubygems.
+        Your user account isn't allowed to install to the system RubyGems.
         You can cancel this installation and run:
 
             bundle install --path vendor/bundle
 
         to install the gems into ./vendor/bundle/, or you can enter your password
-        and install the bundled gems to Rubygems using sudo.
+        and install the bundled gems to RubyGems using sudo.
 
         Password:
         PROMPT
 
+        unless @prompted_for_sudo ||= system(%(sudo -k -p "#{prompt}" true))
+          raise SudoNotPermittedError,
+            "Bundler requires sudo access to install at the moment. " \
+            "Try installing again, granting Bundler sudo access when prompted, or installing into a different path."
+        end
+
         `sudo -p "#{prompt}" #{str}`
       end
     end
@@ -364,20 +413,20 @@ EOF
 
     def load_gemspec_uncached(file, validate = false)
       path = Pathname.new(file)
-      # Eval the gemspec from its parent directory, because some gemspecs
-      # depend on "./" relative paths.
-      SharedHelpers.chdir(path.dirname.to_s) do
-        contents = path.read
-        spec = if contents[0..2] == "---" # YAML header
-          eval_yaml_gemspec(path, contents)
-        else
+      contents = path.read
+      spec = if contents.start_with?("---") # YAML header
+        eval_yaml_gemspec(path, contents)
+      else
+        # Eval the gemspec from its parent directory, because some gemspecs
+        # depend on "./" relative paths.
+        SharedHelpers.chdir(path.dirname.to_s) do
           eval_gemspec(path, contents)
         end
-        return unless spec
-        spec.loaded_from = path.expand_path.to_s
-        Bundler.rubygems.validate(spec) if validate
-        spec
       end
+      return unless spec
+      spec.loaded_from = path.expand_path.to_s
+      Bundler.rubygems.validate(spec) if validate
+      spec
     end
 
     def clear_gemspec_cache
@@ -389,7 +438,17 @@ EOF
       @git_present = Bundler.which("git") || Bundler.which("git.exe")
     end
 
+    def feature_flag
+      @feature_flag ||= FeatureFlag.new(VERSION)
+    end
+
     def reset!
+      reset_paths!
+      Plugin.reset!
+      reset_rubygems!
+    end
+
+    def reset_paths!
       @root = nil
       @settings = nil
       @definition = nil
@@ -398,9 +457,10 @@ EOF
       @locked_gems = nil
       @bundle_path = nil
       @bin_path = nil
+      @user_home = nil
+    end
 
-      Plugin.reset!
-
+    def reset_rubygems!
       return unless defined?(@rubygems) && @rubygems
       rubygems.undo_replacements
       rubygems.reset
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 0453480..c55e2a9 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -4,7 +4,6 @@ require "bundler/vendored_thor"
 
 module Bundler
   class CLI < Thor
-    include Thor::Actions
     AUTO_INSTALL_CMDS = %w(show binstubs outdated exec open console licenses clean).freeze
 
     def self.start(*)
@@ -13,6 +12,7 @@ module Bundler
       Bundler.ui = UI::Shell.new
       raise e
     ensure
+      warn_on_outdated_bundler
       Bundler::SharedHelpers.print_major_deprecations!
     end
 
@@ -22,10 +22,12 @@ module Bundler
 
     def initialize(*args)
       super
-      Bundler.reset!
 
       custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
-      ENV["BUNDLE_GEMFILE"] = File.expand_path(custom_gemfile) if custom_gemfile && !custom_gemfile.empty?
+      if custom_gemfile && !custom_gemfile.empty?
+        ENV["BUNDLE_GEMFILE"] = File.expand_path(custom_gemfile)
+        Bundler.reset_paths!
+      end
 
       Bundler.settings[:retry] = options[:retry] if options[:retry]
 
@@ -36,8 +38,10 @@ module Bundler
     ensure
       self.options ||= {}
       Bundler.settings.cli_flags_given = !options.empty?
+      unprinted_warnings = Bundler.ui.unprinted_warnings
       Bundler.ui = UI::Shell.new(options)
       Bundler.ui.level = "debug" if options["verbose"]
+      unprinted_warnings.each {|w| Bundler.ui.warn(w) }
 
       if ENV["RUBYGEMS_GEMDEPS"] && !ENV["RUBYGEMS_GEMDEPS"].empty?
         Bundler.ui.warn(
@@ -59,30 +63,21 @@ module Bundler
 
     def help(cli = nil)
       case cli
-      when "gemfile" then command = "gemfile.5"
+      when "gemfile" then command = "gemfile"
       when nil       then command = "bundle"
       else command = "bundle-#{cli}"
       end
 
-      manpages = %w(
-        bundle
-        bundle-config
-        bundle-exec
-        bundle-gem
-        bundle-install
-        bundle-package
-        bundle-update
-        bundle-platform
-        gemfile.5
-      )
-
-      if manpages.include?(command)
-        root = File.expand_path("../man", __FILE__)
-
-        if Bundler.which("man") && root !~ %r{^file:/.+!/META-INF/jruby.home/.+}
-          Kernel.exec "man #{root}/#{command}"
+      man_path  = File.expand_path("../../../man", __FILE__)
+      man_pages = Hash[Dir.glob(File.join(man_path, "*")).grep(/.*\.\d*\Z/).collect do |f|
+        [File.basename(f, ".*"), f]
+      end]
+
+      if man_pages.include?(command)
+        if Bundler.which("man") && man_path !~ %r{^file:/.+!/META-INF/jruby.home/.+}
+          Kernel.exec "man #{man_pages[command]}"
         else
-          puts File.read("#{root}/#{command}.txt")
+          puts File.read("#{man_path}/#{File.basename(man_pages[command])}.txt")
         end
       elsif command_path = Bundler.which("bundler-#{cli}")
         Kernel.exec(command_path, "--help")
@@ -91,8 +86,11 @@ module Bundler
       end
     end
 
+    # Ensure `bundle help --no-color` is valid
+    all_commands["help"].disable_class_options = false
+
     def self.handle_no_command_error(command, has_namespace = $thor_runner)
-      if Bundler.settings[:plugins] && Bundler::Plugin.command?(command)
+      if Bundler.feature_flag.plugins? && Bundler::Plugin.command?(command)
         return Bundler::Plugin.exec_command(command, ARGV[1..-1])
       end
 
@@ -184,11 +182,9 @@ module Bundler
     map "i" => "install"
     def install
       require "bundler/cli/install"
-      no_install = Bundler.settings[:no_install]
-      Bundler.settings[:no_install] = false if no_install == true
-      Install.new(options.dup).run
-    ensure
-      Bundler.settings[:no_install] = no_install unless no_install.nil?
+      Bundler.settings.temporary(:no_install => false) do
+        Install.new(options.dup).run
+      end
     end
 
     desc "update [OPTIONS]", "update the current environment"
@@ -215,14 +211,16 @@ module Bundler
       "Update ruby specified in Gemfile.lock"
     method_option "bundler", :type => :string, :lazy_default => "> 0.a", :banner =>
       "Update the locked version of bundler"
-    method_option "patch", :type => :boolean, :hide => true, :banner =>
+    method_option "patch", :type => :boolean, :banner =>
       "Prefer updating only to next patch version"
-    method_option "minor", :type => :boolean, :hide => true, :banner =>
+    method_option "minor", :type => :boolean, :banner =>
       "Prefer updating only to next minor version"
-    method_option "major", :type => :boolean, :hide => true, :banner =>
+    method_option "major", :type => :boolean, :banner =>
       "Prefer updating to next major version (default)"
-    method_option "strict", :type => :boolean, :hide => true, :banner =>
-      "Do not allow any gem to be updated past latest --patch/--minor/--major"
+    method_option "strict", :type => :boolean, :banner =>
+      "Do not allow any gem to be updated past latest --patch | --minor | --major"
+    method_option "conservative", :type => :boolean, :banner =>
+      "Use bundle install conservative update behavior and do not allow shared dependencies to be updated."
     def update(*gems)
       require "bundler/cli/update"
       Update.new(options, gems).run
@@ -245,6 +243,13 @@ module Bundler
     # TODO: 2.0 remove `bundle list`
     map %w(list) => "show"
 
+    desc "info GEM [OPTIONS]", "Show information for the given gem"
+    method_option "path", :type => :boolean, :banner => "Print full path to gem"
+    def info(gem_name)
+      require "bundler/cli/info"
+      Info.new(options, gem_name).run
+    end
+
     desc "binstubs GEM [OPTIONS]", "Install the binstubs of the listed gem"
     long_desc <<-D
       Generate binstubs for executables in [GEM]. Binstubs are put into bin,
@@ -255,29 +260,52 @@ module Bundler
       "Overwrite existing binstubs if they exist"
     method_option "path", :type => :string, :lazy_default => "bin", :banner =>
       "Binstub destination directory (default bin)"
-    method_option "standalone", :type => :array, :lazy_default => [], :banner =>
+    method_option "standalone", :type => :boolean, :banner =>
       "Make binstubs that can work without the Bundler runtime"
     def binstubs(*gems)
       require "bundler/cli/binstubs"
       Binstubs.new(options, gems).run
     end
 
+    desc "add GEM VERSION", "Add gem to Gemfile and run bundle install"
+    long_desc <<-D
+      Adds the specified gem to Gemfile (if valid) and run 'bundle install' in one step.
+    D
+    method_option "version", :aliases => "-v", :type => :string
+    method_option "group", :aliases => "-g", :type => :string
+    method_option "source", :aliases => "-s", :type => :string
+
+    def add(gem_name)
+      require "bundler/cli/add"
+      Add.new(options.dup, gem_name).run
+    end
+
     desc "outdated GEM [OPTIONS]", "list installed gems with newer versions available"
     long_desc <<-D
       Outdated lists the names and versions of gems that have a newer version available
       in the given source. Calling outdated with [GEM [GEM]] will only check for newer
       versions of the given gems. Prerelease gems are ignored by default. If your gems
       are up to date, Bundler will exit with a status of 0. Otherwise, it will exit 1.
+
+      For more information on patch level options (--major, --minor, --patch,
+      --update-strict) see documentation on the same options on the update command.
     D
+    method_option "group", :aliases => "--group", :type => :string, :banner => "List gems from a specific group"
+    method_option "groups", :aliases => "--groups", :type => :boolean, :banner => "List gems organized by groups"
     method_option "local", :type => :boolean, :banner =>
       "Do not attempt to fetch gems remotely and use the gem cache instead"
     method_option "pre", :type => :boolean, :banner => "Check for newer pre-release gems"
     method_option "source", :type => :array, :banner => "Check against a specific source"
     method_option "strict", :type => :boolean, :banner =>
       "Only list newer versions allowed by your Gemfile requirements"
-    method_option "major", :type => :boolean, :banner => "Only list major newer versions"
-    method_option "minor", :type => :boolean, :banner => "Only list minor newer versions"
-    method_option "patch", :type => :boolean, :banner => "Only list patch newer versions"
+    method_option "update-strict", :type => :boolean, :banner =>
+      "Strict conservative resolution, do not allow any gem to be updated past latest --patch | --minor | --major"
+    method_option "minor", :type => :boolean, :banner => "Prefer updating only to next minor version"
+    method_option "major", :type => :boolean, :banner => "Prefer updating to next major version (default)"
+    method_option "patch", :type => :boolean, :banner => "Prefer updating only to next patch version"
+    method_option "filter-major", :type => :boolean, :banner => "Only list major newer versions"
+    method_option "filter-minor", :type => :boolean, :banner => "Only list minor newer versions"
+    method_option "filter-patch", :type => :boolean, :banner => "Only list patch newer versions"
     method_option "parseable", :aliases => "--porcelain", :type => :boolean, :banner =>
       "Use minimal formatting for more parseable output"
     def outdated(*gems)
@@ -344,6 +372,7 @@ module Bundler
       will show the current value, as well as any superceded values and
       where they were specified.
     D
+    method_option "parseable", :type => :boolean, :banner => "Use minimal formatting for more parseable output"
     def config(*args)
       require "bundler/cli/config"
       Config.new(options, args, self).run
@@ -398,6 +427,8 @@ module Bundler
       Viz.new(options.dup).run
     end
 
+    old_gem = instance_method(:gem)
+
     desc "gem GEM [OPTIONS]", "Creates a skeleton for creating a rubygem"
     method_option :exe, :type => :boolean, :default => false, :aliases => ["--bin", "-b"], :desc => "Generate a binary executable for your library."
     method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config gem.coc true`."
@@ -409,10 +440,30 @@ module Bundler
     method_option :test, :type => :string, :lazy_default => "rspec", :aliases => "-t", :banner => "rspec",
                          :desc => "Generate a test directory for your library, either rspec or minitest. Set a default with `bundle config gem.test rspec`."
     def gem(name)
-      require "bundler/cli/gem"
-      Gem.new(options, name, self).run
     end
 
+    commands["gem"].tap do |gem_command|
+      def gem_command.run(instance, args = [])
+        arity = 1 # name
+
+        require "bundler/cli/gem"
+        cmd_args = args + [instance]
+        cmd_args.unshift(instance.options)
+
+        cmd = begin
+          Gem.new(*cmd_args)
+        rescue ArgumentError => e
+          instance.class.handle_argument_error(self, e, args, arity)
+        end
+
+        cmd.run
+      end
+    end
+
+    undef_method(:gem)
+    define_method(:gem, old_gem)
+    private :gem
+
     def self.source_root
       File.expand_path(File.join(File.dirname(__FILE__), "templates"))
     end
@@ -435,15 +486,19 @@ module Bundler
       Platform.new(options).run
     end
 
-    desc "inject GEM VERSION ...", "Add the named gem(s), with version requirements, to the resolved Gemfile"
-    def inject(name, version, *gems)
+    desc "inject GEM VERSION", "Add the named gem, with version requirements, to the resolved Gemfile"
+    method_option "source", :type => :string, :banner =>
+     "Install gem from the given source"
+    method_option "group", :type => :string, :banner =>
+     "Install gem into a bundler group"
+    def inject(name, version)
       SharedHelpers.major_deprecation "The `inject` command has been replaced by the `add` command"
       require "bundler/cli/inject"
-      Inject.new(options, name, version, gems).run
+      Inject.new(options.dup, name, version).run
     end
 
     desc "lock", "Creates a lockfile without installing"
-    method_option "update", :type => :array, :lazy_default => [], :banner =>
+    method_option "update", :type => :array, :lazy_default => true, :banner =>
       "ignore the existing lockfile, update all gems by default, or update list of given gems"
     method_option "local", :type => :boolean, :default => false, :banner =>
       "do not attempt to fetch remote gemspecs and use the local gem cache only"
@@ -454,9 +509,19 @@ module Bundler
     method_option "full-index", :type => :boolean, :default => false, :banner =>
       "Fall back to using the single-file index of all gems"
     method_option "add-platform", :type => :array, :default => [], :banner =>
-      "add a new platform to the lockfile"
+      "Add a new platform to the lockfile"
     method_option "remove-platform", :type => :array, :default => [], :banner =>
-      "remove a platform from the lockfile"
+      "Remove a platform from the lockfile"
+    method_option "patch", :type => :boolean, :banner =>
+      "If updating, prefer updating only to next patch version"
+    method_option "minor", :type => :boolean, :banner =>
+      "If updating, prefer updating only to next minor version"
+    method_option "major", :type => :boolean, :banner =>
+      "If updating, prefer updating to next major version (default)"
+    method_option "strict", :type => :boolean, :banner =>
+      "If updating, do not allow any gem to be updated past latest --patch | --minor | --major"
+    method_option "conservative", :type => :boolean, :banner =>
+      "If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated"
     def lock
       require "bundler/cli/lock"
       Lock.new(options).run
@@ -482,7 +547,19 @@ module Bundler
       Doctor.new(options).run
     end
 
-    if Bundler.settings[:plugins]
+    desc "issue", "Learn how to report an issue in Bundler"
+    def issue
+      require "bundler/cli/issue"
+      Issue.new.run
+    end
+
+    desc "pristine", "Restores installed gems to pristine condition from files located in the gem cache. Gem installed from a git repository will be issued `git checkout --force`."
+    def pristine
+      require "bundler/cli/pristine"
+      Pristine.new.run
+    end
+
+    if Bundler.feature_flag.plugins?
       require "bundler/cli/plugin"
       desc "plugin SUBCOMMAND ...ARGS", "manage the bundler plugins"
       subcommand "plugin", Plugin
@@ -544,5 +621,26 @@ module Bundler
       command.reject!(&:empty?)
       Bundler.ui.info "Running `#{command * " "}` with bundler #{Bundler::VERSION}"
     end
+
+    def self.warn_on_outdated_bundler
+      return if Bundler.settings[:disable_version_check]
+
+      latest = Fetcher::CompactIndex.
+               new(nil, Source::Rubygems::Remote.new(URI("https://rubygems.org")), nil).
+               send(:compact_index_client).
+               instance_variable_get(:@cache).
+               dependencies("bundler").
+               map {|d| Gem::Version.new(d.first) }.
+               max
+      return unless latest
+
+      current = Gem::Version.new(VERSION)
+      return if current >= latest
+
+      Bundler.ui.warn "The latest bundler is #{latest}, but you are currently running #{current}.\nTo update, run `gem install bundler#{" --pre" if latest.prerelease?}`"
+    rescue
+      nil
+    end
+    private_class_method :warn_on_outdated_bundler
   end
 end
diff --git a/lib/bundler/cli/add.rb b/lib/bundler/cli/add.rb
new file mode 100644
index 0000000..e80c775
--- /dev/null
+++ b/lib/bundler/cli/add.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+require "bundler/cli/common"
+
+module Bundler
+  class CLI::Add
+    def initialize(options, gem_name)
+      @gem_name = gem_name
+      @options = options
+      @options[:group] = @options[:group].split(",").map(&:strip) if !@options[:group].nil? && !@options[:group].empty?
+    end
+
+    def run
+      version = @options[:version].nil? ? nil : @options[:version].split(",").map(&:strip)
+
+      unless version.nil?
+        version.each do |v|
+          raise InvalidOption, "Invalid gem requirement pattern '#{v}'" unless Gem::Requirement::PATTERN =~ v.to_s
+        end
+      end
+      dependency = Bundler::Dependency.new(@gem_name, version, @options)
+
+      Injector.inject([dependency], :conservative_versioning => @options[:version].nil?) # Perform conservative versioning only when version is not specified
+      Installer.install(Bundler.root, Bundler.definition)
+    end
+  end
+end
diff --git a/lib/bundler/cli/binstubs.rb b/lib/bundler/cli/binstubs.rb
index f7a27b0..95103b7 100644
--- a/lib/bundler/cli/binstubs.rb
+++ b/lib/bundler/cli/binstubs.rb
@@ -10,7 +10,7 @@ module Bundler
     end
 
     def run
-      Bundler.definition.validate_ruby!
+      Bundler.definition.validate_runtime!
       Bundler.settings[:bin] = options["path"] if options["path"]
       Bundler.settings[:bin] = nil if options["path"] && options["path"].empty?
       installer = Installer.new(Bundler.root, Bundler.definition)
diff --git a/lib/bundler/cli/cache.rb b/lib/bundler/cli/cache.rb
index c8c63e9..5ba105a 100644
--- a/lib/bundler/cli/cache.rb
+++ b/lib/bundler/cli/cache.rb
@@ -7,7 +7,7 @@ module Bundler
     end
 
     def run
-      Bundler.definition.validate_ruby!
+      Bundler.definition.validate_runtime!
       Bundler.definition.resolve_with_cache!
       setup_cache_all
       Bundler.settings[:cache_all_platforms] = options["all-platforms"] if options.key?("all-platforms")
diff --git a/lib/bundler/cli/check.rb b/lib/bundler/cli/check.rb
index 738d40b..057a7e5 100644
--- a/lib/bundler/cli/check.rb
+++ b/lib/bundler/cli/check.rb
@@ -15,7 +15,7 @@ module Bundler
 
       begin
         definition = Bundler.definition
-        definition.validate_ruby!
+        definition.validate_runtime!
         not_installed = definition.missing_specs
       rescue GemNotFound, VersionConflict
         Bundler.ui.error "Bundler can't satisfy your Gemfile's dependencies."
@@ -28,7 +28,7 @@ module Bundler
         not_installed.each {|s| Bundler.ui.error " * #{s.name} (#{s.version})" }
         Bundler.ui.warn "Install missing gems with `bundle install`"
         exit 1
-      elsif !Bundler.default_lockfile.exist? && Bundler.settings[:frozen]
+      elsif !Bundler.default_lockfile.file? && Bundler.settings[:frozen]
         Bundler.ui.error "This bundle has been frozen, but there is no #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} present"
         exit 1
       else
diff --git a/lib/bundler/cli/clean.rb b/lib/bundler/cli/clean.rb
index 895b656..5eba09c 100644
--- a/lib/bundler/cli/clean.rb
+++ b/lib/bundler/cli/clean.rb
@@ -8,7 +8,7 @@ module Bundler
     end
 
     def run
-      require_path_or_force
+      require_path_or_force unless options[:"dry-run"]
       Bundler.load.clean(options[:"dry-run"])
     end
 
diff --git a/lib/bundler/cli/common.rb b/lib/bundler/cli/common.rb
index 491ea04..bacbb2e 100644
--- a/lib/bundler/cli/common.rb
+++ b/lib/bundler/cli/common.rb
@@ -1,6 +1,23 @@
 # frozen_string_literal: true
 module Bundler
   module CLI::Common
+    def self.output_post_install_messages(messages)
+      return if Bundler.settings["ignore_messages"]
+      messages.to_a.each do |name, msg|
+        print_post_install_message(name, msg) unless Bundler.settings["ignore_messages.#{name}"]
+      end
+    end
+
+    def self.print_post_install_message(name, msg)
+      Bundler.ui.confirm "Post-install message from #{name}:"
+      Bundler.ui.info msg
+    end
+
+    def self.output_without_groups_message
+      return unless Bundler.settings.without.any?
+      Bundler.ui.confirm without_groups_message
+    end
+
     def self.without_groups_message
       groups = Bundler.settings.without
       group_list = [groups[0...-1].join(", "), groups[-1..-1]].
@@ -52,5 +69,25 @@ module Bundler
       message += "\nDid you mean #{suggestions}?" if suggestions
       message
     end
+
+    def self.ensure_all_gems_in_lockfile!(names, locked_gems = Bundler.locked_gems)
+      locked_names = locked_gems.specs.map(&:name)
+      names.-(locked_names).each do |g|
+        raise GemNotFound, gem_not_found_message(g, locked_names)
+      end
+    end
+
+    def self.configure_gem_version_promoter(definition, options)
+      patch_level = patch_level_options(options)
+      raise InvalidOption, "Provide only one of the following options: #{patch_level.join(", ")}" unless patch_level.length <= 1
+      definition.gem_version_promoter.tap do |gvp|
+        gvp.level = patch_level.first || :major
+        gvp.strict = options[:strict] || options["update-strict"]
+      end
+    end
+
+    def self.patch_level_options(options)
+      [:major, :minor, :patch].select {|v| options.keys.include?(v.to_s) }
+    end
   end
 end
diff --git a/lib/bundler/cli/config.rb b/lib/bundler/cli/config.rb
index 32724f6..e8f1362 100644
--- a/lib/bundler/cli/config.rb
+++ b/lib/bundler/cli/config.rb
@@ -33,6 +33,13 @@ module Bundler
       end
 
       if args.empty?
+        if options[:parseable]
+          if value = Bundler.settings[name]
+            Bundler.ui.info("#{name}=#{value}")
+          end
+          return
+        end
+
         confirm(name)
         return
       end
@@ -44,11 +51,20 @@ module Bundler
   private
 
     def confirm_all
-      Bundler.ui.confirm "Settings are listed in order of priority. The top value will be used.\n"
-      Bundler.settings.all.each do |setting|
-        Bundler.ui.confirm "#{setting}"
-        show_pretty_values_for(setting)
-        Bundler.ui.confirm ""
+      if @options[:parseable]
+        thor.with_padding do
+          Bundler.settings.all.each do |setting|
+            val = Bundler.settings[setting]
+            Bundler.ui.info "#{setting}=#{val}"
+          end
+        end
+      else
+        Bundler.ui.confirm "Settings are listed in order of priority. The top value will be used.\n"
+        Bundler.settings.all.each do |setting|
+          Bundler.ui.confirm "#{setting}"
+          show_pretty_values_for(setting)
+          Bundler.ui.confirm ""
+        end
       end
     end
 
@@ -68,7 +84,9 @@ module Bundler
 
     def message
       locations = Bundler.settings.locations(name)
-      if scope == "global"
+      if @options[:parseable]
+        "#{name}=#{new_value}" if new_value
+      elsif scope == "global"
         if locations[:local]
           "Your application has set #{name} to #{locations[:local].inspect}. " \
             "This will override the global value you are currently setting"
diff --git a/lib/bundler/cli/doctor.rb b/lib/bundler/cli/doctor.rb
index 8fd862a..ae27983 100644
--- a/lib/bundler/cli/doctor.rb
+++ b/lib/bundler/cli/doctor.rb
@@ -14,11 +14,11 @@ module Bundler
     end
 
     def otool_available?
-      system("otool --version 2>&1 >#{Bundler::NULL}")
+      Bundler.which("otool")
     end
 
     def ldd_available?
-      !system("ldd --help 2>&1 >#{Bundler::NULL}").nil?
+      Bundler.which("ldd")
     end
 
     def dylibs_darwin(path)
@@ -55,22 +55,18 @@ module Bundler
       Dir.glob("#{spec.full_gem_path}/**/*.bundle")
     end
 
+    def check!
+      require "bundler/cli/check"
+      Bundler::CLI::Check.new({}).run
+    end
+
     def run
       Bundler.ui.level = "error" if options[:quiet]
+      check!
 
+      definition = Bundler.definition
       broken_links = {}
 
-      begin
-        definition = Bundler.definition
-        definition.validate_ruby!
-        not_installed = definition.missing_specs
-        raise GemNotFound if not_installed.any?
-      rescue GemNotFound
-        Bundler.ui.warn "This bundle's gems must be installed to run this command."
-        Bundler.ui.warn "Install missing gems with `bundle install`."
-        exit 0
-      end
-
       definition.specs.each do |spec|
         bundles_for_gem(spec).each do |bundle|
           bad_paths = dylibs(bundle).select {|f| !File.exist?(f) }
@@ -82,13 +78,15 @@ module Bundler
       end
 
       if broken_links.any?
-        Bundler.ui.error "The following gems are missing OS dependencies"
-        broken_links.each do |spec, paths|
-          paths.uniq.each do |path|
-            Bundler.ui.error " * #{spec.name}: #{path}"
+        message = "The following gems are missing OS dependencies:"
+        broken_links.map do |spec, paths|
+          paths.uniq.map do |path|
+            "\n * #{spec.name}: #{path}"
           end
-        end
-        exit 1
+        end.flatten.sort.each {|m| message += m }
+        raise ProductionError, message
+      else
+        Bundler.ui.info "No issues found with the installed bundle"
       end
     end
   end
diff --git a/lib/bundler/cli/exec.rb b/lib/bundler/cli/exec.rb
index 4f238bb..62f7bc2 100644
--- a/lib/bundler/cli/exec.rb
+++ b/lib/bundler/cli/exec.rb
@@ -91,6 +91,12 @@ module Bundler
         "#!/usr/bin/env jruby\n",
         "#!#{Gem.ruby}\n",
       ]
+
+      if File.zero?(file)
+        Bundler.ui.warn "#{file} is empty"
+        return false
+      end
+
       first_line = File.open(file, "rb") {|f| f.read(possibilities.map(&:size).max) }
       possibilities.any? {|shebang| first_line.start_with?(shebang) }
     end
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb
index 27f4262..0e4b7f7 100644
--- a/lib/bundler/cli/gem.rb
+++ b/lib/bundler/cli/gem.rb
@@ -2,6 +2,11 @@
 require "pathname"
 
 module Bundler
+  class CLI
+    Bundler.require_thor_actions
+    include Thor::Actions
+  end
+
   class CLI::Gem
     TEST_FRAMEWORK_VERSIONS = {
       "rspec" => "3.0",
@@ -13,7 +18,10 @@ module Bundler
     def initialize(options, gem_name, thor)
       @options = options
       @gem_name = resolve_name(gem_name)
+
       @thor = thor
+      thor.behavior = :invoke
+      thor.destination_root = nil
 
       @name = @gem_name
       @target = SharedHelpers.pwd.join(gem_name)
@@ -29,8 +37,11 @@ module Bundler
       constant_name = name.gsub(/-[_-]*(?![_-]|$)/) { "::" }.gsub(/([_-]+|(::)|^)(.|$)/) { $2.to_s + $3.upcase }
       constant_array = constant_name.split("::")
 
-      git_user_name = `git config user.name`.chomp
-      git_user_email = `git config user.email`.chomp
+      git_installed = Bundler.git_present?
+
+      git_author_name = git_installed ? `git config user.name`.chomp : ""
+      github_username = git_installed ? `git config github.user`.chomp : ""
+      git_user_email = git_installed ? `git config user.email`.chomp : ""
 
       config = {
         :name             => name,
@@ -39,18 +50,18 @@ module Bundler
         :makefile_path    => "#{underscored_name}/#{underscored_name}",
         :constant_name    => constant_name,
         :constant_array   => constant_array,
-        :author           => git_user_name.empty? ? "TODO: Write your name" : git_user_name,
+        :author           => git_author_name.empty? ? "TODO: Write your name" : git_author_name,
         :email            => git_user_email.empty? ? "TODO: Write your email address" : git_user_email,
         :test             => options[:test],
         :ext              => options[:ext],
         :exe              => options[:exe],
-        :bundler_version  => bundler_dependency_version
+        :bundler_version  => bundler_dependency_version,
+        :github_username  => github_username.empty? ? "[USERNAME]" : github_username
       }
       ensure_safe_gem_name(name, constant_array)
 
       templates = {
         "Gemfile.tt" => "Gemfile",
-        "gitignore.tt" => ".gitignore",
         "lib/newgem.rb.tt" => "lib/#{namespaced_path}.rb",
         "lib/newgem/version.rb.tt" => "lib/#{namespaced_path}/version.rb",
         "newgem.gemspec.tt" => "#{name}.gemspec",
@@ -65,6 +76,8 @@ module Bundler
         bin/setup
       )
 
+      templates.merge!("gitignore.tt" => ".gitignore") if Bundler.git_present?
+
       if test_framework = ask_and_set_test_framework
         config[:test] = test_framework
         config[:test_framework_version] = TEST_FRAMEWORK_VERSIONS[test_framework]
@@ -121,7 +134,10 @@ module Bundler
       end
 
       templates.each do |src, dst|
-        thor.template("newgem/#{src}", target.join(dst), config)
+        destination = target.join(dst)
+        SharedHelpers.filesystem_access(destination) do
+          thor.template("newgem/#{src}", destination, config)
+        end
       end
 
       executables.each do |file|
@@ -130,14 +146,18 @@ module Bundler
         path.chmod(executable)
       end
 
-      Bundler.ui.info "Initializing git repo in #{target}"
-      Dir.chdir(target) do
-        `git init`
-        `git add .`
+      if Bundler.git_present?
+        Bundler.ui.info "Initializing git repo in #{target}"
+        Dir.chdir(target) do
+          `git init`
+          `git add .`
+        end
       end
 
       # Open gemspec in editor
       open_editor(options["edit"], target.join("#{name}.gemspec")) if options[:edit]
+    rescue Errno::EEXIST => e
+      raise GenericSystemCallError.new(e, "There was a conflict while creating the new gem.")
     end
 
   private
@@ -201,10 +221,23 @@ module Bundler
       if name =~ /^\d/
         Bundler.ui.error "Invalid gem name #{name} Please give a name which does not start with numbers."
         exit 1
-      elsif constant_array.inject(Object) {|c, s| (c.const_defined?(s) && c.const_get(s)) || break }
-        Bundler.ui.error "Invalid gem name #{name} constant #{constant_array.join("::")} is already in use. Please choose another gem name."
-        exit 1
       end
+
+      constant_name = constant_array.join("::")
+
+      existing_constant = constant_array.inject(Object) do |c, s|
+        defined = begin
+          c.const_defined?(s)
+        rescue NameError
+          Bundler.ui.error "Invalid gem name #{name} -- `#{constant_name}` is an invalid constant name"
+          exit 1
+        end
+        (defined && c.const_get(s)) || break
+      end
+
+      return unless existing_constant
+      Bundler.ui.error "Invalid gem name #{name} constant #{constant_name} is already in use. Please choose another gem name."
+      exit 1
     end
 
     def open_editor(editor, file)
diff --git a/lib/bundler/cli/info.rb b/lib/bundler/cli/info.rb
new file mode 100644
index 0000000..4465fba
--- /dev/null
+++ b/lib/bundler/cli/info.rb
@@ -0,0 +1,51 @@
+# frozen_string_literal: true
+require "bundler/cli/common"
+
+module Bundler
+  class CLI::Info
+    attr_reader :gem_name, :options
+    def initialize(options, gem_name)
+      @options = options
+      @gem_name = gem_name
+    end
+
+    def run
+      spec = spec_for_gem(gem_name)
+
+      spec_not_found(gem_name) unless spec
+      return print_gem_path(spec) if @options[:path]
+      print_gem_info(spec)
+    end
+
+  private
+
+    def spec_for_gem(gem_name)
+      spec = Bundler.definition.specs.find {|s| s.name == gem_name }
+      spec || default_gem_spec(gem_name)
+    end
+
+    def default_gem_spec(gem_name)
+      return unless Gem::Specification.respond_to?(:find_all_by_name)
+      gem_spec = Gem::Specification.find_all_by_name(gem_name).last
+      return gem_spec if gem_spec && gem_spec.respond_to?(:default_gem?) && gem_spec.default_gem?
+    end
+
+    def spec_not_found(gem_name)
+      raise GemNotFound, Bundler::CLI::Common.gem_not_found_message(gem_name, Bundler.definition.dependencies)
+    end
+
+    def print_gem_path(spec)
+      Bundler.ui.info spec.full_gem_path
+    end
+
+    def print_gem_info(spec)
+      gem_info = String.new
+      gem_info << "  * #{spec.name} (#{spec.version}#{spec.git_version})\n"
+      gem_info << "\tSummary: #{spec.summary}\n" if spec.summary
+      gem_info << "\tHomepage: #{spec.homepage}\n" if spec.homepage
+      gem_info << "\tPath: #{spec.full_gem_path}\n"
+      gem_info << "\tDefault Gem: yes" if spec.respond_to?(:default_gem?) && spec.default_gem?
+      Bundler.ui.info gem_info
+    end
+  end
+end
diff --git a/lib/bundler/cli/init.rb b/lib/bundler/cli/init.rb
index 4bbdee1..8ffd1db 100644
--- a/lib/bundler/cli/init.rb
+++ b/lib/bundler/cli/init.rb
@@ -18,7 +18,9 @@ module Bundler
           Bundler.ui.error "Gem specification #{gemspec} doesn't exist"
           exit 1
         end
-        spec = Gem::Specification.load(gemspec)
+
+        spec = Bundler.load_gemspec_uncached(gemspec)
+
         puts "Writing new Gemfile to #{SharedHelpers.pwd}/Gemfile"
         File.open("Gemfile", "wb") do |file|
           file << "# Generated from #{gemspec}\n"
diff --git a/lib/bundler/cli/inject.rb b/lib/bundler/cli/inject.rb
index 9d1d081..b172926 100644
--- a/lib/bundler/cli/inject.rb
+++ b/lib/bundler/cli/inject.rb
@@ -2,13 +2,13 @@
 module Bundler
   class CLI::Inject
     attr_reader :options, :name, :version, :group, :source, :gems
-    def initialize(options, name, version, gems)
+    def initialize(options, name, version)
       @options = options
       @name = name
       @version = version || last_version_number
-      @group = options[:group]
+      @group = options[:group].split(",") unless options[:group].nil?
       @source = options[:source]
-      @gems = gems
+      @gems = []
     end
 
     def run
@@ -18,6 +18,8 @@ module Bundler
 
       # Build an array of Dependency objects out of the arguments
       deps = []
+      # when `inject` support addition of more than one gem, then this loop will
+      # help. Currently this loop is running once.
       gems.each_slice(4) do |gem_name, gem_version, gem_group, gem_source|
         ops = Gem::Requirement::OPS.map {|key, _val| key }
         has_op = ops.any? {|op| gem_version.start_with? op }
@@ -29,7 +31,13 @@ module Bundler
 
       if added.any?
         Bundler.ui.confirm "Added to Gemfile:"
-        Bundler.ui.confirm added.map {|g| "  #{g}" }.join("\n")
+        Bundler.ui.confirm(added.map do |d|
+          name = "'#{d.name}'"
+          requirement = ", '#{d.requirement}'"
+          group = ", :group => #{d.groups.inspect}" if d.groups != Array(:default)
+          source = ", :source => '#{d.source}'" unless d.source.nil?
+          %(gem #{name}#{requirement}#{group}#{source})
+        end.join("\n"))
       else
         Bundler.ui.confirm "All gems were already present in the Gemfile"
       end
diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb
index 5c7b8c5..752c5e9 100644
--- a/lib/bundler/cli/install.rb
+++ b/lib/bundler/cli/install.rb
@@ -1,4 +1,6 @@
 # frozen_string_literal: true
+require "bundler/cli/common"
+
 module Bundler
   class CLI::Install
     attr_reader :options
@@ -57,36 +59,29 @@ module Bundler
 
       if options["binstubs"]
         Bundler::SharedHelpers.major_deprecation \
-          "the --binstubs option will be removed in favor of `bundle binstubs`"
+          "The --binstubs option will be removed in favor of `bundle binstubs`"
       end
 
-      # rubygems plugins sometimes hook into the gem install process
-      Gem.load_env_plugins if Gem.respond_to?(:load_env_plugins)
-
-      Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.settings[:plugins]
+      Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
 
       definition = Bundler.definition
-      definition.validate_ruby!
+      definition.validate_runtime!
 
       installer = Installer.install(Bundler.root, definition, options)
       Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.settings[:frozen]
 
       Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}."
-      confirm_without_groups
+      Bundler::CLI::Common.output_without_groups_message
 
       if Bundler.settings[:path]
         absolute_path = File.expand_path(Bundler.settings[:path])
         relative_path = absolute_path.sub(File.expand_path(".") + File::SEPARATOR, "." + File::SEPARATOR)
         Bundler.ui.confirm "Bundled gems are installed into #{relative_path}."
       else
-        Bundler.ui.confirm "Use `bundle show [gemname]` to see where a bundled gem is installed."
+        Bundler.ui.confirm "Use `bundle info [gemname]` to see where a bundled gem is installed."
       end
 
-      unless Bundler.settings["ignore_messages"]
-        installer.post_install_messages.to_a.each do |name, msg|
-          print_post_install_message(name, msg) unless Bundler.settings["ignore_messages.#{name}"]
-        end
-      end
+      Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
 
       warn_ambiguous_gems
 
@@ -135,12 +130,6 @@ module Bundler
       end
     end
 
-    def confirm_without_groups
-      return unless Bundler.settings.without.any?
-      require "bundler/cli/common"
-      Bundler.ui.confirm Bundler::CLI::Common.without_groups_message
-    end
-
     def dependencies_count_for(definition)
       count = definition.dependencies.count
       "#{count} Gemfile #{count == 1 ? "dependency" : "dependencies"}"
@@ -151,11 +140,6 @@ module Bundler
       "#{count} #{count == 1 ? "gem" : "gems"} now installed"
     end
 
-    def print_post_install_message(name, msg)
-      Bundler.ui.confirm "Post-install message from #{name}:"
-      Bundler.ui.info msg
-    end
-
     def check_for_group_conflicts
       if options[:without] && options[:with]
         conflicting_groups = options[:without] & options[:with]
@@ -170,8 +154,8 @@ module Bundler
     def check_for_options_conflicts
       if (options[:path] || options[:deployment]) && options[:system]
         error_message = String.new
-        error_message << "You have specified both a path to install your gems to as well as --system. Please choose.\n" if options[:path]
-        error_message << "You have specified both --deployment as well as --system. Please choose.\n" if options[:deployment]
+        error_message << "You have specified both --path as well as --system. Please choose only one option.\n" if options[:path]
+        error_message << "You have specified both --deployment as well as --system. Please choose only one option.\n" if options[:deployment]
         raise InvalidOption.new(error_message)
       end
     end
diff --git a/lib/bundler/cli/issue.rb b/lib/bundler/cli/issue.rb
new file mode 100644
index 0000000..ace0f98
--- /dev/null
+++ b/lib/bundler/cli/issue.rb
@@ -0,0 +1,40 @@
+# frozen_string_literal: true
+
+require "rbconfig"
+
+module Bundler
+  class CLI::Issue
+    def run
+      Bundler.ui.info <<-EOS.gsub(/^ {8}/, "")
+        Did you find an issue with Bundler? Before filing a new issue,
+        be sure to check out these resources:
+
+        1. Check out our troubleshooting guide for quick fixes to common issues:
+        https://github.com/bundler/bundler/blob/master/doc/TROUBLESHOOTING.md
+
+        2. Instructions for common Bundler uses can be found on the documentation
+        site: http://bundler.io/
+
+        3. Information about each Bundler command can be found in the Bundler
+        man pages: http://bundler.io/man/bundle.1.html
+
+        Hopefully the troubleshooting steps above resolved your problem!  If things
+        still aren't working the way you expect them to, please let us know so
+        that we can diagnose and help fix the problem you're having. Please
+        view the Filing Issues guide for more information:
+        https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md
+
+      EOS
+
+      Bundler.ui.info Bundler::Env.new.report
+
+      Bundler.ui.info "\n## Bundle Doctor"
+      doctor
+    end
+
+    def doctor
+      require "bundler/cli/doctor"
+      Bundler::CLI::Doctor.new({}).run
+    end
+  end
+end
diff --git a/lib/bundler/cli/lock.rb b/lib/bundler/cli/lock.rb
index a6a95f8..223db94 100644
--- a/lib/bundler/cli/lock.rb
+++ b/lib/bundler/cli/lock.rb
@@ -1,4 +1,6 @@
 # frozen_string_literal: true
+require "bundler/cli/common"
+
 module Bundler
   class CLI::Lock
     attr_reader :options
@@ -17,14 +19,16 @@ module Bundler
       ui = Bundler.ui
       Bundler.ui = UI::Silent.new if print
 
-      gems = options[:update]
       Bundler::Fetcher.disable_endpoint = options["full-index"]
 
-      if gems && !gems.empty?
-        definition = Bundler.definition(:gems => gems)
-      else
-        definition = Bundler.definition(true)
+      update = options[:update]
+      if update.is_a?(Array) # unlocking specific gems
+        Bundler::CLI::Common.ensure_all_gems_in_lockfile!(update)
+        update = { :gems => update, :lock_shared_dependencies => options[:conservative] }
       end
+      definition = Bundler.definition(update)
+
+      Bundler::CLI::Common.configure_gem_version_promoter(Bundler.definition, options) if options[:update]
 
       options["remove-platform"].each do |platform|
         definition.remove_platform(platform)
@@ -32,7 +36,7 @@ module Bundler
 
       options["add-platform"].each do |platform_string|
         platform = Gem::Platform.new(platform_string)
-        if platform.to_a.compact == %w(unknown)
+        if platform.to_s == "unknown"
           Bundler.ui.warn "The platform `#{platform_string}` is unknown to RubyGems " \
             "and adding it will likely lead to resolution errors"
         end
diff --git a/lib/bundler/cli/open.rb b/lib/bundler/cli/open.rb
index 0bbfa63..9a21f68 100644
--- a/lib/bundler/cli/open.rb
+++ b/lib/bundler/cli/open.rb
@@ -13,7 +13,8 @@ module Bundler
     def run
       editor = [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }
       return Bundler.ui.info("To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR") unless editor
-      path = Bundler::CLI::Common.select_spec(name, :regex_match).full_gem_path
+      return unless spec = Bundler::CLI::Common.select_spec(name, :regex_match)
+      path = spec.full_gem_path
       Dir.chdir(path) do
         command = Shellwords.split(editor) + [path]
         Bundler.with_clean_env do
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb
index 09b2d71..863d0dd 100644
--- a/lib/bundler/cli/outdated.rb
+++ b/lib/bundler/cli/outdated.rb
@@ -4,6 +4,7 @@ require "bundler/cli/common"
 module Bundler
   class CLI::Outdated
     attr_reader :options, :gems
+
     def initialize(options, gems)
       @options = options
       @gems = gems
@@ -18,10 +19,14 @@ module Bundler
         Bundler::CLI::Common.select_spec(gem_name)
       end
 
-      Bundler.definition.validate_ruby!
-      current_specs = Bundler.ui.silence { Bundler.load.specs }
+      Bundler.definition.validate_runtime!
+      current_specs = Bundler.ui.silence { Bundler.definition.resolve }
       current_dependencies = {}
-      Bundler.ui.silence { Bundler.load.dependencies.each {|dep| current_dependencies[dep.name] = dep } }
+      Bundler.ui.silence do
+        Bundler.load.dependencies.each do |dep|
+          current_dependencies[dep.name] = dep
+        end
+      end
 
       definition = if gems.empty? && sources.empty?
         # We're doing a full update
@@ -30,7 +35,23 @@ module Bundler
         Bundler.definition(:gems => gems, :sources => sources)
       end
 
-      definition_resolution = proc { options["local"] ? definition.resolve_with_cache! : definition.resolve_remotely! }
+      Bundler::CLI::Common.configure_gem_version_promoter(
+        Bundler.definition,
+        options
+      )
+
+      # the patch level options imply strict is also true. It wouldn't make
+      # sense otherwise.
+      strict = options[:strict] ||
+        Bundler::CLI::Common.patch_level_options(options).any?
+
+      filter_options_patch = options.keys &
+        %w(filter-major filter-minor filter-patch)
+
+      definition_resolution = proc do
+        options[:local] ? definition.resolve_with_cache! : definition.resolve_remotely!
+      end
+
       if options[:parseable]
         Bundler.ui.silence(&definition_resolution)
       else
@@ -38,83 +59,167 @@ module Bundler
       end
 
       Bundler.ui.info ""
+      outdated_gems_by_groups = {}
+      outdated_gems_list = []
 
-      out_count = 0
       # Loop through the current specs
-      gemfile_specs, dependency_specs = current_specs.partition {|spec| current_dependencies.key? spec.name }
-      [gemfile_specs.sort_by(&:name), dependency_specs.sort_by(&:name)].flatten.each do |current_spec|
+      gemfile_specs, dependency_specs = current_specs.partition do |spec|
+        current_dependencies.key? spec.name
+      end
+
+      (gemfile_specs + dependency_specs).sort_by(&:name).each do |current_spec|
         next if !gems.empty? && !gems.include?(current_spec.name)
 
         dependency = current_dependencies[current_spec.name]
+        active_spec = retrieve_active_spec(strict, definition, current_spec)
 
-        if options["strict"]
-          active_spec = definition.specs.detect {|spec| spec.name == current_spec.name && spec.platform == current_spec.platform }
-        else
-          active_specs = definition.index[current_spec.name].select {|spec| spec.platform == current_spec.platform }.sort_by(&:version)
-          if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
-            active_spec = active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
-          end
-          active_spec = active_specs.last
+        next if active_spec.nil?
+        if filter_options_patch.any?
+          update_present = update_present_via_semver_portions(current_spec, active_spec, options)
+          next unless update_present
+        end
 
-          if options[:major] || options[:minor] || options[:patch]
-            update_present = update_present_via_semver_portions(current_spec, active_spec, options)
-            active_spec = nil unless update_present
+        gem_outdated = Gem::Version.new(active_spec.version) > Gem::Version.new(current_spec.version)
+        next unless gem_outdated || (current_spec.git_version != active_spec.git_version)
+        groups = nil
+        if dependency && !options[:parseable]
+          groups = dependency.groups.join(", ")
+        end
+
+        outdated_gems_list << { :active_spec => active_spec,
+                                :current_spec => current_spec,
+                                :dependency => dependency,
+                                :groups => groups }
+
+        outdated_gems_by_groups[groups] ||= []
+        outdated_gems_by_groups[groups] << { :active_spec => active_spec,
+                                             :current_spec => current_spec,
+                                             :dependency => dependency,
+                                             :groups => groups }
+      end
+
+      if outdated_gems_list.empty?
+        display_nothing_outdated_message(filter_options_patch)
+      else
+        unless options[:parseable]
+          if options[:pre]
+            Bundler.ui.info "Outdated gems included in the bundle (including " \
+              "pre-releases):"
+          else
+            Bundler.ui.info "Outdated gems included in the bundle:"
           end
         end
 
-        next if active_spec.nil?
+        options_include_groups = [:group, :groups].select do |v|
+          options.keys.include?(v.to_s)
+        end
 
-        gem_outdated = Gem::Version.new(active_spec.version) > Gem::Version.new(current_spec.version)
-        git_outdated = current_spec.git_version != active_spec.git_version
-        if gem_outdated || git_outdated
-          unless options[:parseable]
-            if out_count == 0
-              if options["pre"]
-                Bundler.ui.info "Outdated gems included in the bundle (including pre-releases):"
+        if options_include_groups.any?
+          ordered_groups = outdated_gems_by_groups.keys.compact.sort
+          [nil, ordered_groups].flatten.each do |groups|
+            gems = outdated_gems_by_groups[groups]
+            contains_group = if groups
+              groups.split(",").include?(options[:group])
+            else
+              options[:group] == "group"
+            end
+
+            next if (!options[:groups] && !contains_group) || gems.nil?
+
+            unless options[:parseable]
+              if groups
+                Bundler.ui.info "===== Group #{groups} ====="
               else
-                Bundler.ui.info "Outdated gems included in the bundle:"
+                Bundler.ui.info "===== Without group ====="
               end
             end
+
+            gems.each do |gem|
+              print_gem(
+                gem[:current_spec],
+                gem[:active_spec],
+                gem[:dependency],
+                groups,
+                options_include_groups.any?
+              )
+            end
+          end
+        else
+          outdated_gems_list.each do |gem|
+            print_gem(
+              gem[:current_spec],
+              gem[:active_spec],
+              gem[:dependency],
+              gem[:groups],
+              options_include_groups.any?
+            )
           end
+        end
 
-          spec_version    = "#{active_spec.version}#{active_spec.git_version}"
-          current_version = "#{current_spec.version}#{current_spec.git_version}"
-          dependency_version = %(, requested #{dependency.requirement}) if dependency && dependency.specific?
+        exit 1
+      end
+    end
 
-          if dependency && !options[:parseable]
-            groups = dependency.groups.join(", ")
-            pl = (dependency.groups.length > 1) ? "s" : ""
-            groups = " in group#{pl} \"#{groups}\""
-          end
+  private
 
-          spec_outdated_info = "#{active_spec.name} (newest #{spec_version}, installed #{current_version}#{dependency_version})"
-          if options[:parseable]
-            Bundler.ui.info spec_outdated_info.to_s.rstrip
-          else
-            Bundler.ui.info "  * #{spec_outdated_info}#{groups}".rstrip
-          end
+    def retrieve_active_spec(strict, definition, current_spec)
+      if strict
+        active_spec = definition.find_resolved_spec(current_spec)
+      else
+        active_specs = definition.find_indexed_specs(current_spec)
+        if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
+          active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
+        end
+        active_spec = active_specs.last
+      end
 
-          out_count += 1
+      active_spec
+    end
+
+    def display_nothing_outdated_message(filter_options_patch)
+      unless options[:parseable]
+        if filter_options_patch.any?
+          display = filter_options_patch.map do |o|
+            o.sub("filter-", "")
+          end.join(" or ")
+
+          Bundler.ui.info "No #{display} updates to display.\n"
+        else
+          Bundler.ui.info "Bundle up to date!\n"
         end
-        Bundler.ui.debug "from #{active_spec.loaded_from}"
       end
+    end
+
+    def print_gem(current_spec, active_spec, dependency, groups, options_include_groups)
+      spec_version = "#{active_spec.version}#{active_spec.git_version}"
+      spec_version += " (from #{active_spec.loaded_from})" if Bundler.ui.debug? && active_spec.loaded_from
+      current_version = "#{current_spec.version}#{current_spec.git_version}"
+
+      if dependency && dependency.specific?
+        dependency_version = %(, requested #{dependency.requirement})
+      end
+
+      spec_outdated_info = "#{active_spec.name} (newest #{spec_version}, " \
+        "installed #{current_version}#{dependency_version})"
 
-      if out_count.zero?
-        Bundler.ui.info "Bundle up to date!\n" unless options[:parseable]
+      output_message = if options[:parseable]
+        spec_outdated_info.to_s
+      elsif options_include_groups || !groups
+        "  * #{spec_outdated_info}"
       else
-        exit 1
+        "  * #{spec_outdated_info} in groups \"#{groups}\""
       end
-    end
 
-  private
+      Bundler.ui.info output_message.rstrip
+    end
 
     def check_for_deployment_mode
       if Bundler.settings[:frozen]
-        error_message = "You are trying to check outdated gems in deployment mode. " \
-              "Run `bundle outdated` elsewhere.\n" \
-              "\nIf this is a development machine, remove the #{Bundler.default_gemfile} freeze" \
-              "\nby running `bundle install --no-deployment`."
-        raise ProductionError, error_message
+        raise ProductionError, "You are trying to check outdated gems in " \
+          "deployment mode. Run `bundle outdated` elsewhere.\n" \
+          "\nIf this is a development machine, remove the " \
+          "#{Bundler.default_gemfile} freeze" \
+          "\nby running `bundle install --no-deployment`."
       end
     end
 
@@ -123,16 +228,15 @@ module Bundler
       active_major = active_spec.version.segments.first
 
       update_present = false
+      update_present = active_major > current_major if options["filter-major"]
 
-      update_present = active_major > current_major if options[:major]
-
-      if !update_present && (options[:minor] || options[:patch]) && current_major == active_major
+      if !update_present && (options["filter-minor"] || options["filter-patch"]) && current_major == active_major
         current_minor = get_version_semver_portion_value(current_spec, 1)
         active_minor = get_version_semver_portion_value(active_spec, 1)
 
-        update_present = active_minor > current_minor if options[:minor]
+        update_present = active_minor > current_minor if options["filter-minor"]
 
-        if !update_present && options[:patch] && current_minor == active_minor
+        if !update_present && options["filter-patch"] && current_minor == active_minor
           current_patch = get_version_semver_portion_value(current_spec, 2)
           active_patch = get_version_semver_portion_value(active_spec, 2)
 
diff --git a/lib/bundler/cli/platform.rb b/lib/bundler/cli/platform.rb
index b5f906b..9fdab0a 100644
--- a/lib/bundler/cli/platform.rb
+++ b/lib/bundler/cli/platform.rb
@@ -29,7 +29,7 @@ module Bundler
           output << "Your Gemfile specifies a Ruby version requirement:\n* #{ruby_version}"
 
           begin
-            Bundler.definition.validate_ruby!
+            Bundler.definition.validate_runtime!
             output << "Your current platform satisfies the Ruby version requirement."
           rescue RubyVersionMismatch => e
             output << e.message
diff --git a/lib/bundler/cli/pristine.rb b/lib/bundler/cli/pristine.rb
new file mode 100644
index 0000000..30542b5
--- /dev/null
+++ b/lib/bundler/cli/pristine.rb
@@ -0,0 +1,33 @@
+# frozen_string_literal: true
+require "bundler/cli/common"
+
+module Bundler
+  class CLI::Pristine
+    def run
+      Bundler.load.specs.each do |spec|
+        next if spec.name == "bundler" # Source::Rubygems doesn't install bundler
+
+        gem_name = "#{spec.name} (#{spec.version}#{spec.git_version})"
+        gem_name += " (#{spec.platform})" if !spec.platform.nil? && spec.platform != Gem::Platform::RUBY
+
+        case spec.source
+        when Source::Rubygems
+          cached_gem = spec.cache_file
+          unless File.exist?(cached_gem)
+            Bundler.ui.error("Failed to pristine #{gem_name}. Cached gem #{cached_gem} does not exist.")
+            next
+          end
+
+          FileUtils.rm_rf spec.full_gem_path
+          spec.source.install(spec, :force => true)
+        when Source::Git
+          git_source = spec.source
+          git_source.remote!
+          git_source.install(spec, :force => true)
+        else
+          Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is sourced from local path.")
+        end
+      end
+    end
+  end
+end
diff --git a/lib/bundler/cli/show.rb b/lib/bundler/cli/show.rb
index d67b086..47d4470 100644
--- a/lib/bundler/cli/show.rb
+++ b/lib/bundler/cli/show.rb
@@ -13,7 +13,7 @@ module Bundler
 
     def run
       Bundler.ui.silence do
-        Bundler.definition.validate_ruby!
+        Bundler.definition.validate_runtime!
         Bundler.load.lock
       end
 
@@ -64,6 +64,7 @@ module Bundler
       else
         definition.resolve_with_cache!
       end
+      Bundler.reset!
       definition.specs
     end
 
diff --git a/lib/bundler/cli/update.rb b/lib/bundler/cli/update.rb
index 1c35659..df7524f 100644
--- a/lib/bundler/cli/update.rb
+++ b/lib/bundler/cli/update.rb
@@ -1,4 +1,6 @@
 # frozen_string_literal: true
+require "bundler/cli/common"
+
 module Bundler
   class CLI::Update
     attr_reader :options, :gems
@@ -10,7 +12,7 @@ module Bundler
     def run
       Bundler.ui.level = "error" if options[:quiet]
 
-      Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.settings[:plugins]
+      Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
 
       sources = Array(options[:source])
       groups  = Array(options[:group]).map(&:to_sym)
@@ -23,28 +25,18 @@ module Bundler
           raise GemfileLockNotFound, "This Bundle hasn't been installed yet. " \
             "Run `bundle install` to update and install the bundled gems."
         end
-        # cycle through the requested gems, to make sure they exist
-        names = Bundler.locked_gems.specs.map(&:name)
-        gems.each do |g|
-          next if names.include?(g)
-          require "bundler/cli/common"
-          raise GemNotFound, Bundler::CLI::Common.gem_not_found_message(g, names)
-        end
+        Bundler::CLI::Common.ensure_all_gems_in_lockfile!(gems)
 
         if groups.any?
           specs = Bundler.definition.specs_for groups
           gems.concat(specs.map(&:name))
         end
 
-        Bundler.definition(:gems => gems, :sources => sources, :ruby => options[:ruby])
+        Bundler.definition(:gems => gems, :sources => sources, :ruby => options[:ruby],
+                           :lock_shared_dependencies => options[:conservative])
       end
 
-      patch_level = [:major, :minor, :patch].select {|v| options.keys.include?(v.to_s) }
-      raise ProductionError, "Provide only one of the following options: #{patch_level.join(", ")}" unless patch_level.length <= 1
-      Bundler.definition.gem_version_promoter.tap do |gvp|
-        gvp.level = patch_level.first || :major
-        gvp.strict = options[:strict]
-      end
+      Bundler::CLI::Common.configure_gem_version_promoter(Bundler.definition, options)
 
       Bundler::Fetcher.disable_endpoint = options["full-index"]
 
@@ -54,11 +46,8 @@ module Bundler
 
       Bundler.settings[:jobs] = opts["jobs"] if opts["jobs"]
 
-      # rubygems plugins sometimes hook into the gem install process
-      Gem.load_env_plugins if Gem.respond_to?(:load_env_plugins)
-
-      Bundler.definition.validate_ruby!
-      Installer.install Bundler.root, Bundler.definition, opts
+      Bundler.definition.validate_runtime!
+      installer = Installer.install Bundler.root, Bundler.definition, opts
       Bundler.load.cache if Bundler.app_cache.exist?
 
       if Bundler.settings[:clean] && Bundler.settings[:path]
@@ -67,15 +56,8 @@ module Bundler
       end
 
       Bundler.ui.confirm "Bundle updated!"
-      without_groups_messages
-    end
-
-  private
-
-    def without_groups_messages
-      return unless Bundler.settings.without.any?
-      require "bundler/cli/common"
-      Bundler.ui.confirm Bundler::CLI::Common.without_groups_message
+      Bundler::CLI::Common.output_without_groups_message
+      Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
     end
   end
 end
diff --git a/lib/bundler/cli/viz.rb b/lib/bundler/cli/viz.rb
index 75e6aff..418c462 100644
--- a/lib/bundler/cli/viz.rb
+++ b/lib/bundler/cli/viz.rb
@@ -21,7 +21,7 @@ module Bundler
     rescue StandardError => e
       raise unless e.message =~ /GraphViz not installed or dot not in PATH/
       Bundler.ui.error e.message
-      Bundler.ui.warn "Please install GraphViz. On a Mac with homebrew, you can run `brew install graphviz`."
+      Bundler.ui.warn "Please install GraphViz. On a Mac with Homebrew, you can run `brew install graphviz`."
     end
   end
 end
diff --git a/lib/bundler/compact_index_client.rb b/lib/bundler/compact_index_client.rb
new file mode 100644
index 0000000..3ed05ca
--- /dev/null
+++ b/lib/bundler/compact_index_client.rb
@@ -0,0 +1,108 @@
+# frozen_string_literal: true
+require "pathname"
+require "set"
+
+module Bundler
+  class CompactIndexClient
+    DEBUG_MUTEX = Mutex.new
+    def self.debug
+      return unless ENV["DEBUG_COMPACT_INDEX"]
+      DEBUG_MUTEX.synchronize { warn("[#{self}] #{yield}") }
+    end
+
+    class Error < StandardError; end
+
+    require "bundler/compact_index_client/cache"
+    require "bundler/compact_index_client/updater"
+
+    attr_reader :directory
+
+    # @return [Lambda] A lambda that takes an array of inputs and a block, and
+    #         maps the inputs with the block in parallel.
+    #
+    attr_accessor :in_parallel
+
+    def initialize(directory, fetcher)
+      @directory = Pathname.new(directory)
+      @updater = Updater.new(fetcher)
+      @cache = Cache.new(@directory)
+      @endpoints = Set.new
+      @info_checksums_by_name = {}
+      @parsed_checksums = false
+      @mutex = Mutex.new
+      @in_parallel = lambda do |inputs, &blk|
+        inputs.map(&blk)
+      end
+    end
+
+    def names
+      Bundler::CompactIndexClient.debug { "/names" }
+      update(@cache.names_path, "names")
+      @cache.names
+    end
+
+    def versions
+      Bundler::CompactIndexClient.debug { "/versions" }
+      update(@cache.versions_path, "versions")
+      versions, @info_checksums_by_name = @cache.versions
+      versions
+    end
+
+    def dependencies(names)
+      Bundler::CompactIndexClient.debug { "dependencies(#{names})" }
+      in_parallel.call(names) do |name|
+        update_info(name)
+        @cache.dependencies(name).map {|d| d.unshift(name) }
+      end.flatten(1)
+    end
+
+    def spec(name, version, platform = nil)
+      Bundler::CompactIndexClient.debug { "spec(name = #{name}, version = #{version}, platform = #{platform})" }
+      update_info(name)
+      @cache.specific_dependency(name, version, platform)
+    end
+
+    def update_and_parse_checksums!
+      Bundler::CompactIndexClient.debug { "update_and_parse_checksums!" }
+      return @info_checksums_by_name if @parsed_checksums
+      update(@cache.versions_path, "versions")
+      @info_checksums_by_name = @cache.checksums
+      @parsed_checksums = true
+    end
+
+  private
+
+    def update(local_path, remote_path)
+      Bundler::CompactIndexClient.debug { "update(#{local_path}, #{remote_path})" }
+      unless synchronize { @endpoints.add?(remote_path) }
+        Bundler::CompactIndexClient.debug { "already fetched #{remote_path}" }
+        return
+      end
+      @updater.update(local_path, url(remote_path))
+    end
+
+    def update_info(name)
+      Bundler::CompactIndexClient.debug { "update_info(#{name})" }
+      path = @cache.info_path(name)
+      checksum = @updater.checksum_for_file(path)
+      unless existing = @info_checksums_by_name[name]
+        Bundler::CompactIndexClient.debug { "skipping updating info for #{name} since it is missing from versions" }
+        return
+      end
+      if checksum == existing
+        Bundler::CompactIndexClient.debug { "skipping updating info for #{name} since the versions checksum matches the local checksum" }
+        return
+      end
+      Bundler::CompactIndexClient.debug { "updating info for #{name} since the versions checksum #{existing} != the local checksum #{checksum}" }
+      update(path, "info/#{name}")
+    end
+
+    def url(path)
+      path
+    end
+
+    def synchronize
+      @mutex.synchronize { yield }
+    end
+  end
+end
diff --git a/lib/bundler/compact_index_client/cache.rb b/lib/bundler/compact_index_client/cache.rb
new file mode 100644
index 0000000..e44f05d
--- /dev/null
+++ b/lib/bundler/compact_index_client/cache.rb
@@ -0,0 +1,119 @@
+# frozen_string_literal: true
+require "digest/md5"
+
+module Bundler
+  class CompactIndexClient
+    class Cache
+      attr_reader :directory
+
+      def initialize(directory)
+        @directory = Pathname.new(directory).expand_path
+        info_roots.each do |dir|
+          SharedHelpers.filesystem_access(dir) do
+            FileUtils.mkdir_p(dir)
+          end
+        end
+      end
+
+      def names
+        lines(names_path)
+      end
+
+      def names_path
+        directory.join("names")
+      end
+
+      def versions
+        versions_by_name = Hash.new {|hash, key| hash[key] = [] }
+        info_checksums_by_name = {}
+
+        lines(versions_path).each do |line|
+          name, versions_string, info_checksum = line.split(" ", 3)
+          info_checksums_by_name[name] = info_checksum || ""
+          versions_string.split(",").each do |version|
+            if version.start_with?("-")
+              version = version[1..-1].split("-", 2).unshift(name)
+              versions_by_name[name].delete(version)
+            else
+              version = version.split("-", 2).unshift(name)
+              versions_by_name[name] << version
+            end
+          end
+        end
+
+        [versions_by_name, info_checksums_by_name]
+      end
+
+      def versions_path
+        directory.join("versions")
+      end
+
+      def checksums
+        checksums = {}
+
+        lines(versions_path).each do |line|
+          name, _, checksum = line.split(" ", 3)
+          checksums[name] = checksum
+        end
+
+        checksums
+      end
+
+      def dependencies(name)
+        lines(info_path(name)).map do |line|
+          parse_gem(line)
+        end
+      end
+
+      def info_path(name)
+        name = name.to_s
+        if name =~ /[^a-z0-9_-]/
+          name += "-#{Digest::MD5.hexdigest(name).downcase}"
+          info_roots.last.join(name)
+        else
+          info_roots.first.join(name)
+        end
+      end
+
+      def specific_dependency(name, version, platform)
+        pattern = [version, platform].compact.join("-")
+        return nil if pattern.empty?
+
+        gem_lines = info_path(name).read
+        gem_line = gem_lines[/^#{Regexp.escape(pattern)}\b.*/, 0]
+        gem_line ? parse_gem(gem_line) : nil
+      end
+
+    private
+
+      def lines(path)
+        return [] unless path.file?
+        lines = SharedHelpers.filesystem_access(path, :read, &:read).split("\n")
+        header = lines.index("---")
+        header ? lines[header + 1..-1] : lines
+      end
+
+      def parse_gem(string)
+        version_and_platform, rest = string.split(" ", 2)
+        version, platform = version_and_platform.split("-", 2)
+        dependencies, requirements = rest.split("|", 2).map {|s| s.split(",") } if rest
+        dependencies = dependencies ? dependencies.map {|d| parse_dependency(d) } : []
+        requirements = requirements ? requirements.map {|r| parse_dependency(r) } : []
+        [version, platform, dependencies, requirements]
+      end
+
+      def parse_dependency(string)
+        dependency = string.split(":")
+        dependency[-1] = dependency[-1].split("&") if dependency.size > 1
+        dependency
+      end
+
+      def info_roots
+        [
+          directory.join("info"),
+          directory.join("info-special-characters"),
+        ]
+      end
+    end
+  end
+end
diff --git a/lib/bundler/compact_index_client/updater.rb b/lib/bundler/compact_index_client/updater.rb
new file mode 100644
index 0000000..5aa480f
--- /dev/null
+++ b/lib/bundler/compact_index_client/updater.rb
@@ -0,0 +1,88 @@
+# frozen_string_literal: true
+require "fileutils"
+require "stringio"
+require "tmpdir"
+require "zlib"
+
+module Bundler
+  class CompactIndexClient
+    class Updater
+      class MisMatchedChecksumError < Error
+        def initialize(path, server_checksum, local_checksum)
+          @path = path
+          @server_checksum = server_checksum
+          @local_checksum = local_checksum
+        end
+
+        def message
+          "The checksum of /#{@path} does not match the checksum provided by the server! Something is wrong " \
+            "(local checksum is #{@local_checksum.inspect}, was expecting #{@server_checksum.inspect})."
+        end
+      end
+
+      def initialize(fetcher)
+        @fetcher = fetcher
+      end
+
+      def update(local_path, remote_path, retrying = nil)
+        headers = {}
+
+        Dir.mktmpdir("bundler-compact-index-") do |local_temp_dir|
+          local_temp_path = Pathname.new(local_temp_dir).join(local_path.basename)
+
+          # first try to fetch any new bytes on the existing file
+          if retrying.nil? && local_path.file?
+            FileUtils.cp local_path, local_temp_path
+            headers["If-None-Match"] = etag_for(local_temp_path)
+            headers["Range"] = "bytes=#{local_temp_path.size}-"
+          else
+            # Fastly ignores Range when Accept-Encoding: gzip is set
+            headers["Accept-Encoding"] = "gzip"
+          end
+
+          response = @fetcher.call(remote_path, headers)
+          return nil if response.is_a?(Net::HTTPNotModified)
+
+          content = response.body
+          if response["Content-Encoding"] == "gzip"
+            content = Zlib::GzipReader.new(StringIO.new(content)).read
+          end
+
+          mode = response.is_a?(Net::HTTPPartialContent) ? "a" : "w"
+          SharedHelpers.filesystem_access(local_temp_path) do
+            local_temp_path.open(mode) {|f| f << content }
+          end
+
+          response_etag = (response["ETag"] || "").gsub(%r{\AW/}, "")
+          if etag_for(local_temp_path) == response_etag
+            SharedHelpers.filesystem_access(local_path) do
+              FileUtils.mv(local_temp_path, local_path)
+            end
+            return nil
+          end
+
+          if retrying
+            raise MisMatchedChecksumError.new(remote_path, response_etag, etag_for(local_temp_path))
+          end
+
+          update(local_path, remote_path, :retrying)
+        end
+      end
+
+      def etag_for(path)
+        sum = checksum_for_file(path)
+        sum ? %("#{sum}") : nil
+      end
+
+      def checksum_for_file(path)
+        return nil unless path.file?
+        # This must use IO.read instead of Digest.file().hexdigest
+        # because we need to preserve \n line endings on windows when calculating
+        # the checksum
+        SharedHelpers.filesystem_access(path, :read) do
+          Digest::MD5.hexdigest(IO.read(path))
+        end
+      end
+    end
+  end
+end
diff --git a/lib/bundler/current_ruby.rb b/lib/bundler/current_ruby.rb
index 6180285..cca4010 100644
--- a/lib/bundler/current_ruby.rb
+++ b/lib/bundler/current_ruby.rb
@@ -16,6 +16,7 @@ module Bundler
       2.2
       2.3
       2.4
+      2.5
     ).freeze
 
     KNOWN_MAJOR_VERSIONS = KNOWN_MINOR_VERSIONS.map {|v| v.split(".", 2).first }.uniq.freeze
@@ -57,15 +58,15 @@ module Bundler
     end
 
     def mswin64?
-      Bundler::WINDOWS && Gem::Platform.local.os == "mswin64" && Gem::Platform.local.cpu == "x64"
+      Bundler::WINDOWS && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mswin64" && Bundler.local_platform.cpu == "x64"
     end
 
     def mingw?
-      Bundler::WINDOWS && Gem::Platform.local.os == "mingw32" && Gem::Platform.local.cpu != "x64"
+      Bundler::WINDOWS && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu != "x64"
     end
 
     def x64_mingw?
-      Bundler::WINDOWS && Gem::Platform.local.os == "mingw32" && Gem::Platform.local.cpu == "x64"
+      Bundler::WINDOWS && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu == "x64"
     end
 
     (KNOWN_MINOR_VERSIONS + KNOWN_MAJOR_VERSIONS).each do |version|
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index f14085f..3e5b1bc 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -62,6 +62,7 @@ module Bundler
       @specs           = nil
       @ruby_version    = ruby_version
 
+      @lockfile               = lockfile
       @lockfile_contents      = String.new
       @locked_bundler_version = nil
       @locked_ruby_version    = nil
@@ -69,7 +70,8 @@ module Bundler
       if lockfile && File.exist?(lockfile)
         @lockfile_contents = Bundler.read_file(lockfile)
         @locked_gems = LockfileParser.new(@lockfile_contents)
-        @platforms = @locked_gems.platforms
+        @locked_platforms = @locked_gems.platforms
+        @platforms = @locked_platforms.dup
         @locked_bundler_version = @locked_gems.bundler_version
         @locked_ruby_version = @locked_gems.ruby_version
 
@@ -79,7 +81,7 @@ module Bundler
           @locked_sources = @locked_gems.sources
         else
           @unlock         = {}
-          @locked_deps    = []
+          @locked_deps    = {}
           @locked_specs   = SpecSet.new([])
           @locked_sources = []
         end
@@ -87,58 +89,41 @@ module Bundler
         @unlock         = {}
         @platforms      = []
         @locked_gems    = nil
-        @locked_deps    = []
+        @locked_deps    = {}
         @locked_specs   = SpecSet.new([])
         @locked_sources = []
+        @locked_platforms = []
       end
 
       @unlock[:gems] ||= []
       @unlock[:sources] ||= []
-      @unlock[:ruby] ||= if @ruby_version && @locked_ruby_version
-        unless locked_ruby_version_object = RubyVersion.from_string(@locked_ruby_version)
-          raise LockfileError, "Failed to create a `RubyVersion` object from " \
-            "`#{@locked_ruby_version}` found in #{lockfile} -- try running `bundle update --ruby`."
-        end
+      @unlock[:ruby] ||= if @ruby_version && locked_ruby_version_object
         @ruby_version.diff(locked_ruby_version_object)
       end
       @unlocking ||= @unlock[:ruby] ||= (!@locked_ruby_version ^ !@ruby_version)
 
-      current_platform = Bundler.rubygems.platforms.map {|p| generic(p) }.compact.last
-      add_platform(current_platform)
+      add_current_platform unless Bundler.settings[:frozen]
 
+      converge_path_sources_to_gemspec_sources
       @path_changes = converge_paths
-      eager_unlock = expand_dependencies(@unlock[:gems])
-      @unlock[:gems] = @locked_specs.for(eager_unlock).map(&:name)
+      @source_changes = converge_sources
+
+      unless @unlock[:lock_shared_dependencies]
+        eager_unlock = expand_dependencies(@unlock[:gems])
+        @unlock[:gems] = @locked_specs.for(eager_unlock).map(&:name)
+      end
 
       @gem_version_promoter = create_gem_version_promoter
 
-      @source_changes = converge_sources
       @dependency_changes = converge_dependencies
       @local_changes = converge_locals
 
       @requires = compute_requires
-
-      fixup_dependency_types!
-    end
-
-    def fixup_dependency_types!
-      # XXX This is a temporary workaround for a bug when using rubygems 1.8.15
-      # where Gem::Dependency#== matches Gem::Dependency#type. As the lockfile
-      # doesn't carry a notion of the dependency type, if you use
-      # add_development_dependency in a gemspec that's loaded with the gemspec
-      # directive, the lockfile dependencies and resolved dependencies end up
-      # with a mismatch on #type.
-      # Test coverage to catch a regression on this is in gemspec_spec.rb
-      @dependencies.each do |d|
-        if ld = @locked_deps.find {|l| l.name == d.name }
-          ld.instance_variable_set(:@type, d.type)
-        end
-      end
     end
 
     def create_gem_version_promoter
       locked_specs =
-        if @unlocking && @locked_specs.empty? && !@lockfile_contents.empty?
+        if unlocking? && @locked_specs.empty? && !@lockfile_contents.empty?
           # Definition uses an empty set of locked_specs to indicate all gems
           # are unlocked, but GemVersionPromoter needs the locked_specs
           # for conservative comparison.
@@ -175,7 +160,7 @@ module Bundler
         rescue GemNotFound => e # Handle yanked gem
           gem_name, gem_version = extract_gem_info(e)
           locked_gem = @locked_specs[gem_name].last
-          raise if locked_gem.nil? || locked_gem.version.to_s != gem_version
+          raise if locked_gem.nil? || locked_gem.version.to_s != gem_version || !@remote
           raise GemNotFound, "Your bundle is locked to #{locked_gem}, but that version could not " \
                              "be found in any of the sources listed in your Gemfile. If you haven't changed sources, " \
                              "that means the author of #{locked_gem} has removed it. You'll need to update your bundle " \
@@ -241,13 +226,13 @@ module Bundler
     def resolve
       @resolve ||= begin
         last_resolve = converge_locked_specs
-        if Bundler.settings[:frozen] || (!@unlocking && nothing_changed?)
+        if Bundler.settings[:frozen] || (!unlocking? && nothing_changed?)
           Bundler.ui.debug("Found no changes, using resolution from the lockfile")
           last_resolve
         else
           # Run a resolve against the locally available gems
           Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
-          last_resolve.merge Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve, ruby_version, gem_version_promoter, additional_base_requirements_for_resolve)
+          last_resolve.merge Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
         end
       end
     end
@@ -262,6 +247,8 @@ module Bundler
           dependency_names -= pinned_spec_names(source.specs)
           dependency_names.concat(source.unmet_deps).uniq!
         end
+        idx << Gem::Specification.new("ruby\0", RubyVersion.system.to_gem_version_with_patchlevel)
+        idx << Gem::Specification.new("rubygems\0", Gem::VERSION)
       end
     end
 
@@ -308,7 +295,7 @@ module Bundler
         end
       end
 
-      preserve_unknown_sections ||= !updating_major && (Bundler.settings[:frozen] || !@unlocking)
+      preserve_unknown_sections ||= !updating_major && (Bundler.settings[:frozen] || !unlocking?)
       return if lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
 
       if Bundler.settings[:frozen]
@@ -338,6 +325,18 @@ module Bundler
       end
     end
 
+    def locked_ruby_version_object
+      return unless @locked_ruby_version
+      @locked_ruby_version_object ||= begin
+        unless version = RubyVersion.from_string(@locked_ruby_version)
+          raise LockfileError, "The Ruby version #{@locked_ruby_version} from " \
+            "#{@lockfile} could not be parsed. " \
+            "Try running bundle update --ruby to resolve this."
+        end
+        version
+      end
+    end
+
     def to_lock
       out = String.new
 
@@ -393,21 +392,28 @@ module Bundler
              "updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control."
 
       unless explicit_flag
+
+        suggested_command = Bundler.settings.locations("frozen")[:global] == "1" ? "bundle config --delete frozen" : "bundle install --no-deployment"
         msg << "\n\nIf this is a development machine, remove the #{Bundler.default_gemfile} " \
-               "freeze \nby running `bundle install --no-deployment`."
+               "freeze \nby running `#{suggested_command}`."
       end
 
       added =   []
       deleted = []
       changed = []
 
+      new_platforms = @platforms - @locked_platforms
+      deleted_platforms = @locked_platforms - @platforms
+      added.concat new_platforms.map {|p| "* platform: #{p}" }
+      deleted.concat deleted_platforms.map {|p| "* platform: #{p}" }
+
       gemfile_sources = sources.lock_sources
 
       new_sources = gemfile_sources - @locked_sources
       deleted_sources = @locked_sources - gemfile_sources
 
-      new_deps = @dependencies - @locked_deps
-      deleted_deps = @locked_deps - @dependencies
+      new_deps = @dependencies - @locked_deps.values
+      deleted_deps = @locked_deps.values - @dependencies
 
       # Check if it is possible that the source is only changed thing
       if (new_deps.empty? && deleted_deps.empty?) && (!new_sources.empty? && !deleted_sources.empty?)
@@ -432,7 +438,7 @@ module Bundler
 
       both_sources = Hash.new {|h, k| h[k] = [] }
       @dependencies.each {|d| both_sources[d.name][0] = d }
-      @locked_deps.each  {|d| both_sources[d.name][1] = d.source }
+      @locked_deps.each  {|name, d| both_sources[name][1] = d.source }
 
       both_sources.each do |name, (dep, lock_source)|
         next unless (dep.nil? && !lock_source.nil?) || (!dep.nil? && !lock_source.nil? && !lock_source.can_lock?(dep))
@@ -441,12 +447,19 @@ module Bundler
         changed << "* #{name} from `#{gemfile_source_name}` to `#{lockfile_source_name}`"
       end
 
+      reason = change_reason
+      msg << "\n\n#{reason.split(", ").map(&:capitalize).join("\n")}" unless reason.strip.empty?
       msg << "\n\nYou have added to the Gemfile:\n" << added.join("\n") if added.any?
       msg << "\n\nYou have deleted from the Gemfile:\n" << deleted.join("\n") if deleted.any?
       msg << "\n\nYou have changed in the Gemfile:\n" << changed.join("\n") if changed.any?
       msg << "\n"
 
-      raise ProductionError, msg if added.any? || deleted.any? || changed.any?
+      raise ProductionError, msg if added.any? || deleted.any? || changed.any? || !nothing_changed?
+    end
+
+    def validate_runtime!
+      validate_ruby!
+      validate_platforms!
     end
 
     def validate_ruby!
@@ -474,6 +487,18 @@ module Bundler
       end
     end
 
+    def validate_platforms!
+      return if @platforms.any? do |bundle_platform|
+        Bundler.rubygems.platforms.any? do |local_platform|
+          MatchPlatform.platforms_match?(bundle_platform, local_platform)
+        end
+      end
+
+      raise ProductionError, "Your bundle only supports platforms #{@platforms.map(&:to_s)} " \
+        "but your local platforms are #{Bundler.rubygems.platforms.map(&:to_s)}, and " \
+        "there's no compatible match between those two lists."
+    end
+
     def add_platform(platform)
       @new_platform ||= !@platforms.include?(platform)
       @platforms |= [platform]
@@ -484,17 +509,35 @@ module Bundler
       raise InvalidOption, "Unable to remove the platform `#{platform}` since the only platforms are #{@platforms.join ", "}"
     end
 
+    def add_current_platform
+      current_platform = Bundler.local_platform
+      add_platform(current_platform) if Bundler.settings[:specific_platform]
+      add_platform(generic(current_platform))
+    end
+
+    def find_resolved_spec(current_spec)
+      specs.find_by_name_and_platform(current_spec.name, current_spec.platform)
+    end
+
+    def find_indexed_specs(current_spec)
+      index[current_spec.name].select {|spec| spec.match_platform(current_spec.platform) }.sort_by(&:version)
+    end
+
     attr_reader :sources
     private :sources
 
-  private
-
     def nothing_changed?
       !@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes
     end
 
+    def unlocking?
+      @unlocking
+    end
+
+  private
+
     def change_reason
-      if @unlocking
+      if unlocking?
         unlock_reason = @unlock.reject {|_k, v| Array(v).empty? }.map do |k, v|
           if v == true
             k.to_s
@@ -531,7 +574,7 @@ module Bundler
 
     def dependencies_for_source_changed?(source, locked_source = source)
       deps_for_source = @dependencies.select {|s| s.source == source }
-      locked_deps_for_source = @locked_deps.select {|s| s.source == locked_source }
+      locked_deps_for_source = @locked_deps.values.select {|dep| dep.source == locked_source }
 
       Set.new(deps_for_source) != Set.new(locked_deps_for_source)
     end
@@ -540,7 +583,8 @@ module Bundler
       locked_index = Index.new
       locked_index.use(@locked_specs.select {|s| source.can_lock?(s) })
 
-      source.specs != locked_index
+      # order here matters, since Index#== is checking source.specs.include?(locked_index)
+      locked_index != source.specs
     end
 
     # Get all locals and override their matching sources.
@@ -576,15 +620,20 @@ module Bundler
       gemspec_source || source
     end
 
-    def converge_sources
-      changes = false
-
+    def converge_path_sources_to_gemspec_sources
       @locked_sources.map! do |source|
         converge_path_source_to_gemspec_source(source)
       end
       @locked_specs.each do |spec|
         spec.source &&= converge_path_source_to_gemspec_source(spec.source)
       end
+      @locked_deps.each do |_, dep|
+        dep.source &&= converge_path_source_to_gemspec_source(dep.source)
+      end
+    end
+
+    def converge_sources
+      changes = false
 
       # Get the Rubygems sources from the Gemfile.lock
       locked_gem_sources = @locked_sources.select {|s| s.is_a?(Source::Rubygems) }
@@ -620,11 +669,12 @@ module Bundler
     end
 
     def converge_dependencies
-      (@dependencies + @locked_deps).each do |dep|
-        locked_source = @locked_deps.select {|d| d.name == dep.name }.last
+      frozen = Bundler.settings[:frozen]
+      (@dependencies + @locked_deps.values).each do |dep|
+        locked_source = @locked_deps[dep.name]
         # This is to make sure that if bundler is installing in deployment mode and
         # after locked_source and sources don't match, we still use locked_source.
-        if Bundler.settings[:frozen] && !locked_source.nil? &&
+        if frozen && !locked_source.nil? &&
             locked_source.respond_to?(:source) && locked_source.source.instance_of?(Source::Path) && locked_source.source.path.exist?
           dep.source = locked_source.source
         elsif dep.source
@@ -634,7 +684,31 @@ module Bundler
           dep.platforms.concat(@platforms.map {|p| Dependency::REVERSE_PLATFORM_MAP[p] }.flatten(1)).uniq!
         end
       end
-      Set.new(@dependencies) != Set.new(@locked_deps)
+
+      changes = false
+      # We want to know if all match, but don't want to check all entries
+      # This means we need to return false if any dependency doesn't match
+      # the lock or doesn't exist in the lock.
+      @dependencies.each do |dependency|
+        unless locked_dep = @locked_deps[dependency.name]
+          changes = true
+          next
+        end
+
+        # Gem::Dependency#== matches Gem::Dependency#type. As the lockfile
+        # doesn't carry a notion of the dependency type, if you use
+        # add_development_dependency in a gemspec that's loaded with the gemspec
+        # directive, the lockfile dependencies and resolved dependencies end up
+        # with a mismatch on #type. Work around that by setting the type on the
+        # dep from the lockfile.
+        locked_dep.instance_variable_set(:@type, dependency.type)
+
+        # We already know the name matches from the hash lookup
+        # so we only need to check the requirement now
+        changes ||= dependency.requirement != locked_dep.requirement
+      end
+
+      changes
     end
 
     # Remove elements from the locked specs that are expired. This will most
@@ -647,12 +721,11 @@ module Bundler
       # and Gemfile.lock. If the Gemfile modified a dependency, but
       # the gem in the Gemfile.lock still satisfies it, this is fine
       # too.
-      locked_deps_hash = @locked_deps.inject({}) do |hsh, dep|
-        hsh[dep] = dep
-        hsh
-      end
       @dependencies.each do |dep|
-        locked_dep = locked_deps_hash[dep]
+        locked_dep = @locked_deps[dep.name]
+
+        # If the locked_dep doesn't match the dependency we're looking for then we ignore the locked_dep
+        locked_dep = nil unless locked_dep == dep
 
         if in_locked_deps?(dep, locked_dep) || satisfies_locked_spec?(dep)
           deps << dep
@@ -674,11 +747,13 @@ module Bundler
 
         # Don't add a spec to the list if its source is expired. For example,
         # if you change a Git gem to Rubygems.
-        next if s.source.nil? || @unlock[:sources].include?(s.source.name)
+        next if s.source.nil?
+        next if @unlock[:sources].include?(s.source.name)
 
         # XXX This is a backwards-compatibility fix to preserve the ability to
         # unlock a single gem by passing its name via `--source`. See issue #3759
-        next if s.source.nil? || @unlock[:sources].include?(s.name)
+        # TODO: delete in Bundler 2
+        next if @unlock[:sources].include?(s.name)
 
         # If the spec is from a path source and it doesn't exist anymore
         # then we unlock it.
@@ -692,23 +767,25 @@ module Bundler
           next unless other
 
           deps2 = other.dependencies.select {|d| d.type != :development }
+          runtime_dependencies = s.dependencies.select {|d| d.type != :development }
           # If the dependencies of the path source have changed, unlock it
-          next unless s.dependencies.sort == deps2.sort
+          next unless runtime_dependencies.sort == deps2.sort
         end
 
         converged << s
       end
 
       resolve = SpecSet.new(converged)
-      resolve = resolve.for(expand_dependencies(deps, true), @unlock[:gems])
-      diff    = @locked_specs.to_a - resolve.to_a
+      resolve = resolve.for(expand_dependencies(deps, true), @unlock[:gems], false, false, false)
+      diff    = nil
 
       # Now, we unlock any sources that do not have anymore gems pinned to it
       sources.all_sources.each do |source|
         next unless source.respond_to?(:unlock!)
 
         unless resolve.any? {|s| s.source == source }
-          source.unlock! if !diff.empty? && diff.any? {|s| s.source == source }
+          diff ||= @locked_specs.to_a - resolve.to_a
+          source.unlock! if diff.any? {|s| s.source == source }
         end
       end
 
@@ -723,19 +800,59 @@ module Bundler
     end
 
     def satisfies_locked_spec?(dep)
-      @locked_specs.any? {|s| s.satisfies?(dep) && (!dep.source || s.source.include?(dep.source)) }
+      @locked_specs[dep].any? {|s| s.satisfies?(dep) && (!dep.source || s.source.include?(dep.source)) }
     end
 
+    # This list of dependencies is only used in #resolve, so it's OK to add
+    # the metadata dependencies here
     def expanded_dependencies
-      @expanded_dependencies ||= expand_dependencies(dependencies, @remote)
+      @expanded_dependencies ||= begin
+        ruby_versions = concat_ruby_version_requirements(@ruby_version)
+        if ruby_versions.empty? || !@ruby_version.exact?
+          concat_ruby_version_requirements(RubyVersion.system)
+          concat_ruby_version_requirements(locked_ruby_version_object) unless @unlock[:ruby]
+        end
+
+        metadata_dependencies = [
+          Dependency.new("ruby\0", ruby_versions),
+          Dependency.new("rubygems\0", Gem::VERSION),
+        ]
+        expand_dependencies(dependencies + metadata_dependencies, @remote)
+      end
+    end
+
+    def concat_ruby_version_requirements(ruby_version, ruby_versions = [])
+      return ruby_versions unless ruby_version
+      if ruby_version.patchlevel
+        ruby_versions << ruby_version.to_gem_version_with_patchlevel
+      else
+        ruby_versions.concat(ruby_version.versions.map do |version|
+          requirement = Gem::Requirement.new(version)
+          if requirement.exact?
+            "~> #{version}.0"
+          else
+            requirement
+          end
+        end)
+      end
     end
 
     def expand_dependencies(dependencies, remote = false)
       deps = []
       dependencies.each do |dep|
         dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name)
-        next unless remote || dep.current_platform?
-        dep.gem_platforms(@platforms).each do |p|
+        next if !remote && !dep.current_platform?
+        platforms = dep.gem_platforms(@platforms)
+        if platforms.empty?
+          mapped_platforms = dep.platforms.map {|p| Dependency::PLATFORM_MAP[p] }
+          Bundler.ui.warn \
+            "The dependency #{dep} will be unused by any of the platforms Bundler is installing for. " \
+            "Bundler is installing for #{@platforms.join ", "} but the dependency " \
+            "is only for #{mapped_platforms.join ", "}. " \
+            "To add those platforms to the bundle, " \
+            "run `bundle lock --add-platform #{mapped_platforms.join " "}`."
+        end
+        platforms.each do |p|
           deps << DepProxy.new(dep, p) if remote || p == generic_local_platform
         end
       end
@@ -812,9 +929,10 @@ module Bundler
     end
 
     def additional_base_requirements_for_resolve
-      return [] unless @locked_gems && Bundler.settings[:only_update_to_newer_versions]
+      return [] unless @locked_gems && Bundler.feature_flag.only_update_to_newer_versions?
       @locked_gems.specs.reduce({}) do |requirements, locked_spec|
-        requirements[locked_spec.name] = Gem::Dependency.new(locked_spec.name, ">= #{locked_spec.version}")
+        dep = Gem::Dependency.new(locked_spec.name, ">= #{locked_spec.version}")
+        requirements[locked_spec.name] = DepProxy.new(dep, locked_spec.platform)
         requirements
       end.values
     end
diff --git a/lib/bundler/dependency.rb b/lib/bundler/dependency.rb
index 1b1808b..d2bac66 100644
--- a/lib/bundler/dependency.rb
+++ b/lib/bundler/dependency.rb
@@ -17,6 +17,8 @@ module Bundler
       :ruby_21  => Gem::Platform::RUBY,
       :ruby_22  => Gem::Platform::RUBY,
       :ruby_23  => Gem::Platform::RUBY,
+      :ruby_24  => Gem::Platform::RUBY,
+      :ruby_25  => Gem::Platform::RUBY,
       :mri      => Gem::Platform::RUBY,
       :mri_18   => Gem::Platform::RUBY,
       :mri_19   => Gem::Platform::RUBY,
@@ -24,6 +26,8 @@ module Bundler
       :mri_21   => Gem::Platform::RUBY,
       :mri_22   => Gem::Platform::RUBY,
       :mri_23   => Gem::Platform::RUBY,
+      :mri_24   => Gem::Platform::RUBY,
+      :mri_25   => Gem::Platform::RUBY,
       :rbx      => Gem::Platform::RUBY,
       :jruby    => Gem::Platform::JAVA,
       :jruby_18 => Gem::Platform::JAVA,
@@ -35,12 +39,16 @@ module Bundler
       :mswin_21 => Gem::Platform::MSWIN,
       :mswin_22 => Gem::Platform::MSWIN,
       :mswin_23 => Gem::Platform::MSWIN,
+      :mswin_24 => Gem::Platform::MSWIN,
+      :mswin_25 => Gem::Platform::MSWIN,
       :mswin64    => Gem::Platform::MSWIN64,
       :mswin64_19 => Gem::Platform::MSWIN64,
       :mswin64_20 => Gem::Platform::MSWIN64,
       :mswin64_21 => Gem::Platform::MSWIN64,
       :mswin64_22 => Gem::Platform::MSWIN64,
       :mswin64_23 => Gem::Platform::MSWIN64,
+      :mswin64_24 => Gem::Platform::MSWIN64,
+      :mswin64_25 => Gem::Platform::MSWIN64,
       :mingw    => Gem::Platform::MINGW,
       :mingw_18 => Gem::Platform::MINGW,
       :mingw_19 => Gem::Platform::MINGW,
@@ -48,11 +56,15 @@ module Bundler
       :mingw_21 => Gem::Platform::MINGW,
       :mingw_22 => Gem::Platform::MINGW,
       :mingw_23 => Gem::Platform::MINGW,
+      :mingw_24 => Gem::Platform::MINGW,
+      :mingw_25 => Gem::Platform::MINGW,
       :x64_mingw    => Gem::Platform::X64_MINGW,
       :x64_mingw_20 => Gem::Platform::X64_MINGW,
       :x64_mingw_21 => Gem::Platform::X64_MINGW,
       :x64_mingw_22 => Gem::Platform::X64_MINGW,
-      :x64_mingw_23 => Gem::Platform::X64_MINGW
+      :x64_mingw_23 => Gem::Platform::X64_MINGW,
+      :x64_mingw_24 => Gem::Platform::X64_MINGW,
+      :x64_mingw_25 => Gem::Platform::X64_MINGW,
     }.freeze
 
     REVERSE_PLATFORM_MAP = {}.tap do |reverse_platform_map|
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
index b064c80..e4c257d 100644
--- a/lib/bundler/dsl.rb
+++ b/lib/bundler/dsl.rb
@@ -65,7 +65,7 @@ module Bundler
       case specs_by_name_and_version.size
       when 1
         specs = specs_by_name_and_version.values.first
-        spec = specs.find {|s| s.match_platform(Gem::Platform.local) } || specs.first
+        spec = specs.find {|s| s.match_platform(Bundler.local_platform) } || specs.first
 
         @gemspecs << spec
 
@@ -189,7 +189,7 @@ module Bundler
     end
 
     def github(repo, options = {})
-      raise ArgumentError, "Github sources require a block" unless block_given?
+      raise ArgumentError, "GitHub sources require a block" unless block_given?
       github_uri  = @git_sources["github"].call(repo)
       git_options = normalize_hash(options).merge("uri" => github_uri)
       git_source  = @sources.add_git_source(git_options)
@@ -384,6 +384,12 @@ module Bundler
 
     def validate_keys(command, opts, valid_keys)
       invalid_keys = opts.keys - valid_keys
+
+      git_source = opts.keys & @git_sources.keys.map(&:to_s)
+      if opts["branch"] && !(opts["git"] || opts["github"] || git_source.any?)
+        raise GemfileError, %(The `branch` option for `#{command}` is not allowed. Only gems with a git source can specify a branch)
+      end
+
       if invalid_keys.any?
         message = String.new
         message << "You passed #{invalid_keys.map {|k| ":" + k }.join(", ")} "
@@ -393,7 +399,8 @@ module Bundler
                      "as an option for #{command}, but it is invalid."
                    end
 
-        message << " Valid options are: #{valid_keys.join(", ")}"
+        message << " Valid options are: #{valid_keys.join(", ")}."
+        message << " You may be able to resolve this by upgrading Bundler to the newest version."
         raise InvalidOption, message
       end
     end
diff --git a/lib/bundler/endpoint_specification.rb b/lib/bundler/endpoint_specification.rb
index 4f5377d..5a1deee 100644
--- a/lib/bundler/endpoint_specification.rb
+++ b/lib/bundler/endpoint_specification.rb
@@ -5,8 +5,8 @@ module Bundler
     ILLFORMED_MESSAGE = 'Ill-formed requirement ["#<YAML::Syck::DefaultKey'.freeze
     include MatchPlatform
 
-    attr_reader :name, :version, :platform, :dependencies, :required_rubygems_version, :required_ruby_version, :checksum
-    attr_accessor :source, :remote
+    attr_reader :name, :version, :platform, :required_rubygems_version, :required_ruby_version, :checksum
+    attr_accessor :source, :remote, :dependencies
 
     def initialize(name, version, platform, dependencies, metadata = nil)
       @name         = name
@@ -91,6 +91,7 @@ module Bundler
     end
 
     def __swap__(spec)
+      SharedHelpers.ensure_same_dependencies(self, dependencies, spec.dependencies)
       @remote_specification = spec
     end
 
diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb
index 75edbf2..8b990ba 100644
--- a/lib/bundler/env.rb
+++ b/lib/bundler/env.rb
@@ -5,47 +5,58 @@ require "bundler/source/git/git_proxy"
 module Bundler
   class Env
     def write(io)
-      io.write report(:print_gemfile => true, :print_gemspecs => true)
+      io.write report
     end
 
     def report(options = {})
-      print_gemfile = options.delete(:print_gemfile)
-      print_gemspecs = options.delete(:print_gemspecs)
+      print_gemfile = options.delete(:print_gemfile) { true }
+      print_gemspecs = options.delete(:print_gemspecs) { true }
 
-      out = String.new("Environment\n\n")
-      out << "    Bundler   #{Bundler::VERSION}\n"
-      out << "    Rubygems  #{Gem::VERSION}\n"
-      out << "    Ruby      #{ruby_version}"
-      out << "    GEM_HOME  #{ENV["GEM_HOME"]}\n" unless ENV["GEM_HOME"].nil? || ENV["GEM_HOME"].empty?
-      out << "    GEM_PATH  #{ENV["GEM_PATH"]}\n" unless ENV["GEM_PATH"] == ENV["GEM_HOME"]
-      out << "    RVM       #{ENV["rvm_version"]}\n" if ENV["rvm_version"]
-      out << "    Git       #{git_version}\n"
+      out = String.new("## Environment\n\n```\n")
+      out << "Bundler   #{Bundler::VERSION}\n"
+      out << "Rubygems  #{Gem::VERSION}\n"
+      out << "Ruby      #{ruby_version}"
+      out << "GEM_HOME  #{ENV["GEM_HOME"]}\n" unless ENV["GEM_HOME"].nil? || ENV["GEM_HOME"].empty?
+      out << "GEM_PATH  #{ENV["GEM_PATH"]}\n" unless ENV["GEM_PATH"] == ENV["GEM_HOME"]
+      out << "RVM       #{ENV["rvm_version"]}\n" if ENV["rvm_version"]
+      out << "Git       #{git_version}\n"
+      out << "Platform  #{Gem::Platform.local}\n"
+      out << "OpenSSL   #{OpenSSL::OPENSSL_VERSION}\n" if defined?(OpenSSL::OPENSSL_VERSION)
       %w(rubygems-bundler open_gem).each do |name|
         specs = Bundler.rubygems.find_name(name)
-        out << "    #{name} (#{specs.map(&:version).join(",")})\n" unless specs.empty?
+        out << "#{name} (#{specs.map(&:version).join(",")})\n" unless specs.empty?
       end
 
-      out << "\nBundler settings\n\n" unless Bundler.settings.all.empty?
-      Bundler.settings.all.each do |setting|
-        out << "    " << setting << "\n"
-        Bundler.settings.pretty_values_for(setting).each do |line|
-          out << "      " << line << "\n"
+      out << "```\n"
+
+      unless Bundler.settings.all.empty?
+        out << "\n## Bundler settings\n\n```\n"
+        Bundler.settings.all.each do |setting|
+          out << setting << "\n"
+          Bundler.settings.pretty_values_for(setting).each do |line|
+            out << "  " << line << "\n"
+          end
         end
+        out << "```\n"
       end
 
+      return out unless SharedHelpers.in_bundle?
+
       if print_gemfile
-        out << "\n#{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}\n\n"
-        out << "    " << read_file(Bundler.default_gemfile).gsub(/\n/, "\n    ") << "\n"
+        out << "\n## Gemfile\n"
+        out << "\n### #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}\n\n"
+        out << "```ruby\n" << read_file(Bundler.default_gemfile).chomp << "\n```\n"
 
-        out << "\n#{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}\n\n"
-        out << "    " << read_file(Bundler.default_lockfile).gsub(/\n/, "\n    ") << "\n"
+        out << "\n### #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}\n\n"
+        out << "```\n" << read_file(Bundler.default_lockfile).chomp << "\n```\n"
       end
 
       if print_gemspecs
         dsl = Dsl.new.tap {|d| d.eval_gemfile(Bundler.default_gemfile) }
+        out << "\n## Gemspecs\n" unless dsl.gemspecs.empty?
         dsl.gemspecs.each do |gs|
-          out << "\n#{File.basename(gs.loaded_from)}"
-          out << "\n\n    " << read_file(gs.loaded_from).gsub(/\n/, "\n    ") << "\n"
+          out << "\n### #{File.basename(gs.loaded_from)}"
+          out << "\n\n```ruby\n" << read_file(gs.loaded_from).chomp << "\n```\n"
         end
       end
 
diff --git a/lib/bundler/errors.rb b/lib/bundler/errors.rb
index 7681ea7..6ce8493 100644
--- a/lib/bundler/errors.rb
+++ b/lib/bundler/errors.rb
@@ -52,6 +52,9 @@ module Bundler
   class CyclicDependencyError < BundlerError; status_code(21); end
   class GemfileLockNotFound < BundlerError; status_code(22); end
   class PluginError < BundlerError; status_code(29); end
+  class SudoNotPermittedError < BundlerError; status_code(30); end
+  class ThreadCreationError < BundlerError; status_code(33); end
+  class APIResponseMismatchError < BundlerError; status_code(34); end
   class GemfileEvalError < GemfileError; end
   class MarshalError < StandardError; end
 
@@ -131,4 +134,24 @@ module Bundler
 
     status_code(28)
   end
+
+  class NoSpaceOnDeviceError < PermissionError
+    def message
+      "There was an error while trying to #{action} `#{@path}`. " \
+      "There was insufficient space remaining on the device."
+    end
+
+    status_code(31)
+  end
+
+  class GenericSystemCallError < BundlerError
+    attr_reader :underlying_error
+
+    def initialize(underlying_error, message)
+      @underlying_error = underlying_error
+      super("#{message}\nThe underlying system error is #{@underlying_error.class}: #{@underlying_error}")
+    end
+
+    status_code(32)
+  end
 end
diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb
new file mode 100644
index 0000000..150cac1
--- /dev/null
+++ b/lib/bundler/feature_flag.rb
@@ -0,0 +1,32 @@
+# frozen_string_literal: true
+module Bundler
+  class FeatureFlag
+    def self.settings_flag(flag, &default)
+      unless Bundler::Settings::BOOL_KEYS.include?(flag.to_s)
+        raise "Cannot use `#{flag}` as a settings feature flag since it isn't a bool key"
+      end
+      define_method("#{flag}?") do
+        value = Bundler.settings[flag]
+        value = instance_eval(&default) if value.nil? && !default.nil?
+        value
+      end
+    end
+
+    (1..10).each {|v| define_method("bundler_#{v}_mode?") { major_version >= v } }
+
+    settings_flag(:allow_offline_install) { bundler_2_mode? }
+    settings_flag(:only_update_to_newer_versions) { bundler_2_mode? }
+    settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") }
+
+    def initialize(bundler_version)
+      @bundler_version = Gem::Version.create(bundler_version)
+    end
+
+    def major_version
+      @bundler_version.segments.first
+    end
+    private :major_version
+
+    class << self; private :settings_flag; end
+  end
+end
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb
index 0e890d4..9e208e4 100644
--- a/lib/bundler/fetcher.rb
+++ b/lib/bundler/fetcher.rb
@@ -237,7 +237,7 @@ module Bundler
           Bundler.settings[:ssl_client_cert]
         raise SSLError if needs_ssl && !defined?(OpenSSL::SSL)
 
-        con = Net::HTTP::Persistent.new "bundler", :ENV
+        con = Bundler::Persistent::Net::HTTP::Persistent.new "bundler", :ENV
         if gem_proxy = Bundler.rubygems.configuration[:http_proxy]
           con.proxy = URI.parse(gem_proxy) if gem_proxy != :no_proxy
         end
@@ -273,7 +273,7 @@ module Bundler
       Timeout::Error, EOFError, SocketError, Errno::ENETDOWN, Errno::ENETUNREACH,
       Errno::EINVAL, Errno::ECONNRESET, Errno::ETIMEDOUT, Errno::EAGAIN,
       Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,
-      Net::HTTP::Persistent::Error, Zlib::BufError, Errno::EHOSTUNREACH
+      Bundler::Persistent::Net::HTTP::Persistent::Error, Zlib::BufError, Errno::EHOSTUNREACH
     ].freeze
 
     def bundler_cert_store
diff --git a/lib/bundler/fetcher/compact_index.rb b/lib/bundler/fetcher/compact_index.rb
index 34391bc..97de881 100644
--- a/lib/bundler/fetcher/compact_index.rb
+++ b/lib/bundler/fetcher/compact_index.rb
@@ -3,10 +3,10 @@ require "bundler/fetcher/base"
 require "bundler/worker"
 
 module Bundler
+  autoload :CompactIndexClient, "bundler/compact_index_client"
+
   class Fetcher
     class CompactIndex < Base
-      require "bundler/vendor/compact_index_client/lib/compact_index_client"
-
       def self.compact_index_request(method_name)
         method = instance_method(method_name)
         undef_method(method_name)
@@ -61,7 +61,8 @@ module Bundler
       compact_index_request :fetch_spec
 
       def available?
-        user_home = Pathname.new(Bundler.rubygems.user_home)
+        return nil unless md5_available?
+        user_home = Bundler.user_home
         return nil unless user_home.directory? && user_home.writable?
         # Read info file checksums out of /versions, so we can know if gems are up to date
         fetch_uri.scheme != "file" && compact_index_client.update_and_parse_checksums!
@@ -95,7 +96,7 @@ module Bundler
       def bundle_worker(func = nil)
         @bundle_worker ||= begin
           worker_name = "Compact Index (#{display_uri.host})"
-          Bundler::Worker.new(25, worker_name, func)
+          Bundler::Worker.new(Bundler.current_ruby.rbx? ? 1 : 25, worker_name, func)
         end
         @bundle_worker.tap do |worker|
           worker.instance_variable_set(:@func, func) if func
@@ -114,11 +115,21 @@ module Bundler
         def call(path, headers)
           fetcher.downloader.fetch(fetcher.fetch_uri + path, headers)
         rescue NetworkDownError => e
-          raise unless Bundler.settings[:allow_offline_install] && headers["If-None-Match"]
+          raise unless Bundler.feature_flag.allow_offline_install? && headers["If-None-Match"]
           ui.warn "Using the cached data for the new index because of a network error: #{e}"
           Net::HTTPNotModified.new(nil, nil, nil)
         end
       end
+
+      def md5_available?
+        require "openssl"
+        OpenSSL::Digest::MD5.digest("")
+        true
+      rescue LoadError
+        true
+      rescue OpenSSL::Digest::DigestError
+        false
+      end
     end
   end
 end
diff --git a/lib/bundler/fetcher/dependency.rb b/lib/bundler/fetcher/dependency.rb
index 1cd5f9a..445b0f2 100644
--- a/lib/bundler/fetcher/dependency.rb
+++ b/lib/bundler/fetcher/dependency.rb
@@ -73,7 +73,7 @@ module Bundler
 
       def dependency_api_uri(gem_names = [])
         uri = fetch_uri + "api/v1/dependencies"
-        uri.query = "gems=#{CGI.escape(gem_names.join(","))}" if gem_names.any?
+        uri.query = "gems=#{CGI.escape(gem_names.sort.join(","))}" if gem_names.any?
         uri
       end
     end
diff --git a/lib/bundler/fetcher/downloader.rb b/lib/bundler/fetcher/downloader.rb
index c8d714c..453e464 100644
--- a/lib/bundler/fetcher/downloader.rb
+++ b/lib/bundler/fetcher/downloader.rb
@@ -38,6 +38,8 @@ module Bundler
       end
 
       def request(uri, options)
+        validate_uri_scheme!(uri)
+
         Bundler.ui.debug "HTTP GET #{uri}"
         req = Net::HTTP::Get.new uri.request_uri, options
         if uri.user
@@ -56,11 +58,21 @@ module Bundler
         case e.message
         when /host down:/, /getaddrinfo: nodename nor servname provided/
           raise NetworkDownError, "Could not reach host #{uri.host}. Check your network " \
-          "connection and try again."
+            "connection and try again."
         else
-          raise HTTPError, "Network error while fetching #{URICredentialsFilter.credential_filtered_uri(uri)}"
+          raise HTTPError, "Network error while fetching #{URICredentialsFilter.credential_filtered_uri(uri)}" \
+            " (#{e})"
         end
       end
+
+    private
+
+      def validate_uri_scheme!(uri)
+        return if uri.scheme =~ /\Ahttps?\z/
+        raise InvalidOption,
+          "The request uri `#{uri}` has an invalid scheme (`#{uri.scheme}`). " \
+          "Did you mean `http` or `https`?"
+      end
     end
   end
 end
diff --git a/lib/bundler/friendly_errors.rb b/lib/bundler/friendly_errors.rb
index df45dd6..3ba3dcd 100644
--- a/lib/bundler/friendly_errors.rb
+++ b/lib/bundler/friendly_errors.rb
@@ -37,6 +37,11 @@ module Bundler
       when Gem::InvalidSpecificationException
         Bundler.ui.error error.message, :wrap => true
       when SystemExit
+      when *[defined?(Java::JavaLang::OutOfMemoryError) && Java::JavaLang::OutOfMemoryError].compact
+        Bundler.ui.error "\nYour JVM has run out of memory, and Bundler cannot continue. " \
+          "You can decrease the amount of memory Bundler needs by removing gems from your Gemfile, " \
+          "especially large gems. (Gems can be as large as hundreds of megabytes, and Bundler has to read those files!). " \
+          "Alternatively, you can increase the amount of memory the JVM is able to use by running Bundler with jruby -J-Xmx1024m -S bundle (JRuby defaults to 500MB)."
       else request_issue_report_for(error)
       end
     end
@@ -53,25 +58,41 @@ module Bundler
     def request_issue_report_for(e)
       Bundler.ui.info <<-EOS.gsub(/^ {8}/, "")
         --- ERROR REPORT TEMPLATE -------------------------------------------------------
-        - What did you do?
+        # Error Report
+
+        ## Questions
+
+        Please fill out answers to these questions, it'll help us figure out
+        why things are going wrong.
+
+        - **What did you do?**
 
           I ran the command `#{$PROGRAM_NAME} #{ARGV.join(" ")}`
 
-        - What did you expect to happen?
+        - **What did you expect to happen?**
 
           I expected Bundler to...
 
-        - What happened instead?
+        - **What happened instead?**
 
           Instead, what happened was...
 
+        - **Have you tried any solutions posted on similar issues in our issue tracker, stack overflow, or google?**
+
+          I tried...
+
+        - **Have you read our issues document, https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md?**
+
+          ...
 
-        Error details
+        ## Backtrace
 
-            #{e.class}: #{e.message}
-              #{e.backtrace && e.backtrace.join("\n              ")}
+        ```
+        #{e.class}: #{e.message}
+          #{e.backtrace && e.backtrace.join("\n          ").chomp}
+        ```
 
-        #{Bundler::Env.new.report(:print_gemfile => false, :print_gemspecs => false).gsub(/\n/, "\n      ").strip}
+        #{Bundler::Env.new.report}
         --- TEMPLATE END ----------------------------------------------------------------
 
       EOS
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb
index fdb2db7..936d136 100644
--- a/lib/bundler/gem_helper.rb
+++ b/lib/bundler/gem_helper.rb
@@ -94,11 +94,12 @@ module Bundler
     def rubygem_push(path)
       allowed_push_host = nil
       gem_command = "gem push '#{path}'"
+      gem_command += " --key #{gem_key}" if gem_key
       if @gemspec.respond_to?(:metadata)
         allowed_push_host = @gemspec.metadata["allowed_push_host"]
         gem_command += " --host #{allowed_push_host}" if allowed_push_host
       end
-      unless allowed_push_host || Pathname.new("~/.gem/credentials").expand_path.file?
+      unless allowed_push_host || Bundler.user_home.join(".gem/credentials").file?
         raise "Your rubygems.org credentials aren't set. Run `gem push` to set them."
       end
       sh(gem_command)
@@ -181,6 +182,10 @@ module Bundler
       end
     end
 
+    def gem_key
+      Bundler.settings["gem.push_key"].to_s.downcase if Bundler.settings["gem.push_key"]
+    end
+
     def gem_push?
       !%w(n no nil false off 0).include?(ENV["gem_push"].to_s.downcase)
     end
diff --git a/lib/bundler/gem_helpers.rb b/lib/bundler/gem_helpers.rb
index 5c824ff..955834f 100644
--- a/lib/bundler/gem_helpers.rb
+++ b/lib/bundler/gem_helpers.rb
@@ -25,8 +25,76 @@ module Bundler
     module_function :generic
 
     def generic_local_platform
-      generic(Gem::Platform.local)
+      generic(Bundler.local_platform)
     end
     module_function :generic_local_platform
+
+    def platform_specificity_match(spec_platform, user_platform)
+      spec_platform = Gem::Platform.new(spec_platform)
+      return PlatformMatch::EXACT_MATCH if spec_platform == user_platform
+      return PlatformMatch::WORST_MATCH if spec_platform.nil? || spec_platform == Gem::Platform::RUBY || user_platform == Gem::Platform::RUBY
+
+      PlatformMatch.new(
+        PlatformMatch.os_match(spec_platform, user_platform),
+        PlatformMatch.cpu_match(spec_platform, user_platform),
+        PlatformMatch.platform_version_match(spec_platform, user_platform)
+      )
+    end
+    module_function :platform_specificity_match
+
+    def select_best_platform_match(specs, platform)
+      specs.select {|spec| spec.match_platform(platform) }.
+        min_by {|spec| platform_specificity_match(spec.platform, platform) }
+    end
+    module_function :select_best_platform_match
+
+    PlatformMatch = Struct.new(:os_match, :cpu_match, :platform_version_match)
+    class PlatformMatch
+      def <=>(other)
+        return nil unless other.is_a?(PlatformMatch)
+
+        m = os_match <=> other.os_match
+        return m unless m.zero?
+
+        m = cpu_match <=> other.cpu_match
+        return m unless m.zero?
+
+        m = platform_version_match <=> other.platform_version_match
+        m
+      end
+
+      EXACT_MATCH = new(-1, -1, -1).freeze
+      WORST_MATCH = new(1_000_000, 1_000_000, 1_000_000).freeze
+
+      def self.os_match(spec_platform, user_platform)
+        if spec_platform.os == user_platform.os
+          0
+        else
+          1
+        end
+      end
+
+      def self.cpu_match(spec_platform, user_platform)
+        if spec_platform.cpu == user_platform.cpu
+          0
+        elsif spec_platform.cpu == "arm" && user_platform.cpu.to_s.start_with?("arm")
+          0
+        elsif spec_platform.cpu.nil? || spec_platform.cpu == "universal"
+          1
+        else
+          2
+        end
+      end
+
+      def self.platform_version_match(spec_platform, user_platform)
+        if spec_platform.version == user_platform.version
+          0
+        elsif spec_platform.version.nil?
+          1
+        else
+          2
+        end
+      end
+    end
   end
 end
diff --git a/lib/bundler/gemdeps.rb b/lib/bundler/gemdeps.rb
new file mode 100644
index 0000000..8595b8c
--- /dev/null
+++ b/lib/bundler/gemdeps.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+module Bundler
+  class Gemdeps
+    def initialize(runtime)
+      @runtime = runtime
+    end
+
+    def requested_specs
+      @runtime.requested_specs
+    end
+
+    def specs
+      @runtime.specs
+    end
+
+    def dependencies
+      @runtime.dependencies
+    end
+
+    def current_dependencies
+      @runtime.current_dependencies
+    end
+
+    def requires
+      @runtime.requires
+    end
+  end
+end
diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb
index 5bdb102..5f54796 100644
--- a/lib/bundler/index.rb
+++ b/lib/bundler/index.rb
@@ -58,17 +58,23 @@ module Bundler
     # Search this index's specs, and any source indexes that this index knows
     # about, returning all of the results.
     def search(query, base = nil)
+      sort_specs(unsorted_search(query, base))
+    end
+
+    def unsorted_search(query, base)
       results = local_search(query, base)
-      seen = results.map(&:full_name).to_set
+
+      seen = results.map(&:full_name).to_set unless @sources.empty?
 
       @sources.each do |source|
-        source.search(query, base).each do |spec|
+        source.unsorted_search(query, base).each do |spec|
           results << spec if seen.add?(spec.full_name)
         end
       end
 
-      sort_specs(results)
+      results
     end
+    protected :unsorted_search
 
     def self.sort_specs(specs)
       specs.sort_by do |s|
@@ -109,14 +115,19 @@ module Bundler
 
     # returns a list of the dependencies
     def unmet_dependency_names
-      names = dependency_names
-      names.delete_if {|n| n == "bundler" }
-      names.select {|n| search(n).empty? }
+      dependency_names.select do |name|
+        name != "bundler" && search(name).empty?
+      end
     end
 
     def dependency_names
       names = []
-      each {|s| names.concat(s.dependencies.map(&:name)) }
+      each do |spec|
+        spec.dependencies.each do |dep|
+          next if dep.type == :development
+          names << dep.name
+        end
+      end
       names.uniq
     end
 
@@ -139,6 +150,8 @@ module Bundler
       end
     end
 
+    # Whether all the specs in self are in other
+    # TODO: rename to #include?
     def ==(other)
       all? do |spec|
         other_spec = other[spec].first
diff --git a/lib/bundler/injector.rb b/lib/bundler/injector.rb
index 787d95f..cba1b3d 100644
--- a/lib/bundler/injector.rb
+++ b/lib/bundler/injector.rb
@@ -27,17 +27,18 @@ module Bundler
       @new_deps -= builder.dependencies
 
       # add new deps to the end of the in-memory Gemfile
-      builder.eval_gemfile("injected gems", new_gem_lines) if @new_deps.any?
+      # Set conservative versioining to false because we want to let the resolver resolve the version first
+      builder.eval_gemfile("injected gems", build_gem_lines(false)) if @new_deps.any?
 
       # resolve to see if the new deps broke anything
-      definition = builder.to_definition(lockfile_path, {})
-      definition.resolve_remotely!
+      @definition = builder.to_definition(lockfile_path, {})
+      @definition.resolve_remotely!
 
       # since nothing broke, we can add those gems to the gemfile
-      append_to(gemfile_path) if @new_deps.any?
+      append_to(gemfile_path, build_gem_lines(@options[:conservative_versioning])) if @new_deps.any?
 
       # since we resolved successfully, write out the lockfile
-      definition.lock(Bundler.default_lockfile)
+      @definition.lock(Bundler.default_lockfile)
 
       # return an array of the deps that we added
       return @new_deps
@@ -47,17 +48,37 @@ module Bundler
 
   private
 
-    def new_gem_lines
+    def conservative_version(spec)
+      version = spec.version
+      return ">= 0" if version.nil?
+      segments = version.segments
+      seg_end_index = version >= Gem::Version.new("1.0") ? 1 : 2
+
+      prerelease_suffix = version.to_s.gsub(version.release.to_s, "") if version.prerelease?
+      "~> #{segments[0..seg_end_index].join(".")}#{prerelease_suffix}"
+    end
+
+    def build_gem_lines(conservative_versioning)
       @new_deps.map do |d|
-        name = "'#{d.name}'"
-        requirement = ", '#{d.requirement}'"
-        group = ", :group => #{d.groups.inspect}" if d.groups != Array(:default)
-        source = ", :source => '#{d.source}'" unless d.source.nil?
+        name = d.name.dump
+
+        requirement = if conservative_versioning
+          ", \"#{conservative_version(@definition.specs[d.name][0])}\""
+        else
+          ", #{d.requirement.as_list.map(&:dump).join(", ")}"
+        end
+
+        if d.groups != Array(:default)
+          group = d.groups.size == 1 ? ", :group => #{d.groups.inspect}" : ", :groups => #{d.groups.inspect}"
+        end
+
+        source = ", :source => \"#{d.source}\"" unless d.source.nil?
+
         %(gem #{name}#{requirement}#{group}#{source})
       end.join("\n")
     end
 
-    def append_to(gemfile_path)
+    def append_to(gemfile_path, new_gem_lines)
       gemfile_path.open("a") do |f|
         f.puts
         if @options["timestamp"] || @options["timestamp"].nil?
diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb
index dcaf229..4d3791b 100644
--- a/lib/bundler/inline.rb
+++ b/lib/bundler/inline.rb
@@ -39,15 +39,15 @@ def gemfile(install = false, options = {}, &gemfile)
   def Bundler.root
     Bundler::SharedHelpers.pwd.expand_path
   end
-  ENV["BUNDLE_GEMFILE"] ||= "Gemfile"
+  ENV["BUNDLE_GEMFILE"] = "Gemfile"
 
-  Bundler::Plugin.gemfile_install(&gemfile) if Bundler.settings[:plugins]
+  Bundler::Plugin.gemfile_install(&gemfile) if Bundler.feature_flag.plugins?
   builder = Bundler::Dsl.new
   builder.instance_eval(&gemfile)
 
   definition = builder.to_definition(nil, true)
   def definition.lock(*); end
-  definition.validate_ruby!
+  definition.validate_runtime!
 
   missing_specs = proc do
     begin
@@ -60,7 +60,7 @@ def gemfile(install = false, options = {}, &gemfile)
 
   Bundler.ui = ui if install
   if install || missing_specs.call
-    installer = Bundler::Installer.install(Bundler.root, definition, :system => true)
+    installer = Bundler::Installer.install(Bundler.root, definition, :system => true, :inline => true)
     installer.post_install_messages.each do |name, message|
       Bundler.ui.info "Post-install message from #{name}:\n#{message}"
     end
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index 528dee1..a1d864e 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -49,7 +49,7 @@ module Bundler
     # Bundler returns a warning message stating so and this method returns.
     #
     # Fourthly, Bundler checks if the default lockfile (Gemfile.lock) exists, and if so
-    # then proceeds to set up a defintion based on the default gemfile (Gemfile) and the
+    # then proceeds to set up a definition based on the default gemfile (Gemfile) and the
     # default lock file (Gemfile.lock). However, this is not the case if the platform is different
     # to that which is specified in Gemfile.lock, or if there are any missing specs for the gems.
     #
@@ -159,6 +159,7 @@ module Bundler
     # that said, it's a rare situation (other than rake), and parallel
     # installation is SO MUCH FASTER. so we let people opt in.
     def install(options)
+      Bundler.rubygems.load_plugins
       force = options["force"]
       jobs = 1
       jobs = [Bundler.settings[:jobs].to_i - 1, 1].max if can_install_in_parallel?
@@ -207,11 +208,11 @@ module Bundler
       end unless Bundler.bundle_path.exist?
     rescue Errno::EEXIST
       raise PathError, "Could not install to path `#{Bundler.settings[:path]}` " \
-        "because of an invalid symlink. Remove the symlink so the directory can be created."
+        "because a file already exists at that path. Either remove or rename the file so the directory can be created."
     end
 
     def resolve_if_need(options)
-      if Bundler.default_lockfile.exist? && !options["update"]
+      if !options["update"] && !options[:inline] && !options["force"] && Bundler.default_lockfile.file?
         local = Bundler.ui.silence do
           begin
             tmpdef = Definition.build(Bundler.default_gemfile, Bundler.default_lockfile, nil)
diff --git a/lib/bundler/installer/gem_installer.rb b/lib/bundler/installer/gem_installer.rb
index 84dee97..10e7c7f 100644
--- a/lib/bundler/installer/gem_installer.rb
+++ b/lib/bundler/installer/gem_installer.rb
@@ -16,7 +16,7 @@ module Bundler
       Bundler.ui.debug "#{worker}:  #{spec.name} (#{spec.version}) from #{spec.loaded_from}"
       generate_executable_stubs
       return true, post_install_message
-    rescue Bundler::InstallHookError, Bundler::SecurityError
+    rescue Bundler::InstallHookError, Bundler::SecurityError, APIResponseMismatchError
       raise
     rescue Errno::ENOSPC
       return false, out_of_space_message
@@ -52,12 +52,12 @@ module Bundler
     end
 
     def install
-      spec.source.install(spec, :force => force, :ensure_builtin_gems_cached => standalone)
+      spec.source.install(spec, :force => force, :ensure_builtin_gems_cached => standalone, :build_args => Array(spec_settings))
     end
 
     def install_with_settings
       # Build arguments are global, so this is mutexed
-      Bundler.rubygems.with_build_args([spec_settings]) { install }
+      Bundler.rubygems.install_with_build_args([spec_settings]) { install }
     end
 
     def out_of_space_message
diff --git a/lib/bundler/installer/parallel_installer.rb b/lib/bundler/installer/parallel_installer.rb
index 12f11bb..97c124e 100644
--- a/lib/bundler/installer/parallel_installer.rb
+++ b/lib/bundler/installer/parallel_installer.rb
@@ -47,27 +47,30 @@ module Bundler
       # sure needed dependencies have been installed.
       def dependencies_installed?(all_specs)
         installed_specs = all_specs.select(&:installed?).map(&:name)
-        dependencies(all_specs.map(&:name)).all? {|d| installed_specs.include? d.name }
+        dependencies.all? {|d| installed_specs.include? d.name }
       end
 
       # Represents only the non-development dependencies, the ones that are
       # itself and are in the total list.
-      def dependencies(all_spec_names)
+      def dependencies
         @dependencies ||= begin
-          deps = all_dependencies.reject {|dep| ignorable_dependency? dep }
-          missing = deps.reject {|dep| all_spec_names.include? dep.name }
-          unless missing.empty?
-            raise Bundler::LockfileError, "Your Gemfile.lock is corrupt. The following #{missing.size > 1 ? "gems are" : "gem is"} missing " \
-                                "from the DEPENDENCIES section: '#{missing.map(&:name).join('\' \'')}'"
-          end
-          deps
+          all_dependencies.reject {|dep| ignorable_dependency? dep }
         end
       end
 
+      def missing_lockfile_dependencies(all_spec_names)
+        deps = all_dependencies.reject {|dep| ignorable_dependency? dep }
+        deps.reject {|dep| all_spec_names.include? dep.name }
+      end
+
       # Represents all dependencies
       def all_dependencies
         @spec.dependencies
       end
+
+      def to_s
+        "#<#{self.class} #{@spec.full_name} (#{state})>"
+      end
     end
 
     def self.call(*args)
@@ -79,15 +82,23 @@ module Bundler
       [Bundler.settings[:jobs].to_i - 1, 1].max
     end
 
+    attr_reader :size
+
     def initialize(installer, all_specs, size, standalone, force)
       @installer = installer
       @size = size
       @standalone = standalone
       @force = force
       @specs = all_specs.map {|s| SpecInstallation.new(s) }
+      @spec_set = all_specs
     end
 
     def call
+      # Since `autoload` has the potential for threading issues on 1.8.7
+      # TODO:  remove in bundler 2.0
+      require "bundler/gem_remote_fetcher" if RUBY_VERSION < "1.9"
+
+      check_for_corrupt_lockfile
       enqueue_specs
       process_specs until @specs.all?(&:installed?) || @specs.any?(&:failed?)
       handle_error if @specs.any?(&:failed?)
@@ -106,7 +117,7 @@ module Bundler
           spec_install.post_install_message = message
         elsif !success
           spec_install.state = :failed
-          spec_install.error = message
+          spec_install.error = "#{message}\n\n#{require_tree_for_spec(spec_install.spec)}"
         end
         spec_install
       }
@@ -131,6 +142,44 @@ module Bundler
       raise Bundler::InstallError, errors.map(&:to_s).join("\n\n")
     end
 
+    def check_for_corrupt_lockfile
+      missing_dependencies = @specs.map do |s|
+        [
+          s,
+          s.missing_lockfile_dependencies(@specs.map(&:name)),
+        ]
+      end.reject { |a| a.last.empty? }
+      return if missing_dependencies.empty?
+
+      warning = []
+      warning << "Your lockfile was created by an old Bundler that left some things out."
+      if @size != 1
+        warning << "Because of the missing DEPENDENCIES, we can only install gems one at a time, instead of installing #{@size} at a time."
+        @size = 1
+      end
+      warning << "You can fix this by adding the missing gems to your Gemfile, running bundle install, and then removing the gems from your Gemfile."
+      warning << "The missing gems are:"
+
+      missing_dependencies.each do |spec, missing|
+        warning << "* #{missing.map(&:name).join(", ")} depended upon by #{spec.name}"
+      end
+
+      Bundler.ui.warn(warning.join("\n"))
+    end
+
+    def require_tree_for_spec(spec)
+      tree = @spec_set.what_required(spec)
+      t = String.new("In #{File.basename(SharedHelpers.default_gemfile)}:\n")
+      tree.each_with_index do |s, depth|
+        t << "  " * depth.succ << s.name
+        unless tree.last == s
+          t << %( was resolved to #{s.version}, which depends on)
+        end
+        t << %(\n)
+      end
+      t
+    end
+
     # Keys in the remains hash represent uninstalled gems specs.
     # We enqueue all gem specs that do not have any dependencies.
     # Later we call this lambda again to install specs that depended on
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb
index 83ab9ef..8d9a02c 100644
--- a/lib/bundler/lazy_specification.rb
+++ b/lib/bundler/lazy_specification.rb
@@ -1,11 +1,24 @@
 # frozen_string_literal: true
 require "uri"
-require "rubygems/spec_fetcher"
 require "bundler/match_platform"
 
 module Bundler
   class LazySpecification
     Identifier = Struct.new(:name, :version, :source, :platform, :dependencies)
+    class Identifier
+      include Comparable
+      def <=>(other)
+        return unless other.is_a?(Identifier)
+        [name, version, platform_string] <=> [other.name, other.version, other.platform_string]
+      end
+
+    protected
+
+      def platform_string
+        platform_string = platform.to_s
+        platform_string == Index::RUBY ? Index::NULL : platform_string
+      end
+    end
 
     include MatchPlatform
 
@@ -16,7 +29,7 @@ module Bundler
       @name          = name
       @version       = version
       @dependencies  = []
-      @platform      = platform
+      @platform      = platform || Gem::Platform::RUBY
       @source        = source
       @specification = nil
     end
@@ -55,10 +68,19 @@ module Bundler
     end
 
     def __materialize__
+      search_object = Bundler.settings[:specific_platform] || Bundler.settings[:force_ruby_platform] ? self : Dependency.new(name, version)
       @specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name
         source.gemspec.tap {|s| s.source = source }
       else
-        source.specs.search(Gem::Dependency.new(name, version)).last
+        search = source.specs.search(search_object).last
+        if search && Gem::Platform.new(search.platform) != Gem::Platform.new(platform) && !search.runtime_dependencies.-(dependencies.reject {|d| d.type == :development }).empty?
+          Bundler.ui.warn "Unable to use the platform-specific (#{search.platform}) version of #{name} (#{version}) " \
+            "because it has different dependencies from the #{platform} version. " \
+            "To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again."
+          search = source.specs.search(self).last
+        end
+        search.dependencies = dependencies if search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification)
+        search
       end
     end
 
@@ -78,6 +100,11 @@ module Bundler
       @__identifier ||= Identifier.new(name, version, source, platform, dependencies)
     end
 
+    def git_version
+      return unless source.is_a?(Bundler::Source::Git)
+      " #{source.revision[0..6]}"
+    end
+
   private
 
     def to_ary
diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb
index 063a188..dbf8926 100644
--- a/lib/bundler/lockfile_parser.rb
+++ b/lib/bundler/lockfile_parser.rb
@@ -1,5 +1,4 @@
 # frozen_string_literal: true
-require "strscan"
 
 # Some versions of the Bundler 1.1 RC series introduced corrupted
 # lockfiles. There were two major problems:
@@ -62,7 +61,7 @@ module Bundler
     def initialize(lockfile)
       @platforms    = []
       @sources      = []
-      @dependencies = []
+      @dependencies = {}
       @state        = nil
       @specs        = {}
 
@@ -92,7 +91,7 @@ module Bundler
         end
       end
       @sources << @rubygems_aggregate
-      @specs = @specs.values
+      @specs = @specs.values.sort_by(&:identifier)
       warn_for_outdated_bundler_version
     rescue ArgumentError => e
       Bundler.ui.debug(e)
@@ -172,43 +171,53 @@ module Bundler
       end
     end
 
-    NAME_VERSION = '(?! )(.*?)(?: \(([^-]*)(?:-(.*))?\))?'.freeze
-    NAME_VERSION_2 = /^ {2}#{NAME_VERSION}(!)?$/
-    NAME_VERSION_4 = /^ {4}#{NAME_VERSION}$/
-    NAME_VERSION_6 = /^ {6}#{NAME_VERSION}$/
+    space = / /
+    NAME_VERSION = /
+      ^(#{space}{2}|#{space}{4}|#{space}{6})(?!#{space}) # Exactly 2, 4, or 6 spaces at the start of the line
+      (.*?)                                              # Name
+      (?:#{space}\(([^-]*)                               # Space, followed by version
+      (?:-(.*))?\))?                                     # Optional platform
+      (!)?                                               # Optional pinned marker
+      $                                                  # Line end
+    /xo
 
     def parse_dependency(line)
-      if line =~ NAME_VERSION_2
-        name = $1
-        version = $2
-        pinned = $4
-        version = version.split(",").map(&:strip) if version
-
-        dep = Bundler::Dependency.new(name, version)
-
-        if pinned && dep.name != "bundler"
-          spec = @specs.find {|_, v| v.name == dep.name }
-          dep.source = spec.last.source if spec
-
-          # Path sources need to know what the default name / version
-          # to use in the case that there are no gemspecs present. A fake
-          # gemspec is created based on the version set on the dependency
-          # TODO: Use the version from the spec instead of from the dependency
-          if version && version.size == 1 && version.first =~ /^\s*= (.+)\s*$/ && dep.source.is_a?(Bundler::Source::Path)
-            dep.source.name    = name
-            dep.source.version = $1
-          end
+      return unless line =~ NAME_VERSION
+      spaces = $1
+      return unless spaces.size == 2
+      name = $2
+      version = $3
+      pinned = $5
+
+      version = version.split(",").map(&:strip) if version
+
+      dep = Bundler::Dependency.new(name, version)
+
+      if pinned && dep.name != "bundler"
+        spec = @specs.find {|_, v| v.name == dep.name }
+        dep.source = spec.last.source if spec
+
+        # Path sources need to know what the default name / version
+        # to use in the case that there are no gemspecs present. A fake
+        # gemspec is created based on the version set on the dependency
+        # TODO: Use the version from the spec instead of from the dependency
+        if version && version.size == 1 && version.first =~ /^\s*= (.+)\s*$/ && dep.source.is_a?(Bundler::Source::Path)
+          dep.source.name    = name
+          dep.source.version = $1
         end
-
-        @dependencies << dep
       end
+
+      @dependencies[dep.name] = dep
     end
 
     def parse_spec(line)
-      if line =~ NAME_VERSION_4
-        name = $1
-        version = $2
-        platform = $3
+      return unless line =~ NAME_VERSION
+      spaces = $1
+      name = $2
+      version = $3
+      platform = $4
+
+      if spaces.size == 4
         version = Gem::Version.new(version)
         platform = platform ? Gem::Platform.new(platform) : Gem::Platform::RUBY
         @current_spec = LazySpecification.new(name, version, platform)
@@ -217,9 +226,7 @@ module Bundler
         # Avoid introducing multiple copies of the same spec (caused by
         # duplicate GIT sections)
         @specs[@current_spec.identifier] ||= @current_spec
-      elsif line =~ NAME_VERSION_6
-        name = $1
-        version = $2
+      elsif spaces.size == 6
         version = version.split(",").map(&:strip) if version
         dep = Gem::Dependency.new(name, version)
         @current_spec.dependencies << dep
diff --git a/lib/bundler/match_platform.rb b/lib/bundler/match_platform.rb
index fed418b..050cd0e 100644
--- a/lib/bundler/match_platform.rb
+++ b/lib/bundler/match_platform.rb
@@ -6,9 +6,18 @@ module Bundler
     include GemHelpers
 
     def match_platform(p)
-      Gem::Platform::RUBY == platform ||
-        platform.nil? || p == platform ||
-        generic(Gem::Platform.new(platform)) === p
+      MatchPlatform.platforms_match?(platform, p)
+    end
+
+    def self.platforms_match?(gemspec_platform, local_platform)
+      return true if gemspec_platform.nil?
+      return true if Gem::Platform::RUBY == gemspec_platform
+      return true if local_platform == gemspec_platform
+      gemspec_platform = Gem::Platform.new(gemspec_platform)
+      return true if GemHelpers.generic(gemspec_platform) === local_platform
+      return true if gemspec_platform === local_platform
+
+      false
     end
   end
 end
diff --git a/lib/bundler/mirror.rb b/lib/bundler/mirror.rb
index a1f3aae..97a6776 100644
--- a/lib/bundler/mirror.rb
+++ b/lib/bundler/mirror.rb
@@ -1,4 +1,6 @@
 # frozen_string_literal: true
+require "socket"
+
 module Bundler
   class Settings
     # Class used to build the mirror set and then find a mirror for a given URI
diff --git a/lib/bundler/plugin.rb b/lib/bundler/plugin.rb
index 06f0317..66f485e 100644
--- a/lib/bundler/plugin.rb
+++ b/lib/bundler/plugin.rb
@@ -37,7 +37,11 @@ module Bundler
 
       save_plugins names, specs
     rescue PluginError => e
-      specs.values.map {|spec| Bundler.rm_rf(spec.full_gem_path) } if specs
+      if specs
+        specs_to_delete = Hash[specs.select {|k, _v| names.include?(k) && !index.commands.values.include?(k) }]
+        specs_to_delete.values.each {|spec| Bundler.rm_rf(spec.full_gem_path) }
+      end
+
       Bundler.ui.error "Failed to install plugin #{name}: #{e.message}\n  #{e.backtrace.join("\n ")}"
     end
 
@@ -62,7 +66,9 @@ module Bundler
 
       save_plugins plugins, installed_specs, builder.inferred_plugins
     rescue => e
-      Bundler.ui.error "Failed to install plugin: #{e.message}\n  #{e.backtrace[0]}"
+      unless e.is_a?(GemfileError)
+        Bundler.ui.error "Failed to install plugin: #{e.message}\n  #{e.backtrace[0]}"
+      end
       raise
     end
 
@@ -158,7 +164,7 @@ module Bundler
     #
     # @param [String] event
     def hook(event, *args, &arg_blk)
-      return unless Bundler.settings[:plugins]
+      return unless Bundler.feature_flag.plugins?
 
       plugins = index.hook_plugins(event)
       return unless plugins.any?
diff --git a/lib/bundler/plugin/api.rb b/lib/bundler/plugin/api.rb
index bd7cef5..a2d5cbb 100644
--- a/lib/bundler/plugin/api.rb
+++ b/lib/bundler/plugin/api.rb
@@ -1,5 +1,4 @@
 # frozen_string_literal: true
-require "bundler/plugin/api/source"
 
 module Bundler
   # This is the interfacing class represents the API that we intend to provide
@@ -24,6 +23,8 @@ module Bundler
   # and hooks).
   module Plugin
     class API
+      autoload :Source, "bundler/plugin/api/source"
+
       # The plugins should declare that they handle a command through this helper.
       #
       # @param [String] command being handled by them
diff --git a/lib/bundler/plugin/api/source.rb b/lib/bundler/plugin/api/source.rb
index 7851456..5d3f58d 100644
--- a/lib/bundler/plugin/api/source.rb
+++ b/lib/bundler/plugin/api/source.rb
@@ -6,7 +6,7 @@ module Bundler
   module Plugin
     class API
       # This class provides the base to build source plugins
-      # All the method here are require to build a source plugin (except
+      # All the method here are required to build a source plugin (except
       # `uri_hash`, `gem_install_dir`; they are helpers).
       #
       # Defaults for methods, where ever possible are provided which is
@@ -93,7 +93,7 @@ module Bundler
         # It should be called in `install` after the plugin is done placing the
         # gem at correct install location.
         #
-        # It also runs Gem hooks `post_install`, `post_build` and `post_install`
+        # It also runs Gem hooks `pre_install`, `post_build` and `post_install`
         #
         # Note: Do not override if you don't know what you are doing.
         def post_install(spec, disable_exts = false)
@@ -287,6 +287,12 @@ module Bundler
         def root
           Bundler.root
         end
+
+        # @private
+        # Returns true
+        def bundler_plugin_api_source?
+          true
+        end
       end
     end
   end
diff --git a/lib/bundler/plugin/index.rb b/lib/bundler/plugin/index.rb
index 7f89d26..8dde072 100644
--- a/lib/bundler/plugin/index.rb
+++ b/lib/bundler/plugin/index.rb
@@ -20,6 +20,8 @@ module Bundler
         end
       end
 
+      attr_reader :commands
+
       def initialize
         @plugin_paths = {}
         @commands = {}
diff --git a/lib/bundler/postit_trampoline.rb b/lib/bundler/postit_trampoline.rb
index dbb23aa..b62a5e7 100644
--- a/lib/bundler/postit_trampoline.rb
+++ b/lib/bundler/postit_trampoline.rb
@@ -1,13 +1,18 @@
 # frozen_string_literal: true
-if ENV["BUNDLE_ENABLE_TRAMPOLINE"]
 
-  module BundlerVendoredPostIt; end
-  require "bundler/vendor/postit/lib/postit"
-  require "rubygems"
+module BundlerVendoredPostIt; end
+require "bundler/vendor/postit/lib/postit"
+require "rubygems"
 
-  environment = BundlerVendoredPostIt::PostIt::Environment.new([])
-  version = Gem::Requirement.new(environment.bundler_version)
+environment = BundlerVendoredPostIt::PostIt::Environment.new([])
+version = Gem::Requirement.new(environment.bundler_version)
+if version.requirements.size == 1 && version.requirements.first.first == "=" # version.exact?
+  if version.requirements.first.last.segments.first >= 2
+    ENV["BUNDLE_TRAMPOLINE_FORCE"] = "true"
+  end
+end
 
+if ENV["BUNDLE_TRAMPOLINE_FORCE"] && !ENV["BUNDLE_TRAMPOLINE_DISABLE"]
   installed_version =
     if defined?(Bundler::VERSION)
       Bundler::VERSION
@@ -65,4 +70,4 @@ You're running Bundler #{installed_version} but this project uses #{running_vers
     abort "The running bundler (#{running_version}) does not match the required `#{version}`"
   end
 
-end # unless ENV["BUNDLE_ENABLE_TRAMPOLINE"]
+end # if ENV["BUNDLE_TRAMPOLINE_FORCE"] && !ENV["BUNDLE_TRAMPOLINE_DISABLE"]
diff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb
index 6a02897..d89abd9 100644
--- a/lib/bundler/remote_specification.rb
+++ b/lib/bundler/remote_specification.rb
@@ -1,6 +1,5 @@
 # frozen_string_literal: true
 require "uri"
-require "rubygems/spec_fetcher"
 
 module Bundler
   # Represents a lazily loaded gem specification, where the full specification
@@ -12,6 +11,7 @@ module Bundler
     include Comparable
 
     attr_reader :name, :version, :platform
+    attr_writer :dependencies
     attr_accessor :source, :remote
 
     def initialize(name, version, platform, spec_fetcher)
@@ -19,6 +19,7 @@ module Bundler
       @version      = Gem::Version.create version
       @platform     = platform
       @spec_fetcher = spec_fetcher
+      @dependencies = nil
     end
 
     # Needed before installs, since the arch matters then and quick
@@ -50,6 +51,7 @@ module Bundler
     # once the remote gem is downloaded, the backend specification will
     # be swapped out.
     def __swap__(spec)
+      SharedHelpers.ensure_same_dependencies(self, dependencies, spec.dependencies)
       @_remote_specification = spec
     end
 
@@ -70,8 +72,21 @@ module Bundler
       "#<#{self.class} name=#{name} version=#{version} platform=#{platform}>"
     end
 
+    def dependencies
+      @dependencies || method_missing(:dependencies)
+    end
+
+    def git_version
+      return unless loaded_from && source.is_a?(Bundler::Source::Git)
+      " #{source.revision[0..6]}"
+    end
+
   private
 
+    def to_ary
+      nil
+    end
+
     def _remote_specification
       @_remote_specification ||= @spec_fetcher.fetch_spec([@name, @version, @platform])
       @_remote_specification || raise(GemspecError, "Gemspec data for #{full_name} was" \
@@ -81,5 +96,10 @@ module Bundler
     def method_missing(method, *args, &blk)
       _remote_specification.send(method, *args, &blk)
     end
+
+    def respond_to?(method, include_all = false)
+      super || _remote_specification.respond_to?(method, include_all)
+    end
+    public :respond_to?
   end
 end
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index 10d5404..db2ae49 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -14,14 +14,23 @@ module Bundler
 
       def message
         conflicts.sort.reduce(String.new) do |o, (name, conflict)|
-          o << %(Bundler could not find compatible versions for gem "#{name}":\n)
+          o << %(\nBundler could not find compatible versions for gem "#{name}":\n)
           if conflict.locked_requirement
             o << %(  In snapshot (#{Bundler.default_lockfile.basename}):\n)
             o << %(    #{printable_dep(conflict.locked_requirement)}\n)
             o << %(\n)
           end
           o << %(  In Gemfile:\n)
-          o << conflict.requirement_trees.sort_by {|t| t.reverse.map(&:name) }.map do |tree|
+          trees = conflict.requirement_trees
+
+          maximal = 1.upto(trees.size).map do |size|
+            trees.map(&:last).flatten(1).combination(size).to_a
+          end.flatten(1).select do |deps|
+            Bundler::VersionRanges.empty?(*Bundler::VersionRanges.for_many(deps.map(&:requirement)))
+          end.min_by(&:size)
+          trees.reject! {|t| !maximal.include?(t.last) } if maximal
+
+          o << trees.sort_by {|t| t.reverse.map(&:name) }.map do |tree|
             t = String.new
             depth = 2
             tree.each do |req|
@@ -62,52 +71,43 @@ module Bundler
             end
           end
           o
-        end
+        end.strip
       end
     end
 
-    ALL = Bundler::Dependency::PLATFORM_MAP.values.uniq.freeze
-
     class SpecGroup < Array
       include GemHelpers
 
-      attr_reader :activated, :required_by
+      attr_reader :activated
 
       def initialize(a)
         super
-        @required_by  = []
-        @activated    = []
+        @required_by = []
+        @activated_platforms = []
         @dependencies = nil
-        @specs        = {}
-
-        ALL.each do |p|
-          @specs[p] = reverse.find {|s| s.match_platform(p) }
+        @specs        = Hash.new do |specs, platform|
+          specs[platform] = select_best_platform_match(self, platform)
         end
       end
 
       def initialize_copy(o)
         super
-        @required_by = o.required_by.dup
-        @activated   = o.activated.dup
+        @activated_platforms = o.activated.dup
       end
 
       def to_specs
-        specs = {}
-
-        @activated.each do |p|
+        @activated_platforms.map do |p|
           next unless s = @specs[p]
-          platform = generic(Gem::Platform.new(s.platform))
-          next if specs[platform]
-
-          lazy_spec = LazySpecification.new(name, version, platform, source)
+          lazy_spec = LazySpecification.new(name, version, s.platform, source)
           lazy_spec.dependencies.replace s.dependencies
-          specs[platform] = lazy_spec
-        end
-        specs.values
+          lazy_spec
+        end.compact
       end
 
       def activate_platform!(platform)
-        @activated << platform if !@activated.include?(platform) && for?(platform, nil)
+        return unless for?(platform)
+        return if @activated_platforms.include?(platform)
+        @activated_platforms << platform
       end
 
       def name
@@ -122,17 +122,9 @@ module Bundler
         @source ||= first.source
       end
 
-      def for?(platform, ruby_version)
+      def for?(platform)
         spec = @specs[platform]
-        return false unless spec
-
-        return true if ruby_version.nil?
-        # Only allow endpoint specifications since they won't hit the network to
-        # fetch the full gemspec when calling required_ruby_version
-        return true if !spec.is_a?(EndpointSpecification) && !spec.is_a?(Gem::Specification)
-        return true if spec.required_ruby_version.nil?
-
-        spec.required_ruby_version.satisfied_by?(ruby_version.to_gem_version_with_patchlevel)
+        !spec.nil?
       end
 
       def to_s
@@ -140,7 +132,11 @@ module Bundler
       end
 
       def dependencies_for_activated_platforms
-        @activated.map {|p| __dependencies[p] }.flatten
+        dependencies = @activated_platforms.map {|p| __dependencies[p] }
+        metadata_dependencies = @activated_platforms.map do |platform|
+          metadata_dependencies(@specs[platform], platform)
+        end
+        dependencies.concat(metadata_dependencies).flatten
       end
 
       def platforms_for_dependency_named(dependency)
@@ -150,19 +146,32 @@ module Bundler
     private
 
       def __dependencies
-        @dependencies ||= begin
-          dependencies = {}
-          ALL.each do |p|
-            next unless spec = @specs[p]
-            dependencies[p] = []
+        @dependencies = Hash.new do |dependencies, platform|
+          dependencies[platform] = []
+          if spec = @specs[platform]
             spec.dependencies.each do |dep|
               next if dep.type == :development
-              dependencies[p] << DepProxy.new(dep, p)
+              dependencies[platform] << DepProxy.new(dep, platform)
             end
           end
-          dependencies
+          dependencies[platform]
         end
       end
+
+      def metadata_dependencies(spec, platform)
+        return [] unless spec
+        # Only allow endpoint specifications since they won't hit the network to
+        # fetch the full gemspec when calling required_ruby_version
+        return [] if !spec.is_a?(EndpointSpecification) && !spec.is_a?(Gem::Specification)
+        dependencies = []
+        if !spec.required_ruby_version.nil? && !spec.required_ruby_version.none?
+          dependencies << DepProxy.new(Gem::Dependency.new("ruby\0", spec.required_ruby_version), platform)
+        end
+        if !spec.required_rubygems_version.nil? && !spec.required_rubygems_version.none?
+          dependencies << DepProxy.new(Gem::Dependency.new("rubygems\0", spec.required_rubygems_version), platform)
+        end
+        dependencies
+      end
     end
 
     # Figures out the best possible configuration of gems that satisfies
@@ -175,30 +184,36 @@ module Bundler
     # ==== Returns
     # <GemBundle>,nil:: If the list of dependencies can be resolved, a
     #   collection of gemspecs is returned. Otherwise, nil is returned.
-    def self.resolve(requirements, index, source_requirements = {}, base = [], ruby_version = nil, gem_version_promoter = GemVersionPromoter.new, additional_base_requirements = [])
+    def self.resolve(requirements, index, source_requirements = {}, base = [], gem_version_promoter = GemVersionPromoter.new, additional_base_requirements = [], platforms = nil)
+      platforms = Set.new(platforms) if platforms
       base = SpecSet.new(base) unless base.is_a?(SpecSet)
-      resolver = new(index, source_requirements, base, ruby_version, gem_version_promoter, additional_base_requirements)
+      resolver = new(index, source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
       result = resolver.start(requirements)
       SpecSet.new(result)
     end
 
-    def initialize(index, source_requirements, base, ruby_version, gem_version_promoter, additional_base_requirements)
+    def initialize(index, source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
       @index = index
       @source_requirements = source_requirements
       @base = base
       @resolver = Molinillo::Resolver.new(self, self)
       @search_for = {}
       @base_dg = Molinillo::DependencyGraph.new
-      @base.each {|ls| @base_dg.add_vertex(ls.name, Dependency.new(ls.name, ls.version), true) }
+      @base.each do |ls|
+        dep = Dependency.new(ls.name, ls.version)
+        @base_dg.add_vertex(ls.name, DepProxy.new(dep, ls.platform), true)
+      end
       additional_base_requirements.each {|d| @base_dg.add_vertex(d.name, d) }
-      @ruby_version = ruby_version
+      @platforms = platforms
       @gem_version_promoter = gem_version_promoter
     end
 
     def start(requirements)
       verify_gemfile_dependencies_are_found!(requirements)
       dg = @resolver.resolve(requirements, @base_dg)
-      dg.map(&:payload).map(&:to_specs).flatten
+      dg.map(&:payload).
+        reject {|sg| sg.name.end_with?("\0") }.
+        map(&:to_specs).flatten
     rescue Molinillo::VersionConflict => e
       raise VersionConflict.new(e.conflicts.keys.uniq, e.message)
     rescue Molinillo::CircularDependencyError => e
@@ -224,11 +239,11 @@ module Bundler
 
     def debug?
       return @debug_mode if defined?(@debug_mode)
-      @debug_mode = ENV["DEBUG_RESOLVER"] || ENV["DEBUG_RESOLVER_TREE"]
+      @debug_mode = ENV["DEBUG_RESOLVER"] || ENV["DEBUG_RESOLVER_TREE"] || false
     end
 
     def before_resolution
-      Bundler.ui.info "Resolving dependencies...", false
+      Bundler.ui.info "Resolving dependencies...", debug?
     end
 
     def after_resolution
@@ -236,7 +251,7 @@ module Bundler
     end
 
     def indicate_progress
-      Bundler.ui.info ".", false
+      Bundler.ui.info ".", false unless debug?
     end
 
     include Molinillo::SpecificationProvider
@@ -279,7 +294,7 @@ module Bundler
           @gem_version_promoter.sort_versions(dependency, spec_groups)
         end
       end
-      search.select {|sg| sg.for?(platform, @ruby_version) }.each {|sg| sg.activate_platform!(platform) }
+      search.select {|sg| sg.for?(platform) }.each {|sg| sg.activate_platform!(platform) }
     end
 
     def index_for(dependency)
@@ -303,13 +318,16 @@ module Bundler
     end
 
     def requirement_satisfied_by?(requirement, activated, spec)
-      requirement.matches_spec?(spec) || spec.source.is_a?(Source::Gemspec)
+      return false unless requirement.matches_spec?(spec) || spec.source.is_a?(Source::Gemspec)
+      spec.activate_platform!(requirement.__platform) if !@platforms || @platforms.include?(requirement.__platform)
+      true
     end
 
     def sort_dependencies(dependencies, activated, conflicts)
       dependencies.sort_by do |dependency|
         name = name_for(dependency)
         [
+          @base_dg.vertex_named(name) ? 0 : 1,
           activated.vertex_named(name).payload ? 0 : 1,
           amount_constrained(dependency),
           conflicts[name] ? 0 : 1,
@@ -320,6 +338,12 @@ module Bundler
 
   private
 
+    # returns an integer \in (-\infty, 0]
+    # a number closer to 0 means the dependency is less constraining
+    #
+    # dependencies w/ 0 or 1 possibilities (ignoring version requirements)
+    # are given very negative values, so they _always_ sort first,
+    # before dependencies that are unconstrained
     def amount_constrained(dependency)
       @amount_constrained ||= {}
       @amount_constrained[dependency.name] ||= begin
@@ -327,8 +351,9 @@ module Bundler
           dependency.requirement.satisfied_by?(base.first.version) ? 0 : 1
         else
           all = index_for(dependency).search(dependency.name).size
+
           if all <= 1
-            all
+            all - 1_000_000
           else
             search = search_for(dependency).size
             search - all
@@ -360,8 +385,13 @@ module Bundler
                        "Source does not contain any versions of '#{requirement}'"
                      end
         else
+          cache_message = begin
+                            " or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
+                          rescue GemfileNotFound
+                            nil
+                          end
           message = "Could not find gem '#{requirement}' in any of the gem sources " \
-            "listed in your Gemfile or available on this machine."
+            "listed in your Gemfile#{cache_message}."
         end
         raise GemNotFound, message
       end
diff --git a/lib/bundler/retry.rb b/lib/bundler/retry.rb
index a7a72fe..092fb86 100644
--- a/lib/bundler/retry.rb
+++ b/lib/bundler/retry.rb
@@ -43,7 +43,10 @@ module Bundler
 
     def fail_attempt(e)
       @failed = true
-      raise e if last_attempt? || @exceptions.any? {|k| e.is_a?(k) }
+      if last_attempt? || @exceptions.any? {|k| e.is_a?(k) }
+        Bundler.ui.info "" unless Bundler.ui.debug?
+        raise e
+      end
       return true unless name
       Bundler.ui.info "" unless Bundler.ui.debug? # Add new line incase dots preceded this
       Bundler.ui.warn "Retrying #{name} due to error (#{current_run.next}/#{total_runs}): #{e.class} #{e.message}", Bundler.ui.debug?
diff --git a/lib/bundler/ruby_version.rb b/lib/bundler/ruby_version.rb
index 4ffc572..f0a001d 100644
--- a/lib/bundler/ruby_version.rb
+++ b/lib/bundler/ruby_version.rb
@@ -21,7 +21,11 @@ module Bundler
       #   must not be specified, or the engine version
       #   specified must match the version.
 
-      @versions           = Array(versions)
+      @versions = Array(versions).map do |v|
+        op, v = Gem::Requirement.parse(v)
+        op == "=" ? v.to_s : "#{op} #{v}"
+      end
+
       @gem_version        = Gem::Requirement.create(@versions.first).requirements.first.last
       @input_engine       = engine && engine.to_s
       @engine             = engine && engine.to_s || "ruby"
@@ -128,6 +132,11 @@ module Bundler
       end
     end
 
+    def exact?
+      return @exact if defined?(@exact)
+      @exact = versions.all? {|v| Gem::Requirement.create(v).exact? }
+    end
+
   private
 
     def matches?(requirements, version)
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index e9a7267..a0f8fa8 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -42,7 +42,11 @@ module Gem
     attr_writer :full_gem_path unless instance_methods.include?(:full_gem_path=)
 
     def full_gem_path
-      if source.respond_to?(:path) || source.is_a?(Bundler::Plugin::API::Source)
+      # this cannot check source.is_a?(Bundler::Plugin::API::Source)
+      # because that _could_ trip the autoload, and if there are unresolved
+      # gems at that time, this method could be called inside another require,
+      # thus raising with that constant being undefined. Better to check a method
+      if source.respond_to?(:path) || (source.respond_to?(:bundler_plugin_api_source?) && source.bundler_plugin_api_source?)
         Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.untaint
       else
         rg_full_gem_path
@@ -147,7 +151,7 @@ module Gem
 
     def to_lock
       out = String.new("  #{name}")
-      unless requirement == Gem::Requirement.default
+      unless requirement.none?
         reqs = requirement.requirements.map {|o, v| "#{o} #{v}" }.sort.reverse
         out << " (#{reqs.join(", ")})"
       end
@@ -165,10 +169,20 @@ module Gem
   end
 
   class Requirement
-    # Backport of performance enhancement added to Rubygems 1.4
+    # Backport of performance enhancement added to RubyGems 1.4
     def none?
-      @none ||= (to_s == ">= 0")
+      # note that it might be tempting to replace with with RubyGems 2.0's
+      # improved implementation. Don't. It requires `DefaultRequirement` to be
+      # defined, and more importantantly, these overrides are not used when the
+      # running RubyGems defines these methods
+      to_s == ">= 0"
     end unless allocate.respond_to?(:none?)
+
+    # Backport of performance enhancement added to RubyGems 2.2
+    def exact?
+      return false unless @requirements.size == 1
+      @requirements[0][0] == "="
+    end unless allocate.respond_to?(:exact?)
   end
 
   class Platform
diff --git a/lib/bundler/rubygems_gem_installer.rb b/lib/bundler/rubygems_gem_installer.rb
index e18f462..977e13d 100644
--- a/lib/bundler/rubygems_gem_installer.rb
+++ b/lib/bundler/rubygems_gem_installer.rb
@@ -12,5 +12,65 @@ module Bundler
     def check_executable_overwrite(filename)
       # Bundler needs to install gems regardless of binstub overwriting
     end
+
+    def pre_install_checks
+      super && validate_bundler_checksum(options[:bundler_expected_checksum])
+    end
+
+  private
+
+    def validate_bundler_checksum(checksum)
+      return true if Bundler.settings[:disable_checksum_validation]
+      return true unless checksum
+      return true unless source = @package.instance_variable_get(:@gem)
+      return true unless source.respond_to?(:with_read_io)
+      digest = source.with_read_io do |io|
+        digest = Digest::SHA256.new
+        digest << io.read(16_384) until io.eof?
+        io.rewind
+        send(checksum_type(checksum), digest)
+      end
+      unless digest == checksum
+        raise SecurityError, <<-MESSAGE
+          Bundler cannot continue installing #{spec.name} (#{spec.version}).
+          The checksum for the downloaded `#{spec.full_name}.gem` does not match \
+          the checksum given by the server. This means the contents of the downloaded \
+          gem is different from what was uploaded to the server, and could be a potential security issue.
+
+          To resolve this issue:
+          1. delete the downloaded gem located at: `#{spec.gem_dir}/#{spec.full_name}.gem`
+          2. run `bundle install`
+
+          If you wish to continue installing the downloaded gem, and are certain it does not pose a \
+          security issue despite the mismatching checksum, do the following:
+          1. run `bundle config disable_checksum_validation true` to turn off checksum verification
+          2. run `bundle install`
+
+          (More info: The expected SHA256 checksum was #{checksum.inspect}, but the \
+          checksum for the downloaded gem was #{digest.inspect}.)
+          MESSAGE
+      end
+      true
+    end
+
+    def checksum_type(checksum)
+      case checksum.length
+      when 64 then :hexdigest!
+      when 44 then :base64digest!
+      else raise InstallError, "The given checksum for #{spec.full_name} (#{checksum.inspect}) is not a valid SHA256 hexdigest nor base64digest"
+      end
+    end
+
+    def hexdigest!(digest)
+      digest.hexdigest!
+    end
+
+    def base64digest!(digest)
+      if digest.respond_to?(:base64digest!)
+        digest.base64digest!
+      else
+        [digest.digest!].pack("m0")
+      end
+    end
   end
 end
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index 3f96c6e..e33ae41 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -71,8 +71,21 @@ module Bundler
       spec.installed_by_version = Gem::Version.create(installed_by_version)
     end
 
-    def spec_missing_extensions?(spec)
-      !spec.respond_to?(:missing_extensions?) || spec.missing_extensions?
+    def spec_missing_extensions?(spec, default = true)
+      return spec.missing_extensions? if spec.respond_to?(:missing_extensions?)
+
+      return false if spec_default_gem?(spec)
+      return false if spec.extensions.empty?
+
+      default
+    end
+
+    def spec_default_gem?(spec)
+      spec.respond_to?(:default_gem?) && spec.default_gem?
+    end
+
+    def stub_set_spec(stub, spec)
+      stub.instance_variable_set(:@spec, spec)
     end
 
     def path(obj)
@@ -80,6 +93,7 @@ module Bundler
     end
 
     def platforms
+      return [Gem::Platform::RUBY] if Bundler.settings[:force_ruby_platform]
       Gem.platforms
     end
 
@@ -194,6 +208,10 @@ module Bundler
       end
     end
 
+    def load_plugins
+      Gem.load_plugins if Gem.respond_to?(:load_plugins)
+    end
+
     def ui=(obj)
       Gem::DefaultUserInteraction.ui = obj
     end
@@ -203,6 +221,7 @@ module Bundler
     end
 
     def fetch_specs(all, pre, &blk)
+      require "rubygems/spec_fetcher"
       specs = Gem::SpecFetcher.new.list(all, pre)
       specs.each { yield } if block_given?
       specs
@@ -243,6 +262,10 @@ module Bundler
       end
     end
 
+    def install_with_build_args(args)
+      with_build_args(args) { yield }
+    end
+
     def gem_from_path(path, policy = nil)
       require "rubygems/format"
       Gem::Format.from_file_by_path(path, policy)
@@ -305,48 +328,53 @@ module Bundler
       end
     end
 
-    def replace_gem(specs)
+    def binstubs_call_gem?
+      true
+    end
+
+    def stubs_provide_full_functionality?
+      false
+    end
+
+    def replace_gem(specs, specs_by_name)
       reverse_rubygems_kernel_mixin
 
-      executables = specs.map(&:executables).flatten
+      executables = nil
 
       kernel = (class << ::Kernel; self; end)
       [kernel, ::Kernel].each do |kernel_class|
         redefine_method(kernel_class, :gem) do |dep, *reqs|
-          if executables.include? File.basename(caller.first.split(":").first)
+          executables ||= specs.map(&:executables).flatten if ::Bundler.rubygems.binstubs_call_gem?
+          if executables && executables.include?(File.basename(caller.first.split(":").first))
             break
           end
+
           reqs.pop if reqs.last.is_a?(Hash)
 
           unless dep.respond_to?(:name) && dep.respond_to?(:requirement)
             dep = Gem::Dependency.new(dep, reqs)
           end
 
-          spec = specs.find {|s| s.name == dep.name }
-
-          if spec.nil?
-
-            e = Gem::LoadError.new "#{dep.name} is not part of the bundle. Add it to Gemfile."
-            e.name = dep.name
-            if e.respond_to?(:requirement=)
-              e.requirement = dep.requirement
-            else
-              e.version_requirement = dep.requirement
-            end
-            raise e
-          elsif dep !~ spec
-            e = Gem::LoadError.new "can't activate #{dep}, already activated #{spec.full_name}. " \
-                                   "Make sure all dependencies are added to Gemfile."
-            e.name = dep.name
-            if e.respond_to?(:requirement=)
-              e.requirement = dep.requirement
-            else
-              e.version_requirement = dep.requirement
-            end
-            raise e
+          if spec = specs_by_name[dep.name]
+            return true if dep.matches_spec?(spec)
           end
 
-          true
+          message = if spec.nil?
+            "#{dep.name} is not part of the bundle." \
+            " Add it to your #{Bundler.default_gemfile.basename}."
+          else
+            "can't activate #{dep}, already activated #{spec.full_name}. " \
+            "Make sure all dependencies are added to Gemfile."
+          end
+
+          e = Gem::LoadError.new(message)
+          e.name = dep.name
+          if e.respond_to?(:requirement=)
+            e.requirement = dep.requirement
+          elsif e.respond_to?(:version_requirement=)
+            e.version_requirement = dep.requirement
+          end
+          raise e
         end
 
         # TODO: delete this in 2.0, it's a backwards compatibility shim
@@ -378,20 +406,34 @@ module Bundler
     # Used to make bin stubs that are not created by bundler work
     # under bundler. The new Gem.bin_path only considers gems in
     # +specs+
-    def replace_bin_path(specs)
+    def replace_bin_path(specs, specs_by_name)
       gem_class = (class << Gem; self; end)
 
       redefine_method(gem_class, :find_spec_for_exe) do |gem_name, *args|
         exec_name = args.first
 
+        spec_with_name = specs_by_name[gem_name]
         spec = if exec_name
-          specs.find {|s| s.name == gem_name && s.executables.include?(exec_name) } ||
+          if spec_with_name && spec_with_name.executables.include?(exec_name)
+            spec_with_name
+          else
             specs.find {|s| s.executables.include?(exec_name) }
+          end
         else
-          specs.find {|s| s.name == gem_name }
+          spec_with_name
+        end
+
+        unless spec
+          message = "can't find executable #{exec_name} for gem #{gem_name}"
+          if !exec_name || spec_with_name.nil?
+            message += ". #{gem_name} is not currently included in the bundle, " \
+                       "perhaps you meant to add it to your #{Bundler.default_gemfile.basename}?"
+          end
+          raise Gem::Exception, message
         end
-        raise(Gem::Exception, "can't find executable #{exec_name}") unless spec
+
         raise Gem::Exception, "no default executable for #{spec.full_name}" unless exec_name ||= spec.default_executable
+
         unless spec.name == name
           Bundler::SharedHelpers.major_deprecation \
             "Bundler is using a binstub that was created for a different gem.\n" \
@@ -408,8 +450,10 @@ module Bundler
         # Copy of Rubygems activate_bin_path impl
         requirement = args.last
         spec = find_spec_for_exe name, exec_name, [requirement]
-        Gem::LOADED_SPECS_MUTEX.synchronize { spec.activate }
-        spec.bin_file exec_name
+
+        gem_bin = File.join(spec.full_gem_path, spec.bindir, exec_name)
+        gem_from_path_bin = File.join(File.dirname(spec.loaded_from), spec.bindir, exec_name)
+        File.exist?(gem_bin) ? gem_bin : gem_from_path_bin
       end
 
       redefine_method(gem_class, :bin_path) do |name, *args|
@@ -435,11 +479,14 @@ module Bundler
     # Replace or hook into Rubygems to provide a bundlerized view
     # of the world.
     def replace_entrypoints(specs)
-      replace_gem(specs)
+      specs_by_name = specs.reduce({}) do |h, s|
+        h[s.name] = s
+        h
+      end
 
+      replace_gem(specs, specs_by_name)
       stub_rubygems(specs)
-
-      replace_bin_path(specs)
+      replace_bin_path(specs, specs_by_name)
       replace_refresh
 
       Gem.clear_paths
@@ -651,6 +698,10 @@ module Bundler
         Gem.post_reset do
           Gem::Specification.all = specs
         end
+
+        redefine_method((class << Gem; self; end), :finish_resolve) do |*|
+          []
+        end
       end
 
       def all_specs
@@ -710,6 +761,10 @@ module Bundler
       def repository_subdirectories
         Gem::REPOSITORY_SUBDIRECTORIES
       end
+
+      def install_with_build_args(args)
+        yield
+      end
     end
 
     # RubyGems 2.1.0
@@ -727,7 +782,13 @@ module Bundler
       end
 
       def backport_ext_builder_monitor
-        require "rubygems/ext"
+        # So we can avoid requiring "rubygems/ext" in its entirety
+        Gem.module_eval <<-RB, __FILE__, __LINE__ + 1
+          module Ext
+          end
+        RB
+
+        require "rubygems/ext/builder"
 
         Gem::Ext::Builder.class_eval do
           unless const_defined?(:CHDIR_MONITOR)
@@ -750,6 +811,29 @@ module Bundler
           end.map(&:to_spec)
         end
       end
+
+      def use_gemdeps(gemfile)
+        ENV["BUNDLE_GEMFILE"] ||= File.expand_path(gemfile)
+        runtime = Bundler.setup
+        Bundler.ui = nil
+        activated_spec_names = runtime.requested_specs.map(&:to_spec).sort_by(&:name)
+        [Gemdeps.new(runtime), activated_spec_names]
+      end
+
+      if provides?(">= 2.5.2")
+        # RubyGems-generated binstubs call Kernel#gem
+        def binstubs_call_gem?
+          false
+        end
+
+        # only 2.5.2+ has all of the stub methods we want to use, and since this
+        # is a performance optimization _only_,
+        # we'll restrict ourselves to the most
+        # recent RG versions instead of all versions that have stubs
+        def stubs_provide_full_functionality?
+          true
+        end
+      end
     end
   end
 
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb
index fda499c..5540509 100644
--- a/lib/bundler/runtime.rb
+++ b/lib/bundler/runtime.rb
@@ -11,6 +11,8 @@ module Bundler
     end
 
     def setup(*groups)
+      @definition.ensure_equivalent_gemfile_and_lockfile if Bundler.settings[:frozen]
+
       groups.map!(&:to_sym)
 
       # Has to happen first
@@ -24,21 +26,10 @@ module Bundler
       # Activate the specs
       load_paths = specs.map do |spec|
         unless spec.loaded_from
-          raise GemNotFound, "#{spec.full_name} is missing. Run `bundle` to get it."
+          raise GemNotFound, "#{spec.full_name} is missing. Run `bundle install` to get it."
         end
 
-        if (activated_spec = Bundler.rubygems.loaded_specs(spec.name)) && activated_spec.version != spec.version
-          e = Gem::LoadError.new "You have already activated #{activated_spec.name} #{activated_spec.version}, " \
-                                 "but your Gemfile requires #{spec.name} #{spec.version}. Prepending " \
-                                 "`bundle exec` to your command may solve this."
-          e.name = spec.name
-          if e.respond_to?(:requirement=)
-            e.requirement = Gem::Requirement.new(spec.version.to_s)
-          else
-            e.version_requirement = Gem::Requirement.new(spec.version.to_s)
-          end
-          raise e
-        end
+        check_for_activated_spec!(spec)
 
         Bundler.rubygems.mark_loaded(spec)
         spec.load_paths.reject {|path| $LOAD_PATH.include?(path) }
@@ -127,6 +118,7 @@ module Bundler
     definition_method :requires
 
     def lock(opts = {})
+      return if @definition.nothing_changed? && !@definition.unlocking?
       @definition.lock(Bundler.default_lockfile, opts[:preserve_unknown_sections])
     end
 
@@ -140,7 +132,8 @@ module Bundler
 
       Bundler.ui.info "Updating files in #{Bundler.settings.app_cache_path}"
 
-      specs.each do |spec|
+      specs_to_cache = Bundler.settings[:cache_all_platforms] ? @definition.resolve.materialized_for_all_platforms : specs
+      specs_to_cache.each do |spec|
         next if spec.name == "bundler"
         next if spec.source.is_a?(Source::Gemspec)
         spec.source.send(:fetch_gem, spec) if Bundler.settings[:cache_all_platforms] && spec.source.respond_to?(:fetch_gem, true)
@@ -301,5 +294,27 @@ module Bundler
 
       output
     end
+
+    def check_for_activated_spec!(spec)
+      return unless activated_spec = Bundler.rubygems.loaded_specs(spec.name)
+      return if activated_spec.version == spec.version
+
+      suggestion = if Bundler.rubygems.spec_default_gem?(activated_spec)
+        "Since #{spec.name} is a default gem, you can either remove your dependency on it" \
+        " or try updating to a newer version of bundler that supports #{spec.name} as a default gem."
+      else
+        "Prepending `bundle exec` to your command may solve this."
+      end
+
+      e = Gem::LoadError.new "You have already activated #{activated_spec.name} #{activated_spec.version}, " \
+                             "but your Gemfile requires #{spec.name} #{spec.version}. #{suggestion}"
+      e.name = spec.name
+      if e.respond_to?(:requirement=)
+        e.requirement = Gem::Requirement.new(spec.version.to_s)
+      else
+        e.version_requirement = Gem::Requirement.new(spec.version.to_s)
+      end
+      raise e
+    end
   end
 end
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index 0159406..7339f72 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -3,13 +3,20 @@ require "uri"
 
 module Bundler
   class Settings
+    autoload :Mirror,  "bundler/mirror"
+    autoload :Mirrors, "bundler/mirror"
+
     BOOL_KEYS = %w(
       allow_offline_install
       auto_install
       cache_all
+      cache_all_platforms
+      disable_checksum_validation
       disable_exec_load
       disable_local_branch_check
       disable_shared_gems
+      disable_version_check
+      force_ruby_platform
       frozen
       gem.coc
       gem.mit
@@ -42,11 +49,18 @@ module Bundler
       @local_config    = load_config(local_config_file)
       @global_config   = load_config(global_config_file)
       @cli_flags_given = false
+      @temporary       = {}
     end
 
     def [](name)
       key = key_for(name)
-      value = (@local_config[key] || ENV[key] || @global_config[key] || DEFAULT_CONFIG[name])
+      value = @temporary.fetch(name) do
+              @local_config.fetch(key) do
+              ENV.fetch(key) do
+              @global_config.fetch(key) do
+              DEFAULT_CONFIG.fetch(name) do
+                nil
+              end end end end end
 
       if value.nil?
         nil
@@ -76,9 +90,19 @@ module Bundler
       local_config_file || raise(GemfileNotFound, "Could not locate Gemfile")
       set_key(key, value, @local_config, local_config_file)
     end
-
     alias_method :set_local, :[]=
 
+    def temporary(update)
+      existing = Hash[update.map {|k, _| [k, @temporary[k]] }]
+      @temporary.update(update)
+      return unless block_given?
+      begin
+        yield
+      ensure
+        existing.each {|k, v| v.nil? ? @temporary.delete(k) : @temporary[k] = v }
+      end
+    end
+
     def delete(key)
       @local_config.delete(key_for(key))
     end
@@ -221,7 +245,12 @@ module Bundler
     end
 
     def to_bool(value)
-      !(value.nil? || value == "" || value =~ /^(false|f|no|n|0)$/i || value == false)
+      case value
+      when nil, /\A(false|f|no|n|0|)\z/i, false
+        false
+      else
+        true
+      end
     end
 
     def is_num(value)
@@ -256,7 +285,11 @@ module Bundler
       if ENV["BUNDLE_CONFIG"] && !ENV["BUNDLE_CONFIG"].empty?
         Pathname.new(ENV["BUNDLE_CONFIG"])
       else
-        Bundler.user_bundle_path.join("config")
+        begin
+          Bundler.user_bundle_path.join("config")
+        rescue PermissionError, GenericSystemCallError
+          nil
+        end
       end
     end
 
@@ -279,10 +312,10 @@ module Bundler
     }xo
 
     def load_config(config_file)
-      return {} unless config_file
+      return {} if !config_file || ignore_config?
       SharedHelpers.filesystem_access(config_file, :read) do |file|
         valid_file = file.exist? && !file.size.zero?
-        return {} if ignore_config? || !valid_file
+        return {} unless valid_file
         require "bundler/yaml_serializer"
         YAMLSerializer.load file.read
       end
diff --git a/lib/bundler/setup.rb b/lib/bundler/setup.rb
index 8b4b479..eb816b9 100644
--- a/lib/bundler/setup.rb
+++ b/lib/bundler/setup.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
-require "bundler/postit_trampoline" unless ENV["BUNDLE_DISABLE_POSTIT"]
+require "bundler/postit_trampoline"
 require "bundler/shared_helpers"
 
 if Bundler::SharedHelpers.in_bundle?
@@ -22,7 +22,7 @@ if Bundler::SharedHelpers.in_bundle?
 
   unless ENV["BUNDLE_POSTIT_TRAMPOLINING_VERSION"]
     # Add bundler to the load path after disabling system gems
-    # This is guarenteed to be done already if we've trampolined
+    # This is guaranteed to be done already if we've trampolined
     bundler_lib = File.expand_path("../..", __FILE__)
     $LOAD_PATH.unshift(bundler_lib) unless $LOAD_PATH.include?(bundler_lib)
   end
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index 6954335..74700cd 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -8,6 +8,7 @@ require "bundler/current_ruby"
 
 module Gem
   class Dependency
+    # This is only needed for RubyGems < 1.4
     unless method_defined? :requirement
       def requirement
         version_requirements
@@ -18,8 +19,6 @@ end
 
 module Bundler
   module SharedHelpers
-    attr_accessor :gem_loaded
-
     def default_gemfile
       gemfile = find_gemfile
       raise GemfileNotFound, "Could not locate Gemfile" unless gemfile
@@ -39,10 +38,12 @@ module Bundler
       bundle_dir = find_directory(".bundle")
       return nil unless bundle_dir
 
-      global_bundle_dir = File.join(Bundler.rubygems.user_home, ".bundle")
+      bundle_dir = Pathname.new(bundle_dir)
+
+      global_bundle_dir = Bundler.user_home.join(".bundle")
       return nil if bundle_dir == global_bundle_dir
 
-      Pathname.new(bundle_dir)
+      bundle_dir
     end
 
     def in_bundle?
@@ -101,16 +102,24 @@ module Bundler
     #   end
     #
     # @see {Bundler::PermissionError}
-    def filesystem_access(path, action = :write)
-      yield path.dup.untaint
+    def filesystem_access(path, action = :write, &block)
+      # Use block.call instead of yield because of a bug in Ruby 2.2.2
+      # See https://github.com/bundler/bundler/issues/5341 for details
+      block.call(path.dup.untaint)
     rescue Errno::EACCES
       raise PermissionError.new(path, action)
     rescue Errno::EAGAIN
       raise TemporaryResourceError.new(path, action)
     rescue Errno::EPROTO
       raise VirtualProtocolError.new
+    rescue Errno::ENOSPC
+      raise NoSpaceOnDeviceError.new(path, action)
     rescue *[const_get_safely(:ENOTSUP, Errno)].compact
       raise OperationNotSupportedError.new(path, action)
+    rescue Errno::EEXIST, Errno::ENOENT
+      raise
+    rescue SystemCallError => e
+      raise GenericSystemCallError.new(e, "There was an error accessing `#{path}`.")
     end
 
     def const_get_safely(constant_name, namespace)
@@ -136,6 +145,31 @@ module Bundler
       major_deprecation("Bundler will only support rubygems >= 2.0, you are running #{Bundler.rubygems.version}")
     end
 
+    def trap(signal, override = false, &block)
+      prior = Signal.trap(signal) do
+        block.call
+        prior.call unless override
+      end
+    end
+
+    def ensure_same_dependencies(spec, old_deps, new_deps)
+      new_deps = new_deps.reject {|d| d.type == :development }
+      old_deps = old_deps.reject {|d| d.type == :development }
+
+      without_type = proc {|d| Gem::Dependency.new(d.name, d.requirements_list.sort) }
+      new_deps.map!(&without_type)
+      old_deps.map!(&without_type)
+
+      extra_deps = new_deps - old_deps
+      return if extra_deps.empty?
+
+      Bundler.ui.debug "#{spec.full_name} from #{spec.remote} has either corrupted API or lockfile dependencies" \
+        " (was expecting #{old_deps.map(&:to_s)}, but the real spec has #{new_deps.map(&:to_s)})"
+      raise APIResponseMismatchError,
+        "Downloading #{spec.full_name} revealed dependencies not in the API or the lockfile (#{extra_deps.join(", ")})." \
+        "\nEither installing with `--full-index` or running `bundle update #{spec.name}` should fix the problem."
+    end
+
   private
 
     def find_gemfile
@@ -202,29 +236,33 @@ module Bundler
 
     def set_rubylib
       rubylib = (ENV["RUBYLIB"] || "").split(File::PATH_SEPARATOR)
-      rubylib.unshift File.expand_path("../..", __FILE__)
+      rubylib.unshift bundler_ruby_lib
       ENV["RUBYLIB"] = rubylib.uniq.join(File::PATH_SEPARATOR)
     end
 
+    def bundler_ruby_lib
+      File.expand_path("../..", __FILE__)
+    end
+
     def clean_load_path
       # handle 1.9 where system gems are always on the load path
-      if defined?(::Gem)
-        me = File.expand_path("../../", __FILE__)
-        me = /^#{Regexp.escape(me)}/
+      return unless defined?(::Gem)
 
-        loaded_gem_paths = Bundler.rubygems.loaded_gem_paths
+      bundler_lib = bundler_ruby_lib
 
-        $LOAD_PATH.reject! do |p|
-          next if File.expand_path(p) =~ me
-          loaded_gem_paths.delete(p)
-        end
-        $LOAD_PATH.uniq!
+      loaded_gem_paths = Bundler.rubygems.loaded_gem_paths
+
+      $LOAD_PATH.reject! do |p|
+        next if File.expand_path(p).start_with?(bundler_lib)
+        loaded_gem_paths.delete(p)
       end
+      $LOAD_PATH.uniq!
     end
 
     def prints_major_deprecations?
       require "bundler"
-      return false unless Bundler.settings[:major_deprecations]
+      deprecation_release = Bundler::VERSION.split(".").drop(1).include?("99")
+      return false if !deprecation_release && !Bundler.settings[:major_deprecations]
       require "bundler/deprecate"
       return false if Bundler::Deprecate.skip
       true
@@ -233,7 +271,7 @@ module Bundler
     def deprecate_gemfile(gemfile)
       return unless gemfile && File.basename(gemfile) == "Gemfile"
       Bundler::SharedHelpers.major_deprecation \
-        "gems.rb and gems.locked will be prefered to Gemfile and Gemfile.lock."
+        "gems.rb and gems.locked will be preferred to Gemfile and Gemfile.lock."
     end
 
     extend self
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index 08c1e6f..cf56ed1 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -14,12 +14,13 @@ module Bundler
 
     def version_message(spec)
       message = "#{spec.name} #{spec.version}"
+      message += " (#{spec.platform})" if spec.platform != Gem::Platform::RUBY && !spec.platform.nil?
 
       if Bundler.locked_gems
         locked_spec = Bundler.locked_gems.specs.find {|s| s.name == spec.name }
         locked_spec_version = locked_spec.version if locked_spec
         if locked_spec_version && spec.version != locked_spec_version
-          message += Bundler.ui.add_color(" (was #{locked_spec_version})", :green)
+          message += Bundler.ui.add_color(" (was #{locked_spec_version})", version_color(spec.version, locked_spec_version))
         end
       end
 
@@ -33,5 +34,25 @@ module Bundler
     def include?(other)
       other == self
     end
+
+    def inspect
+      "#<#{self.class}:0x#{object_id} #{self}>"
+    end
+
+  private
+
+    def version_color(spec_version, locked_spec_version)
+      if Gem::Version.correct?(spec_version) && Gem::Version.correct?(locked_spec_version)
+        # display yellow if there appears to be a regression
+        earlier_version?(spec_version, locked_spec_version) ? :yellow : :green
+      else
+        # default to green if the versions cannot be directly compared
+        :green
+      end
+    end
+
+    def earlier_version?(spec_version, locked_spec_version)
+      Gem::Version.new(spec_version) < Gem::Version.new(locked_spec_version)
+    end
   end
 end
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
index 60fb555..b3e218e 100644
--- a/lib/bundler/source/git.rb
+++ b/lib/bundler/source/git.rb
@@ -61,8 +61,12 @@ module Bundler
       def to_s
         at = if local?
           path
-        elsif options["ref"]
-          shortref_for_display(options["ref"])
+        elsif user_ref = options["ref"]
+          if ref =~ /\A[a-z0-9]{4,}\z/i
+            shortref_for_display(user_ref)
+          else
+            user_ref
+          end
         else
           ref
         end
@@ -105,6 +109,8 @@ module Bundler
 
       def unlock!
         git_proxy.revision = nil
+        options["revision"] = nil
+
         @unlocked = true
       end
 
@@ -147,7 +153,6 @@ module Bundler
         changed
       end
 
-      # TODO: cache git specs
       def specs(*)
         set_local!(app_cache_path) if has_app_cache? && !local?
 
@@ -161,7 +166,9 @@ module Bundler
         local_specs
       end
 
-      def install(spec, force = false)
+      def install(spec, options = {})
+        force = options[:force]
+
         Bundler.ui.info "Using #{version_message(spec)} from #{self}"
 
         if requires_checkout? && !@copied && !force
@@ -169,8 +176,12 @@ module Bundler
           git_proxy.copy_to(install_path, submodules)
           serialize_gemspecs_in(install_path)
           @copied = true
+        elsif force
+          git_proxy.copy_to(install_path, submodules)
         end
-        generate_bin(spec, !Bundler.rubygems.spec_missing_extensions?(spec))
+
+        generate_bin_options = { :disable_extensions => !Bundler.rubygems.spec_missing_extensions?(spec), :build_args => options[:build_args] }
+        generate_bin(spec, generate_bin_options)
 
         requires_checkout? ? spec.post_install_message : nil
       end
@@ -231,6 +242,8 @@ module Bundler
           # The gemspecs we cache should already be evaluated.
           spec = Bundler.load_gemspec(spec_path)
           next unless spec
+          Bundler.rubygems.set_installed_by_version(spec)
+          Bundler.rubygems.validate(spec)
           File.open(spec_path, "wb") {|file| file.write(spec.to_ruby) }
         end
       end
@@ -292,9 +305,20 @@ module Bundler
       def fetch
         git_proxy.checkout
       rescue GitError
-        raise unless Bundler.settings[:allow_offline_install]
+        raise unless Bundler.feature_flag.allow_offline_install?
         Bundler.ui.warn "Using cached git data because of network errors"
       end
+
+      # no-op, since we validate when re-serializing the gemspec
+      def validate_spec(_spec); end
+
+      if Bundler.rubygems.stubs_provide_full_functionality?
+        def load_gemspec(file)
+          stub = Gem::StubSpecification.gemspec_stub(file, install_path.parent, install_path.parent)
+          stub.full_gem_path = Pathname.new(file).dirname.expand_path(root).to_s.untaint
+          StubSpecification.from_stub(stub)
+        end
+      end
     end
   end
 end
diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb
index 4b76d18..c05d7a5 100644
--- a/lib/bundler/source/git/git_proxy.rb
+++ b/lib/bundler/source/git/git_proxy.rb
@@ -1,8 +1,9 @@
 # frozen_string_literal: true
+require "shellwords"
 require "tempfile"
 module Bundler
   class Source
-    class Git < Path
+    class Git
       class GitNotInstalledError < GitError
         def initialize
           msg = String.new
@@ -131,7 +132,7 @@ module Bundler
             if submodules
               git_retry "submodule update --init --recursive"
             elsif Gem::Version.create(version) >= Gem::Version.create("2.9.0")
-              git_retry "submodule deinit --all"
+              git_retry "submodule deinit --all --force"
             end
           end
         end
@@ -180,7 +181,7 @@ module Bundler
 
         def find_local_revision
           allowed_in_path do
-            git("rev-parse --verify #{ref}", true).strip
+            git("rev-parse --verify #{Shellwords.shellescape(ref)}", true).strip
           end
         end
 
@@ -224,6 +225,11 @@ module Bundler
           raise GitError, "The git source #{uri} is not yet checked out. Please run `bundle install` before trying to start your application"
         end
 
+        # TODO: Replace this with Open3 when upgrading to bundler 2
+        # Similar to #git_null, as Open3 is not cross-platform,
+        # a temporary way is to use Tempfile to capture the stderr.
+        # When replacing this using Open3, make sure git_null is
+        # also replaced by Open3, so stdout and stderr all got handled properly.
         def capture_and_filter_stderr(uri)
           return_value, captured_err = ""
           backup_stderr = STDERR.dup
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
index 69bb0c1..0ad0a02 100644
--- a/lib/bundler/source/path.rb
+++ b/lib/bundler/source/path.rb
@@ -4,10 +4,12 @@ module Bundler
     class Path < Source
       autoload :Installer, "bundler/source/path/installer"
 
-      attr_reader :path, :options, :root_path
+      attr_reader :path, :options, :root_path, :original_path
       attr_writer :name
       attr_accessor :version
 
+      protected :original_path
+
       DEFAULT_GLOB = "{,*,*/*}.gemspec".freeze
 
       def initialize(options)
@@ -46,7 +48,7 @@ module Bundler
 
       def to_lock
         out = String.new("PATH\n")
-        out << "  remote: #{relative_path}\n"
+        out << "  remote: #{lockfile_path}\n"
         out << "  glob: #{@glob}\n" unless @glob == DEFAULT_GLOB
         out << "  specs:\n"
       end
@@ -61,7 +63,7 @@ module Bundler
 
       def eql?(other)
         return unless other.class == self.class
-        expanded_path == expand(other.path) &&
+        expand(@original_path) == expand(other.original_path) &&
           version == other.version
       end
 
@@ -71,9 +73,9 @@ module Bundler
         File.basename(expanded_path.to_s)
       end
 
-      def install(spec, force = false)
+      def install(spec, options = {})
         Bundler.ui.info "Using #{version_message(spec)} from #{self}"
-        generate_bin(spec, :disable_extensions)
+        generate_bin(spec, :disable_extensions => true)
         nil # no post-install message
       end
 
@@ -129,6 +131,11 @@ module Bundler
           "`#{somepath}`.\nThe error message was: #{e.message}."
       end
 
+      def lockfile_path
+        return relative_path(original_path) if original_path.absolute?
+        expand(original_path).relative_path_from(Bundler.root)
+      end
+
       def app_cache_path(custom_path = nil)
         @app_cache_path ||= Bundler.app_cache(custom_path).join(app_cache_dirname)
       end
@@ -137,18 +144,28 @@ module Bundler
         SharedHelpers.in_bundle? && app_cache_path.exist?
       end
 
+      def load_gemspec(file)
+        return unless spec = Bundler.load_gemspec(file)
+        Bundler.rubygems.set_installed_by_version(spec)
+        spec
+      end
+
+      def validate_spec(spec)
+        Bundler.rubygems.validate(spec)
+      end
+
       def load_spec_files
         index = Index.new
 
         if File.directory?(expanded_path)
           # We sort depth-first since `<<` will override the earlier-found specs
           Dir["#{expanded_path}/#{@glob}"].sort_by {|p| -p.split(File::SEPARATOR).size }.each do |file|
-            next unless spec = Bundler.load_gemspec(file)
+            next unless spec = load_gemspec(file)
             spec.source = self
-            Bundler.rubygems.set_installed_by_version(spec)
+
             # Validation causes extension_dir to be calculated, which depends
             # on #source, so we validate here instead of load_gemspec
-            Bundler.rubygems.validate(spec)
+            validate_spec(spec)
             index << spec
           end
 
@@ -181,14 +198,14 @@ module Bundler
         index
       end
 
-      def relative_path
+      def relative_path(path = self.path)
         if path.to_s.start_with?(root_path.to_s)
           return path.relative_path_from(root_path)
         end
         path
       end
 
-      def generate_bin(spec, disable_extensions = false)
+      def generate_bin(spec, options = {})
         gem_dir = Pathname.new(spec.full_gem_path)
 
         # Some gem authors put absolute paths in their gemspec
@@ -203,7 +220,12 @@ module Bundler
           end
         end.compact
 
-        installer = Path::Installer.new(spec, :env_shebang => false, :disable_extensions => disable_extensions)
+        installer = Path::Installer.new(
+          spec,
+          :env_shebang => false,
+          :disable_extensions => options[:disable_extensions],
+          :build_args => options[:build_args]
+        )
         installer.post_install
       rescue Gem::InvalidSpecificationException => e
         Bundler.ui.warn "\n#{spec.name} at #{spec.full_gem_path} did not have a valid gemspec.\n" \
diff --git a/lib/bundler/source/path/installer.rb b/lib/bundler/source/path/installer.rb
index abc46d5..9c2f74a 100644
--- a/lib/bundler/source/path/installer.rb
+++ b/lib/bundler/source/path/installer.rb
@@ -13,7 +13,7 @@ module Bundler
           @format_executable  = options[:format_executable] || false
           @build_args         = options[:build_args] || Bundler.rubygems.build_args
           @gem_bin_dir        = "#{Bundler.rubygems.gem_dir}/bin"
-          @disable_extentions = options[:disable_extensions]
+          @disable_extensions = options[:disable_extensions]
 
           if Bundler.requires_sudo?
             @tmp_dir = Bundler.tmp(spec.full_name).to_s
@@ -27,7 +27,7 @@ module Bundler
           SharedHelpers.chdir(@gem_dir) do
             run_hooks(:pre_install)
 
-            unless @disable_extentions
+            unless @disable_extensions
               build_extensions
               run_hooks(:post_build)
             end
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index aedad70..353194f 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -1,7 +1,6 @@
 # frozen_string_literal: true
 require "uri"
 require "rubygems/user_interaction"
-require "rubygems/spec_fetcher"
 
 module Bundler
   class Source
@@ -140,7 +139,9 @@ module Bundler
               :bin_dir             => bin_path.to_s,
               :ignore_dependencies => true,
               :wrappers            => true,
-              :env_shebang         => true
+              :env_shebang         => true,
+              :build_args          => opts[:build_args],
+              :bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum
             ).install
           end
           spec.full_gem_path = installed_spec.full_gem_path
@@ -288,9 +289,15 @@ module Bundler
           idx = Index.new
           have_bundler = false
           Bundler.rubygems.all_specs.reverse_each do |spec|
-            next if spec.name == "bundler" && spec.version.to_s != VERSION
-            have_bundler = true if spec.name == "bundler"
+            if spec.name == "bundler"
+              next unless spec.version.to_s == VERSION
+              have_bundler = true
+            end
             spec.source = self
+            if Bundler.rubygems.spec_missing_extensions?(spec, false)
+              Bundler.ui.debug "Source #{self} is ignoring #{spec} because it is missing extensions"
+              next
+            end
             idx << spec
           end
 
@@ -321,6 +328,10 @@ module Bundler
             next if gemfile =~ /^bundler\-[\d\.]+?\.gem/
             s ||= Bundler.rubygems.spec_from_gem(gemfile)
             s.source = self
+            if Bundler.rubygems.spec_missing_extensions?(s, false)
+              Bundler.ui.debug "Source #{self} is ignoring #{s} because it is missing extensions"
+              next
+            end
             idx << s
           end
         end
@@ -401,6 +412,7 @@ module Bundler
         return false unless spec.remote
         uri = spec.remote.uri
         spec.fetch_platform
+        Bundler.ui.confirm("Fetching #{version_message(spec)}")
 
         download_path = requires_sudo? ? Bundler.tmp(spec.full_name) : rubygems_dir
         gem_path = "#{rubygems_dir}/cache/#{spec.full_name}.gem"
diff --git a/lib/bundler/source/rubygems/remote.rb b/lib/bundler/source/rubygems/remote.rb
index 92f8a40..b49e645 100644
--- a/lib/bundler/source/rubygems/remote.rb
+++ b/lib/bundler/source/rubygems/remote.rb
@@ -30,6 +30,10 @@ module Bundler
           end
         end
 
+        def to_s
+          "rubygems remote at #{anonymized_uri}"
+        end
+
       private
 
         def apply_auth(uri, auth)
diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb
index f2ccac4..5fd6bd6 100644
--- a/lib/bundler/spec_set.rb
+++ b/lib/bundler/spec_set.rb
@@ -1,6 +1,7 @@
 # frozen_string_literal: true
 require "tsort"
 require "forwardable"
+require "set"
 
 module Bundler
   class SpecSet
@@ -11,30 +12,20 @@ module Bundler
     def_delegators :sorted, :each
 
     def initialize(specs)
-      @specs = specs.sort_by(&:name)
+      @specs = specs
     end
 
-    def for(dependencies, skip = [], check = false, match_current_platform = false)
-      handled = {}
+    def for(dependencies, skip = [], check = false, match_current_platform = false, raise_on_missing = true)
+      handled = Set.new
       deps = dependencies.dup
       specs = []
       skip += ["bundler"]
 
-      until deps.empty?
-        dep = deps.shift
-        next if handled[dep] || skip.include?(dep.name)
+      loop do
+        break unless dep = deps.shift
+        next if !handled.add?(dep) || skip.include?(dep.name)
 
-        spec = lookup[dep.name].find do |s|
-          if match_current_platform
-            Gem::Platform.match(s.platform)
-          else
-            s.match_platform(dep.__platform)
-          end
-        end
-
-        handled[dep] = true
-
-        if spec
+        if spec = spec_for_dependency(dep, match_current_platform)
           specs << spec
 
           spec.dependencies.each do |d|
@@ -44,6 +35,8 @@ module Bundler
           end
         elsif check
           return false
+        elsif raise_on_missing
+          raise "Unable to find a spec satisfying #{dep} in the set. Perhaps the lockfile is corrupted?"
         end
       end
 
@@ -83,20 +76,35 @@ module Bundler
     end
 
     def materialize(deps, missing_specs = nil)
-      materialized = self.for(deps, [], false, true).to_a
+      materialized = self.for(deps, [], false, true, missing_specs).to_a
       deps = materialized.map(&:name).uniq
       materialized.map! do |s|
         next s unless s.is_a?(LazySpecification)
         s.source.dependency_names = deps if s.source.respond_to?(:dependency_names=)
         spec = s.__materialize__
-        if missing_specs
-          missing_specs << s unless spec
-        else
-          raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
+        unless spec
+          unless missing_specs
+            raise GemNotFound, "Could not find #{s.full_name} in any of the sources"
+          end
+          missing_specs << s
         end
-        spec if spec
+        spec
+      end
+      SpecSet.new(missing_specs ? materialized.compact : materialized)
+    end
+
+    # Materialize for all the specs in the spec set, regardless of what platform they're for
+    # This is in contrast to how for does platform filtering (and specifically different from how `materialize` calls `for` only for the current platform)
+    # @return [Array<Gem::Specification>]
+    def materialized_for_all_platforms
+      names = @specs.map(&:name).uniq
+      @specs.map do |s|
+        next s unless s.is_a?(LazySpecification)
+        s.source.dependency_names = names if s.source.respond_to?(:dependency_names=)
+        spec = s.__materialize__
+        raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
+        spec
       end
-      SpecSet.new(materialized.compact)
     end
 
     def merge(set)
@@ -108,6 +116,17 @@ module Bundler
       SpecSet.new(arr)
     end
 
+    def find_by_name_and_platform(name, platform)
+      @specs.detect {|spec| spec.name == name && spec.match_platform(platform) }
+    end
+
+    def what_required(spec)
+      unless req = find {|s| s.dependencies.any? {|d| d.type == :runtime && d.name == spec.name } }
+        return [spec]
+      end
+      what_required(req) << spec
+    end
+
   private
 
     def sorted
@@ -133,10 +152,7 @@ module Bundler
     def lookup
       @lookup ||= begin
         lookup = Hash.new {|h, k| h[k] = [] }
-        specs = @specs.sort_by do |s|
-          s.platform.to_s == "ruby" ? "\0" : s.platform.to_s
-        end
-        specs.reverse_each do |s|
+        Index.sort_specs(@specs).reverse_each do |s|
           lookup[s.name] << s
         end
         lookup
@@ -147,6 +163,19 @@ module Bundler
       @specs.each {|s| yield s }
     end
 
+    def spec_for_dependency(dep, match_current_platform)
+      specs_for_platforms = lookup[dep.name]
+      if match_current_platform
+        Bundler.rubygems.platforms.reverse_each do |pl|
+          match = GemHelpers.select_best_platform_match(specs_for_platforms, pl)
+          return match if match
+        end
+        nil
+      else
+        GemHelpers.select_best_platform_match(specs_for_platforms, dep.__platform)
+      end
+    end
+
     def tsort_each_child(s)
       s.dependencies.sort_by(&:name).each do |d|
         next if d.type == :development
diff --git a/lib/bundler/stub_specification.rb b/lib/bundler/stub_specification.rb
index f4ee7d0..aeacf24 100644
--- a/lib/bundler/stub_specification.rb
+++ b/lib/bundler/stub_specification.rb
@@ -4,21 +4,104 @@ require "bundler/remote_specification"
 module Bundler
   class StubSpecification < RemoteSpecification
     def self.from_stub(stub)
+      return stub if stub.is_a?(Bundler::StubSpecification)
       spec = new(stub.name, stub.version, stub.platform, nil)
       spec.stub = stub
       spec
     end
 
-    attr_accessor :stub
+    attr_accessor :stub, :ignored
+
+    # Pre 2.2.0 did not include extension_dir
+    # https://github.com/rubygems/rubygems/commit/9485ca2d101b82a946d6f327f4bdcdea6d4946ea
+    if Bundler.rubygems.provides?(">= 2.2.0")
+      def source=(source)
+        super
+        # Stub has no concept of source, which means that extension_dir may be wrong
+        # This is the case for git-based gems. So, instead manually assign the extension dir
+        return unless source.respond_to?(:extension_dir_name)
+        path = File.join(stub.extensions_dir, source.extension_dir_name)
+        stub.extension_dir = File.expand_path(path)
+      end
+    end
 
     def to_yaml
       _remote_specification.to_yaml
     end
 
+    # @!group Stub Delegates
+
+    if Bundler.rubygems.provides?(">= 2.3")
+      # This is defined directly to avoid having to load every installed spec
+      def missing_extensions?
+        stub.missing_extensions?
+      end
+    end
+
+    def activated
+      stub.activated
+    end
+
+    def activated=(activated)
+      stub.instance_variable_set(:@activated, activated)
+    end
+
+    def default_gem
+      stub.default_gem
+    end
+
+    def full_gem_path
+      # deleted gems can have their stubs return nil, so in that case grab the
+      # expired path from the full spec
+      stub.full_gem_path || method_missing(:full_gem_path)
+    end
+
+    if Bundler.rubygems.provides?(">= 2.2.0")
+      def full_require_paths
+        stub.full_require_paths
+      end
+
+      # This is what we do in bundler/rubygems_ext
+      # full_require_paths is always implemented in >= 2.2.0
+      def load_paths
+        full_require_paths
+      end
+    end
+
+    def loaded_from
+      stub.loaded_from
+    end
+
+    if Bundler.rubygems.stubs_provide_full_functionality?
+      def matches_for_glob(glob)
+        stub.matches_for_glob(glob)
+      end
+    end
+
+    def raw_require_paths
+      stub.raw_require_paths
+    end
+
   private
 
     def _remote_specification
-      stub.to_spec
+      @_remote_specification ||= begin
+        rs = stub.to_spec
+        if rs.equal?(self) # happens when to_spec gets the spec from Gem.loaded_specs
+          rs = Gem::Specification.load(loaded_from)
+          Bundler.rubygems.stub_set_spec(stub, rs)
+        end
+
+        unless rs
+          raise GemspecError, "The gemspec for #{full_name} at #{loaded_from}" \
+            " was missing or broken. Try running `gem pristine #{name} -v #{version}`" \
+            " to fix the cached spec."
+        end
+
+        rs.source = source
+
+        rs
+      end
     end
   end
 end
diff --git a/lib/bundler/templates/Executable b/lib/bundler/templates/Executable
index b72c267..fe22de0 100755
--- a/lib/bundler/templates/Executable
+++ b/lib/bundler/templates/Executable
@@ -1,4 +1,4 @@
-#!/usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG['ruby_install_name'] %>
+#!/usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG["ruby_install_name"] %>
 # frozen_string_literal: true
 #
 # This file was generated by Bundler.
diff --git a/lib/bundler/templates/Executable.standalone b/lib/bundler/templates/Executable.standalone
index c114afe..4bf0753 100644
--- a/lib/bundler/templates/Executable.standalone
+++ b/lib/bundler/templates/Executable.standalone
@@ -1,4 +1,4 @@
-#!/usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG['ruby_install_name'] %>
+#!/usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG["ruby_install_name"] %>
 #
 # This file was generated by Bundler.
 #
@@ -6,9 +6,9 @@
 # this file is here to facilitate running it.
 #
 
-require 'pathname'
+require "pathname"
 path = Pathname.new(__FILE__)
-$:.unshift File.expand_path '../<%= standalone_path %>', path.realpath
+$:.unshift File.expand_path "../<%= standalone_path %>", path.realpath
 
-require 'bundler/setup'
-load File.expand_path '../<%= executable_path %>', path.realpath
+require "bundler/setup"
+load File.expand_path "../<%= executable_path %>", path.realpath
diff --git a/lib/bundler/templates/newgem/Gemfile.tt b/lib/bundler/templates/newgem/Gemfile.tt
index d24b852..4cd2e40 100644
--- a/lib/bundler/templates/newgem/Gemfile.tt
+++ b/lib/bundler/templates/newgem/Gemfile.tt
@@ -1,4 +1,4 @@
-source 'https://rubygems.org'
+source "https://rubygems.org"
 
-# Specify your gem's dependencies in <%=config[:name]%>.gemspec
+# Specify your gem's dependencies in <%= config[:name] %>.gemspec
 gemspec
diff --git a/lib/bundler/templates/newgem/LICENSE.txt.tt b/lib/bundler/templates/newgem/LICENSE.txt.tt
index 8fef84c..76ef4b0 100644
--- a/lib/bundler/templates/newgem/LICENSE.txt.tt
+++ b/lib/bundler/templates/newgem/LICENSE.txt.tt
@@ -1,6 +1,6 @@
 The MIT License (MIT)
 
-Copyright (c) <%=Time.now.year%> <%=config[:author]%>
+Copyright (c) <%= Time.now.year %> <%= config[:author] %>
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/lib/bundler/templates/newgem/README.md.tt b/lib/bundler/templates/newgem/README.md.tt
index 30c7b93..edbe55d 100644
--- a/lib/bundler/templates/newgem/README.md.tt
+++ b/lib/bundler/templates/newgem/README.md.tt
@@ -1,6 +1,6 @@
-# <%=config[:constant_name]%>
+# <%= config[:constant_name] %>
 
-Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/<%=config[:namespaced_path]%>`. To experiment with that code, run `bin/console` for an interactive prompt.
+Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/<%= config[:namespaced_path] %>`. To experiment with that code, run `bin/console` for an interactive prompt.
 
 TODO: Delete this and the text above, and describe your gem
 
@@ -9,7 +9,7 @@ TODO: Delete this and the text above, and describe your gem
 Add this line to your application's Gemfile:
 
 ```ruby
-gem '<%=config[:name]%>'
+gem '<%= config[:name] %>'
 ```
 
 And then execute:
@@ -18,7 +18,7 @@ And then execute:
 
 Or install it yourself as:
 
-    $ gem install <%=config[:name]%>
+    $ gem install <%= config[:name] %>
 
 ## Usage
 
@@ -32,10 +32,16 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
 
 ## Contributing
 
-Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/<%= config[:name] %>.<% if config[:coc] %> This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.<% end %>
-<% if config[:mit] %>
+Bug reports and pull requests are welcome on GitHub at https://github.com/<%= config[:github_username] %>/<%= config[:name] %>.<% if config[:coc] %> This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.<% end %>
+<% if config[:mit] -%>
 
 ## License
 
 The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
-<% end %>
+<% end -%>
+<% if config[:coc] -%>
+
+## Code of Conduct
+
+Everyone interacting in the <%= config[:constant_name] %> project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/<%= config[:github_username] %>/<%= config[:name] %>/blob/master/CODE_OF_CONDUCT.md).
+<% end -%>
diff --git a/lib/bundler/templates/newgem/Rakefile.tt b/lib/bundler/templates/newgem/Rakefile.tt
index 8beb91a..099da6f 100644
--- a/lib/bundler/templates/newgem/Rakefile.tt
+++ b/lib/bundler/templates/newgem/Rakefile.tt
@@ -1,14 +1,14 @@
 require "bundler/gem_tasks"
-<% if config[:test] == 'minitest' -%>
+<% if config[:test] == "minitest" -%>
 require "rake/testtask"
 
 Rake::TestTask.new(:test) do |t|
   t.libs << "test"
   t.libs << "lib"
-  t.test_files = FileList['test/**/*_test.rb']
+  t.test_files = FileList["test/**/*_test.rb"]
 end
 
-<% elsif config[:test] == 'rspec' -%>
+<% elsif config[:test] == "rspec" -%>
 require "rspec/core/rake_task"
 
 RSpec::Core::RakeTask.new(:spec)
@@ -19,8 +19,8 @@ require "rake/extensiontask"
 
 task :build => :compile
 
-Rake::ExtensionTask.new("<%=config[:underscored_name]%>") do |ext|
-  ext.lib_dir = "lib/<%=config[:namespaced_path]%>"
+Rake::ExtensionTask.new("<%= config[:underscored_name] %>") do |ext|
+  ext.lib_dir = "lib/<%= config[:namespaced_path] %>"
 end
 
 task :default => [:clobber, :compile, :<%= config[:test_task] %>]
diff --git a/lib/bundler/templates/newgem/bin/console.tt b/lib/bundler/templates/newgem/bin/console.tt
index f402bd6..a27f824 100644
--- a/lib/bundler/templates/newgem/bin/console.tt
+++ b/lib/bundler/templates/newgem/bin/console.tt
@@ -11,4 +11,4 @@ require "<%= config[:namespaced_path] %>"
 # Pry.start
 
 require "irb"
-IRB.start
+IRB.start(__FILE__)
diff --git a/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt b/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt
index 5dad364..8177c4d 100644
--- a/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt
+++ b/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt
@@ -1,9 +1,9 @@
-#include "<%=config[:underscored_name]%>.h"
+#include "<%= config[:underscored_name] %>.h"
 
-VALUE rb_m<%=config[:constant_array].join%>;
+VALUE rb_m<%= config[:constant_array].join %>;
 
 void
-Init_<%=config[:underscored_name]%>(void)
+Init_<%= config[:underscored_name] %>(void)
 {
-  rb_m<%=config[:constant_array].join%> = rb_define_module(<%=config[:constant_name].inspect%>);
+  rb_m<%= config[:constant_array].join %> = rb_define_module(<%= config[:constant_name].inspect %>);
 }
diff --git a/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt b/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt
index 960fdfb..c6e420b 100644
--- a/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt
+++ b/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt
@@ -1,6 +1,6 @@
-#ifndef <%=config[:underscored_name].upcase%>_H
-#define <%=config[:underscored_name].upcase%>_H 1
+#ifndef <%= config[:underscored_name].upcase %>_H
+#define <%= config[:underscored_name].upcase %>_H 1
 
 #include "ruby.h"
 
-#endif /* <%=config[:underscored_name].upcase%>_H */
+#endif /* <%= config[:underscored_name].upcase %>_H */
diff --git a/lib/bundler/templates/newgem/gitignore.tt b/lib/bundler/templates/newgem/gitignore.tt
index ebff7ac..573d76b 100644
--- a/lib/bundler/templates/newgem/gitignore.tt
+++ b/lib/bundler/templates/newgem/gitignore.tt
@@ -14,3 +14,8 @@
 *.a
 mkmf.log
 <%- end -%>
+<%- if config[:test] == "rspec" -%>
+
+# rspec failure tracking
+.rspec_status
+<%- end -%>
diff --git a/lib/bundler/templates/newgem/lib/newgem.rb.tt b/lib/bundler/templates/newgem/lib/newgem.rb.tt
index b3f816b..7d8ad90 100644
--- a/lib/bundler/templates/newgem/lib/newgem.rb.tt
+++ b/lib/bundler/templates/newgem/lib/newgem.rb.tt
@@ -1,12 +1,12 @@
-require "<%=config[:namespaced_path]%>/version"
+require "<%= config[:namespaced_path] %>/version"
 <%- if config[:ext] -%>
-require "<%=config[:namespaced_path]%>/<%=config[:underscored_name]%>"
+require "<%= config[:namespaced_path] %>/<%= config[:underscored_name] %>"
 <%- end -%>
 
-<%- config[:constant_array].each_with_index do |c,i| -%>
-<%= '  '*i %>module <%= c %>
+<%- config[:constant_array].each_with_index do |c, i| -%>
+<%= "  " * i %>module <%= c %>
 <%- end -%>
-<%= '  '*config[:constant_array].size %># Your code goes here...
+<%= "  " * config[:constant_array].size %># Your code goes here...
 <%- (config[:constant_array].size-1).downto(0) do |i| -%>
-<%= '  '*i %>end
+<%= "  " * i %>end
 <%- end -%>
diff --git a/lib/bundler/templates/newgem/lib/newgem/version.rb.tt b/lib/bundler/templates/newgem/lib/newgem/version.rb.tt
index 5874085..389daf5 100644
--- a/lib/bundler/templates/newgem/lib/newgem/version.rb.tt
+++ b/lib/bundler/templates/newgem/lib/newgem/version.rb.tt
@@ -1,7 +1,7 @@
-<%- config[:constant_array].each_with_index do |c,i| -%>
-<%= '  '*i %>module <%= c %>
+<%- config[:constant_array].each_with_index do |c, i| -%>
+<%= "  " * i %>module <%= c %>
 <%- end -%>
-<%= '  '*config[:constant_array].size %>VERSION = "0.1.0"
+<%= "  " * config[:constant_array].size %>VERSION = "0.1.0"
 <%- (config[:constant_array].size-1).downto(0) do |i| -%>
-<%= '  '*i %>end
+<%= "  " * i %>end
 <%- end -%>
diff --git a/lib/bundler/templates/newgem/newgem.gemspec.tt b/lib/bundler/templates/newgem/newgem.gemspec.tt
index 9d6d491..caea7fe 100644
--- a/lib/bundler/templates/newgem/newgem.gemspec.tt
+++ b/lib/bundler/templates/newgem/newgem.gemspec.tt
@@ -1,13 +1,13 @@
 # coding: utf-8
-lib = File.expand_path('../lib', __FILE__)
+lib = File.expand_path("../lib", __FILE__)
 $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-require '<%=config[:namespaced_path]%>/version'
+require "<%= config[:namespaced_path] %>/version"
 
 Gem::Specification.new do |spec|
-  spec.name          = <%=config[:name].inspect%>
-  spec.version       = <%=config[:constant_name]%>::VERSION
-  spec.authors       = [<%=config[:author].inspect%>]
-  spec.email         = [<%=config[:email].inspect%>]
+  spec.name          = <%= config[:name].inspect %>
+  spec.version       = <%= config[:constant_name] %>::VERSION
+  spec.authors       = [<%= config[:author].inspect %>]
+  spec.email         = [<%= config[:email].inspect %>]
 
   spec.summary       = %q{TODO: Write a short summary, because Rubygems requires one.}
   spec.description   = %q{TODO: Write a longer description or delete this line.}
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
   # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
   # to allow pushing to a single host or delete this section to allow pushing to any host.
   if spec.respond_to?(:metadata)
-    spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
+    spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
   else
     raise "RubyGems 2.0 or newer is required to protect against " \
       "public gem pushes."
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
   spec.executables   = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
   spec.require_paths = ["lib"]
 <%- if config[:ext] -%>
-  spec.extensions    = ["ext/<%=config[:underscored_name]%>/extconf.rb"]
+  spec.extensions    = ["ext/<%= config[:underscored_name] %>/extconf.rb"]
 <%- end -%>
 
   spec.add_development_dependency "bundler", "~> <%= config[:bundler_version] %>"
@@ -41,6 +41,6 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency "rake-compiler"
 <%- end -%>
 <%- if config[:test] -%>
-  spec.add_development_dependency "<%=config[:test]%>", "~> <%=config[:test_framework_version]%>"
+  spec.add_development_dependency "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>"
 <%- end -%>
 end
diff --git a/lib/bundler/templates/newgem/test/newgem_test.rb.tt b/lib/bundler/templates/newgem/test/newgem_test.rb.tt
index 95e33a3..f2af9f9 100644
--- a/lib/bundler/templates/newgem/test/newgem_test.rb.tt
+++ b/lib/bundler/templates/newgem/test/newgem_test.rb.tt
@@ -1,4 +1,4 @@
-require 'test_helper'
+require "test_helper"
 
 class <%= config[:constant_name] %>Test < Minitest::Test
   def test_that_it_has_a_version_number
diff --git a/lib/bundler/templates/newgem/test/test_helper.rb.tt b/lib/bundler/templates/newgem/test/test_helper.rb.tt
index 49a56c1..725e3e4 100644
--- a/lib/bundler/templates/newgem/test/test_helper.rb.tt
+++ b/lib/bundler/templates/newgem/test/test_helper.rb.tt
@@ -1,4 +1,4 @@
-$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
-require '<%= config[:namespaced_path] %>'
+$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
+require "<%= config[:namespaced_path] %>"
 
-require 'minitest/autorun'
+require "minitest/autorun"
diff --git a/lib/bundler/ui/shell.rb b/lib/bundler/ui/shell.rb
index 5c1fa61..87a9247 100644
--- a/lib/bundler/ui/shell.rb
+++ b/lib/bundler/ui/shell.rb
@@ -40,16 +40,15 @@ module Bundler
       end
 
       def debug(msg, newline = nil)
-        tell_me(msg, nil, newline) if level("debug")
+        tell_me(msg, nil, newline) if debug?
       end
 
       def debug?
-        # needs to be false instead of nil to be newline param to other methods
-        level("debug") ? true : false
+        level("debug")
       end
 
       def quiet?
-        LEVELS.index(@level) <= LEVELS.index("warn")
+        level("quiet")
       end
 
       def ask(msg)
@@ -66,11 +65,15 @@ module Bundler
 
       def level=(level)
         raise ArgumentError unless LEVELS.include?(level.to_s)
-        @level = level
+        @level = level.to_s
       end
 
       def level(name = nil)
-        name ? LEVELS.index(name) <= LEVELS.index(@level) : @level
+        return @level unless name
+        unless index = LEVELS.index(name)
+          raise "#{name.inspect} is not a valid level"
+        end
+        index <= LEVELS.index(@level)
       end
 
       def trace(e, newline = nil, force = false)
@@ -83,6 +86,10 @@ module Bundler
         with_level("silent", &blk)
       end
 
+      def unprinted_warnings
+        []
+      end
+
     private
 
       # valimism
diff --git a/lib/bundler/ui/silent.rb b/lib/bundler/ui/silent.rb
index 367eaa5..48390b7 100644
--- a/lib/bundler/ui/silent.rb
+++ b/lib/bundler/ui/silent.rb
@@ -2,6 +2,12 @@
 module Bundler
   module UI
     class Silent
+      attr_writer :shell
+
+      def initialize
+        @warnings = []
+      end
+
       def add_color(string, color)
         string
       end
@@ -13,6 +19,7 @@ module Bundler
       end
 
       def warn(message, newline = nil)
+        @warnings |= [message]
       end
 
       def error(message, newline = nil)
@@ -32,18 +39,30 @@ module Bundler
       def ask(message)
       end
 
+      def yes?(msg)
+        raise "Cannot ask yes? with a silent shell"
+      end
+
+      def no?
+        raise "Cannot ask no? with a silent shell"
+      end
+
       def level=(name)
       end
 
       def level(name = nil)
       end
 
-      def trace(message, newline = nil)
+      def trace(message, newline = nil, force = false)
       end
 
       def silence
         yield
       end
+
+      def unprinted_warnings
+        @warnings
+      end
     end
   end
 end
diff --git a/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb b/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb
deleted file mode 100644
index 257e4c1..0000000
--- a/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb
+++ /dev/null
@@ -1,79 +0,0 @@
-# frozen_string_literal: true
-require "pathname"
-require "set"
-
-class Bundler::CompactIndexClient
-  class Error < StandardError; end
-
-  require "bundler/vendor/compact_index_client/lib/compact_index_client/cache"
-  require "bundler/vendor/compact_index_client/lib/compact_index_client/updater"
-  require "bundler/vendor/compact_index_client/lib/compact_index_client/version"
-
-  attr_reader :directory
-
-  # @return [Lambda] A lambda that takes an array of inputs and a block, and
-  #         maps the inputs with the block in parallel.
-  #
-  attr_accessor :in_parallel
-
-  def initialize(directory, fetcher)
-    @directory = Pathname.new(directory)
-    @updater = Updater.new(fetcher)
-    @cache = Cache.new(@directory)
-    @endpoints = Set.new
-    @info_checksums_by_name = {}
-    @parsed_checksums = false
-    @in_parallel = lambda do |inputs, &blk|
-      inputs.map(&blk)
-    end
-  end
-
-  def names
-    update(@cache.names_path, "names")
-    @cache.names
-  end
-
-  def versions
-    update(@cache.versions_path, "versions")
-    versions, @info_checksums_by_name = @cache.versions
-    versions
-  end
-
-  def dependencies(names)
-    in_parallel.call(names) do |name|
-      update_info(name)
-      @cache.dependencies(name).map {|d| d.unshift(name) }
-    end.flatten(1)
-  end
-
-  def spec(name, version, platform = nil)
-    update_info(name)
-    @cache.specific_dependency(name, version, platform)
-  end
-
-  def update_and_parse_checksums!
-    return @info_checksums_by_name if @parsed_checksums
-    update(@cache.versions_path, "versions")
-    @info_checksums_by_name = @cache.checksums
-    @parsed_checksums = true
-  end
-
-private
-
-  def update(local_path, remote_path)
-    return unless @endpoints.add?(remote_path)
-    @updater.update(local_path, url(remote_path))
-  end
-
-  def update_info(name)
-    path = @cache.info_path(name)
-    checksum = @updater.checksum_for_file(path)
-    return unless existing = @info_checksums_by_name[name]
-    return if checksum == existing
-    update(path, "info/#{name}")
-  end
-
-  def url(path)
-    path
-  end
-end
diff --git a/lib/bundler/vendor/compact_index_client/lib/compact_index_client/cache.rb b/lib/bundler/vendor/compact_index_client/lib/compact_index_client/cache.rb
deleted file mode 100644
index d2639ee..0000000
--- a/lib/bundler/vendor/compact_index_client/lib/compact_index_client/cache.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-# frozen_string_literal: true
-require "digest/md5"
-class Bundler::CompactIndexClient
-  class Cache
-    attr_reader :directory
-
-    def initialize(directory)
-      @directory = Pathname.new(directory).expand_path
-      info_roots.each {|dir| FileUtils.mkdir_p(dir) }
-    end
-
-    def names
-      lines(names_path)
-    end
-
-    def names_path
-      directory.join("names")
-    end
-
-    def versions
-      versions_by_name = Hash.new {|hash, key| hash[key] = [] }
-      info_checksums_by_name = {}
-
-      lines(versions_path).each do |line|
-        name, versions_string, info_checksum = line.split(" ", 3)
-        info_checksums_by_name[name] = info_checksum || ""
-        versions_string.split(",").each do |version|
-          if version.start_with?("-")
-            version = version[1..-1].split("-", 2).unshift(name)
-            versions_by_name[name].delete(version)
-          else
-            version = version.split("-", 2).unshift(name)
-            versions_by_name[name] << version
-          end
-        end
-      end
-
-      [versions_by_name, info_checksums_by_name]
-    end
-
-    def versions_path
-      directory.join("versions")
-    end
-
-    def checksums
-      checksums = {}
-
-      lines(versions_path).each do |line|
-        name, _, checksum = line.split(" ", 3)
-        checksums[name] = checksum
-      end
-
-      checksums
-    end
-
-    def dependencies(name)
-      lines(info_path(name)).map do |line|
-        parse_gem(line)
-      end
-    end
-
-    def info_path(name)
-      name = name.to_s
-      if name =~ /[^a-z0-9_-]/
-        name += "-#{Digest::MD5.hexdigest(name).downcase}"
-        info_roots.last.join(name)
-      else
-        info_roots.first.join(name)
-      end
-    end
-
-    def specific_dependency(name, version, platform)
-      pattern = [version, platform].compact.join("-")
-      return nil if pattern.empty?
-
-      gem_lines = info_path(name).read
-      gem_line = gem_lines[/^#{Regexp.escape(pattern)}\b.*/, 0]
-      gem_line ? parse_gem(gem_line) : nil
-    end
-
-  private
-
-    def lines(path)
-      return [] unless path.file?
-      lines = path.read.split("\n")
-      header = lines.index("---")
-      lines = header ? lines[header + 1..-1] : lines
-    end
-
-    def parse_gem(string)
-      version_and_platform, rest = string.split(" ", 2)
-      version, platform = version_and_platform.split("-", 2)
-      dependencies, requirements = rest.split("|", 2).map {|s| s.split(",") } if rest
-      dependencies = dependencies ? dependencies.map {|d| parse_dependency(d) } : []
-      requirements = requirements ? requirements.map {|r| parse_dependency(r) } : []
-      [version, platform, dependencies, requirements]
-    end
-
-    def parse_dependency(string)
-      dependency = string.split(":")
-      dependency[-1] = dependency[-1].split("&") if dependency.size > 1
-      dependency
-    end
-
-    def info_roots
-      [
-        directory.join("info"),
-        directory.join("info-special-characters"),
-      ]
-    end
-  end
-end
diff --git a/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb b/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb
deleted file mode 100644
index 40c6164..0000000
--- a/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-# frozen_string_literal: true
-require "fileutils"
-require "stringio"
-require "tmpdir"
-require "zlib"
-
-class Bundler::CompactIndexClient
-  class Updater
-    class MisMatchedChecksumError < Error
-      def initialize(path, server_checksum, local_checksum)
-        @path = path
-        @server_checksum = server_checksum
-        @local_checksum = local_checksum
-      end
-
-      def message
-        "The checksum of /#{@path} does not match the checksum provided by the server! Something is wrong " \
-          "(local checksum is #{@local_checksum.inspect}, was expecting #{@server_checksum.inspect})."
-      end
-    end
-
-    def initialize(fetcher)
-      @fetcher = fetcher
-    end
-
-    def update(local_path, remote_path, retrying = nil)
-      headers = {}
-
-      Dir.mktmpdir("bundler-compact-index-") do |local_temp_dir|
-        local_temp_path = Pathname.new(local_temp_dir).join(local_path.basename)
-
-        # first try to fetch any new bytes on the existing file
-        if retrying.nil? && local_path.file?
-          FileUtils.cp local_path, local_temp_path
-          headers["If-None-Match"] = etag_for(local_temp_path)
-          headers["Range"] = "bytes=#{local_temp_path.size}-"
-        else
-          # Fastly ignores Range when Accept-Encoding: gzip is set
-          headers["Accept-Encoding"] = "gzip"
-        end
-
-        response = @fetcher.call(remote_path, headers)
-        return if response.is_a?(Net::HTTPNotModified)
-
-        content = response.body
-        if response["Content-Encoding"] == "gzip"
-          content = Zlib::GzipReader.new(StringIO.new(content)).read
-        end
-
-        mode = response.is_a?(Net::HTTPPartialContent) ? "a" : "w"
-        local_temp_path.open(mode) {|f| f << content }
-
-        response_etag = response["ETag"].gsub(%r{\AW/}, "")
-        if etag_for(local_temp_path) == response_etag
-          FileUtils.mv(local_temp_path, local_path)
-          return
-        end
-
-        if retrying.nil?
-          update(local_path, remote_path, :retrying)
-        else
-          raise MisMatchedChecksumError.new(remote_path, response_etag, etag_for(local_temp_path))
-        end
-      end
-    end
-
-    def etag_for(path)
-      sum = checksum_for_file(path)
-      sum ? %("#{sum}") : nil
-    end
-
-    def checksum_for_file(path)
-      return nil unless path.file?
-      # This must use IO.read instead of Digest.file().hexdigest
-      # because we need to preserve \n line endings on windows when calculating
-      # the checksum
-      Digest::MD5.hexdigest(IO.read(path))
-    end
-  end
-end
diff --git a/lib/bundler/vendor/compact_index_client/lib/compact_index_client/version.rb b/lib/bundler/vendor/compact_index_client/lib/compact_index_client/version.rb
deleted file mode 100644
index 64520da..0000000
--- a/lib/bundler/vendor/compact_index_client/lib/compact_index_client/version.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-# frozen_string_literal: true
-class Bundler::CompactIndexClient
-  VERSION = "0.1.0".freeze
-end
diff --git a/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb b/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb
new file mode 100644
index 0000000..e5e0908
--- /dev/null
+++ b/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb
@@ -0,0 +1,27 @@
+require 'net/protocol'
+
+##
+# Aaron Patterson's monkeypatch (accepted into 1.9.1) to fix Net::HTTP's speed
+# problems.
+#
+# http://gist.github.com/251244
+
+class Net::BufferedIO #:nodoc:
+  alias :old_rbuf_fill :rbuf_fill
+
+  def rbuf_fill
+    if @io.respond_to? :read_nonblock then
+      begin
+        @rbuf << @io.read_nonblock(65536)
+      rescue Errno::EWOULDBLOCK, Errno::EAGAIN => e
+        retry if IO.select [@io], nil, nil, @read_timeout
+        raise Timeout::Error, e.message
+      end
+    else # SSL sockets do not have read_nonblock
+      timeout @read_timeout do
+        @rbuf << @io.sysread(65536)
+      end
+    end
+  end
+end if RUBY_VERSION < '1.9'
+
diff --git a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb
new file mode 100644
index 0000000..5195be2
--- /dev/null
+++ b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb
@@ -0,0 +1,1231 @@
+require 'net/http'
+begin
+  require 'net/https'
+rescue LoadError
+  # net/https or openssl
+end if RUBY_VERSION < '1.9' # but only for 1.8
+require 'bundler/vendor/net-http-persistent/lib/net/http/faster'
+require 'uri'
+require 'cgi' # for escaping
+
+begin
+  require 'net/http/pipeline'
+rescue LoadError
+end
+
+autoload :OpenSSL, 'openssl'
+
+##
+# Persistent connections for Net::HTTP
+#
+# Bundler::Persistent::Net::HTTP::Persistent maintains persistent connections across all the
+# servers you wish to talk to.  For each host:port you communicate with a
+# single persistent connection is created.
+#
+# Multiple Bundler::Persistent::Net::HTTP::Persistent objects will share the same set of
+# connections.
+#
+# For each thread you start a new connection will be created.  A
+# Bundler::Persistent::Net::HTTP::Persistent connection will not be shared across threads.
+#
+# You can shut down the HTTP connections when done by calling #shutdown.  You
+# should name your Bundler::Persistent::Net::HTTP::Persistent object if you intend to call this
+# method.
+#
+# Example:
+#
+#   require 'bundler/vendor/net-http-persistent/lib/net/http/persistent'
+#
+#   uri = URI 'http://example.com/awesome/web/service'
+#
+#   http = Bundler::Persistent::Net::HTTP::Persistent.new 'my_app_name'
+#
+#   # perform a GET
+#   response = http.request uri
+#
+#   # or
+#
+#   get = Net::HTTP::Get.new uri.request_uri
+#   response = http.request get
+#
+#   # create a POST
+#   post_uri = uri + 'create'
+#   post = Net::HTTP::Post.new post_uri.path
+#   post.set_form_data 'some' => 'cool data'
+#
+#   # perform the POST, the URI is always required
+#   response http.request post_uri, post
+#
+# Note that for GET, HEAD and other requests that do not have a body you want
+# to use URI#request_uri not URI#path.  The request_uri contains the query
+# params which are sent in the body for other requests.
+#
+# == SSL
+#
+# SSL connections are automatically created depending upon the scheme of the
+# URI.  SSL connections are automatically verified against the default
+# certificate store for your computer.  You can override this by changing
+# verify_mode or by specifying an alternate cert_store.
+#
+# Here are the SSL settings, see the individual methods for documentation:
+#
+# #certificate        :: This client's certificate
+# #ca_file            :: The certificate-authority
+# #cert_store         :: An SSL certificate store
+# #private_key        :: The client's SSL private key
+# #reuse_ssl_sessions :: Reuse a previously opened SSL session for a new
+#                        connection
+# #ssl_version        :: Which specific SSL version to use
+# #verify_callback    :: For server certificate verification
+# #verify_mode        :: How connections should be verified
+#
+# == Proxies
+#
+# A proxy can be set through #proxy= or at initialization time by providing a
+# second argument to ::new.  The proxy may be the URI of the proxy server or
+# <code>:ENV</code> which will consult environment variables.
+#
+# See #proxy= and #proxy_from_env for details.
+#
+# == Headers
+#
+# Headers may be specified for use in every request.  #headers are appended to
+# any headers on the request.  #override_headers replace existing headers on
+# the request.
+#
+# The difference between the two can be seen in setting the User-Agent.  Using
+# <code>http.headers['User-Agent'] = 'MyUserAgent'</code> will send "Ruby,
+# MyUserAgent" while <code>http.override_headers['User-Agent'] =
+# 'MyUserAgent'</code> will send "MyUserAgent".
+#
+# == Tuning
+#
+# === Segregation
+#
+# By providing an application name to ::new you can separate your connections
+# from the connections of other applications.
+#
+# === Idle Timeout
+#
+# If a connection hasn't been used for this number of seconds it will automatically be
+# reset upon the next use to avoid attempting to send to a closed connection.
+# The default value is 5 seconds. nil means no timeout. Set through #idle_timeout.
+#
+# Reducing this value may help avoid the "too many connection resets" error
+# when sending non-idempotent requests while increasing this value will cause
+# fewer round-trips.
+#
+# === Read Timeout
+#
+# The amount of time allowed between reading two chunks from the socket.  Set
+# through #read_timeout
+#
+# === Max Requests
+#
+# The number of requests that should be made before opening a new connection.
+# Typically many keep-alive capable servers tune this to 100 or less, so the
+# 101st request will fail with ECONNRESET. If unset (default), this value has no
+# effect, if set, connections will be reset on the request after max_requests.
+#
+# === Open Timeout
+#
+# The amount of time to wait for a connection to be opened.  Set through
+# #open_timeout.
+#
+# === Socket Options
+#
+# Socket options may be set on newly-created connections.  See #socket_options
+# for details.
+#
+# === Non-Idempotent Requests
+#
+# By default non-idempotent requests will not be retried per RFC 2616.  By
+# setting retry_change_requests to true requests will automatically be retried
+# once.
+#
+# Only do this when you know that retrying a POST or other non-idempotent
+# request is safe for your application and will not create duplicate
+# resources.
+#
+# The recommended way to handle non-idempotent requests is the following:
+#
+#   require 'bundler/vendor/net-http-persistent/lib/net/http/persistent'
+#
+#   uri = URI 'http://example.com/awesome/web/service'
+#   post_uri = uri + 'create'
+#
+#   http = Bundler::Persistent::Net::HTTP::Persistent.new 'my_app_name'
+#
+#   post = Net::HTTP::Post.new post_uri.path
+#   # ... fill in POST request
+#
+#   begin
+#     response = http.request post_uri, post
+#   rescue Bundler::Persistent::Net::HTTP::Persistent::Error
+#
+#     # POST failed, make a new request to verify the server did not process
+#     # the request
+#     exists_uri = uri + '...'
+#     response = http.get exists_uri
+#
+#     # Retry if it failed
+#     retry if response.code == '404'
+#   end
+#
+# The method of determining if the resource was created or not is unique to
+# the particular service you are using.  Of course, you will want to add
+# protection from infinite looping.
+#
+# === Connection Termination
+#
+# If you are done using the Bundler::Persistent::Net::HTTP::Persistent instance you may shut down
+# all the connections in the current thread with #shutdown.  This is not
+# recommended for normal use, it should only be used when it will be several
+# minutes before you make another HTTP request.
+#
+# If you are using multiple threads, call #shutdown in each thread when the
+# thread is done making requests.  If you don't call shutdown, that's OK.
+# Ruby will automatically garbage collect and shutdown your HTTP connections
+# when the thread terminates.
+
+class Bundler::Persistent::Net::HTTP::Persistent
+
+  ##
+  # The beginning of Time
+
+  EPOCH = Time.at 0 # :nodoc:
+
+  ##
+  # Is OpenSSL available?  This test works with autoload
+
+  HAVE_OPENSSL = defined? OpenSSL::SSL # :nodoc:
+
+  ##
+  # The version of Bundler::Persistent::Net::HTTP::Persistent you are using
+
+  VERSION = '2.9.4'
+
+  ##
+  # Exceptions rescued for automatic retry on ruby 2.0.0.  This overlaps with
+  # the exception list for ruby 1.x.
+
+  RETRIED_EXCEPTIONS = [ # :nodoc:
+    (Net::ReadTimeout if Net.const_defined? :ReadTimeout),
+    IOError,
+    EOFError,
+    Errno::ECONNRESET,
+    Errno::ECONNABORTED,
+    Errno::EPIPE,
+    (OpenSSL::SSL::SSLError if HAVE_OPENSSL),
+    Timeout::Error,
+  ].compact
+
+  ##
+  # Error class for errors raised by Bundler::Persistent::Net::HTTP::Persistent.  Various
+  # SystemCallErrors are re-raised with a human-readable message under this
+  # class.
+
+  class Error < StandardError; end
+
+  ##
+  # Use this method to detect the idle timeout of the host at +uri+.  The
+  # value returned can be used to configure #idle_timeout.  +max+ controls the
+  # maximum idle timeout to detect.
+  #
+  # After
+  #
+  # Idle timeout detection is performed by creating a connection then
+  # performing a HEAD request in a loop until the connection terminates
+  # waiting one additional second per loop.
+  #
+  # NOTE:  This may not work on ruby > 1.9.
+
+  def self.detect_idle_timeout uri, max = 10
+    uri = URI uri unless URI::Generic === uri
+    uri += '/'
+
+    req = Net::HTTP::Head.new uri.request_uri
+
+    http = new 'net-http-persistent detect_idle_timeout'
+
+    connection = http.connection_for uri
+
+    sleep_time = 0
+
+    loop do
+      response = connection.request req
+
+      $stderr.puts "HEAD #{uri} => #{response.code}" if $DEBUG
+
+      unless Net::HTTPOK === response then
+        raise Error, "bad response code #{response.code} detecting idle timeout"
+      end
+
+      break if sleep_time >= max
+
+      sleep_time += 1
+
+      $stderr.puts "sleeping #{sleep_time}" if $DEBUG
+      sleep sleep_time
+    end
+  rescue
+    # ignore StandardErrors, we've probably found the idle timeout.
+  ensure
+    http.shutdown
+
+    return sleep_time unless $!
+  end
+
+  ##
+  # This client's OpenSSL::X509::Certificate
+
+  attr_reader :certificate
+
+  # For Net::HTTP parity
+  alias cert certificate
+
+  ##
+  # An SSL certificate authority.  Setting this will set verify_mode to
+  # VERIFY_PEER.
+
+  attr_reader :ca_file
+
+  ##
+  # An SSL certificate store.  Setting this will override the default
+  # certificate store.  See verify_mode for more information.
+
+  attr_reader :cert_store
+
+  ##
+  # Sends debug_output to this IO via Net::HTTP#set_debug_output.
+  #
+  # Never use this method in production code, it causes a serious security
+  # hole.
+
+  attr_accessor :debug_output
+
+  ##
+  # Current connection generation
+
+  attr_reader :generation # :nodoc:
+
+  ##
+  # Where this instance's connections live in the thread local variables
+
+  attr_reader :generation_key # :nodoc:
+
+  ##
+  # Headers that are added to every request using Net::HTTP#add_field
+
+  attr_reader :headers
+
+  ##
+  # Maps host:port to an HTTP version.  This allows us to enable version
+  # specific features.
+
+  attr_reader :http_versions
+
+  ##
+  # Maximum time an unused connection can remain idle before being
+  # automatically closed.
+
+  attr_accessor :idle_timeout
+
+  ##
+  # Maximum number of requests on a connection before it is considered expired
+  # and automatically closed.
+
+  attr_accessor :max_requests
+
+  ##
+  # The value sent in the Keep-Alive header.  Defaults to 30.  Not needed for
+  # HTTP/1.1 servers.
+  #
+  # This may not work correctly for HTTP/1.0 servers
+  #
+  # This method may be removed in a future version as RFC 2616 does not
+  # require this header.
+
+  attr_accessor :keep_alive
+
+  ##
+  # A name for this connection.  Allows you to keep your connections apart
+  # from everybody else's.
+
+  attr_reader :name
+
+  ##
+  # Seconds to wait until a connection is opened.  See Net::HTTP#open_timeout
+
+  attr_accessor :open_timeout
+
+  ##
+  # Headers that are added to every request using Net::HTTP#[]=
+
+  attr_reader :override_headers
+
+  ##
+  # This client's SSL private key
+
+  attr_reader :private_key
+
+  # For Net::HTTP parity
+  alias key private_key
+
+  ##
+  # The URL through which requests will be proxied
+
+  attr_reader :proxy_uri
+
+  ##
+  # List of host suffixes which will not be proxied
+
+  attr_reader :no_proxy
+
+  ##
+  # Seconds to wait until reading one block.  See Net::HTTP#read_timeout
+
+  attr_accessor :read_timeout
+
+  ##
+  # Where this instance's request counts live in the thread local variables
+
+  attr_reader :request_key # :nodoc:
+
+  ##
+  # By default SSL sessions are reused to avoid extra SSL handshakes.  Set
+  # this to false if you have problems communicating with an HTTPS server
+  # like:
+  #
+  #   SSL_connect [...] read finished A: unexpected message (OpenSSL::SSL::SSLError)
+
+  attr_accessor :reuse_ssl_sessions
+
+  ##
+  # An array of options for Socket#setsockopt.
+  #
+  # By default the TCP_NODELAY option is set on sockets.
+  #
+  # To set additional options append them to this array:
+  #
+  #   http.socket_options << [Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, 1]
+
+  attr_reader :socket_options
+
+  ##
+  # Current SSL connection generation
+
+  attr_reader :ssl_generation # :nodoc:
+
+  ##
+  # Where this instance's SSL connections live in the thread local variables
+
+  attr_reader :ssl_generation_key # :nodoc:
+
+  ##
+  # SSL version to use.
+  #
+  # By default, the version will be negotiated automatically between client
+  # and server.  Ruby 1.9 and newer only.
+
+  attr_reader :ssl_version if RUBY_VERSION > '1.9'
+
+  ##
+  # Where this instance's last-use times live in the thread local variables
+
+  attr_reader :timeout_key # :nodoc:
+
+  ##
+  # SSL verification callback.  Used when ca_file is set.
+
+  attr_reader :verify_callback
+
+  ##
+  # HTTPS verify mode.  Defaults to OpenSSL::SSL::VERIFY_PEER which verifies
+  # the server certificate.
+  #
+  # If no ca_file or cert_store is set the default system certificate store is
+  # used.
+  #
+  # You can use +verify_mode+ to override any default values.
+
+  attr_reader :verify_mode
+
+  ##
+  # Enable retries of non-idempotent requests that change data (e.g. POST
+  # requests) when the server has disconnected.
+  #
+  # This will in the worst case lead to multiple requests with the same data,
+  # but it may be useful for some applications.  Take care when enabling
+  # this option to ensure it is safe to POST or perform other non-idempotent
+  # requests to the server.
+
+  attr_accessor :retry_change_requests
+
+  ##
+  # Creates a new Bundler::Persistent::Net::HTTP::Persistent.
+  #
+  # Set +name+ to keep your connections apart from everybody else's.  Not
+  # required currently, but highly recommended.  Your library name should be
+  # good enough.  This parameter will be required in a future version.
+  #
+  # +proxy+ may be set to a URI::HTTP or :ENV to pick up proxy options from
+  # the environment.  See proxy_from_env for details.
+  #
+  # In order to use a URI for the proxy you may need to do some extra work
+  # beyond URI parsing if the proxy requires a password:
+  #
+  #   proxy = URI 'http://proxy.example'
+  #   proxy.user     = 'AzureDiamond'
+  #   proxy.password = 'hunter2'
+
+  def initialize name = nil, proxy = nil
+    @name = name
+
+    @debug_output     = nil
+    @proxy_uri        = nil
+    @no_proxy         = []
+    @headers          = {}
+    @override_headers = {}
+    @http_versions    = {}
+    @keep_alive       = 30
+    @open_timeout     = nil
+    @read_timeout     = nil
+    @idle_timeout     = 5
+    @max_requests     = nil
+    @socket_options   = []
+
+    @socket_options << [Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1] if
+      Socket.const_defined? :TCP_NODELAY
+
+    key = ['net_http_persistent', name].compact
+    @generation_key     = [key, 'generations'    ].join('_').intern
+    @ssl_generation_key = [key, 'ssl_generations'].join('_').intern
+    @request_key        = [key, 'requests'       ].join('_').intern
+    @timeout_key        = [key, 'timeouts'       ].join('_').intern
+
+    @certificate        = nil
+    @ca_file            = nil
+    @private_key        = nil
+    @ssl_version        = nil
+    @verify_callback    = nil
+    @verify_mode        = nil
+    @cert_store         = nil
+
+    @generation         = 0 # incremented when proxy URI changes
+    @ssl_generation     = 0 # incremented when SSL session variables change
+
+    if HAVE_OPENSSL then
+      @verify_mode        = OpenSSL::SSL::VERIFY_PEER
+      @reuse_ssl_sessions = OpenSSL::SSL.const_defined? :Session
+    end
+
+    @retry_change_requests = false
+
+    @ruby_1 = RUBY_VERSION < '2'
+    @retried_on_ruby_2 = !@ruby_1
+
+    self.proxy = proxy if proxy
+  end
+
+  ##
+  # Sets this client's OpenSSL::X509::Certificate
+
+  def certificate= certificate
+    @certificate = certificate
+
+    reconnect_ssl
+  end
+
+  # For Net::HTTP parity
+  alias cert= certificate=
+
+  ##
+  # Sets the SSL certificate authority file.
+
+  def ca_file= file
+    @ca_file = file
+
+    reconnect_ssl
+  end
+
+  ##
+  # Overrides the default SSL certificate store used for verifying
+  # connections.
+
+  def cert_store= store
+    @cert_store = store
+
+    reconnect_ssl
+  end
+
+  ##
+  # Finishes all connections on the given +thread+ that were created before
+  # the given +generation+ in the threads +generation_key+ list.
+  #
+  # See #shutdown for a bunch of scary warning about misusing this method.
+
+  def cleanup(generation, thread = Thread.current,
+              generation_key = @generation_key) # :nodoc:
+    timeouts = thread[@timeout_key]
+
+    (0...generation).each do |old_generation|
+      next unless thread[generation_key]
+
+      conns = thread[generation_key].delete old_generation
+
+      conns.each_value do |conn|
+        finish conn, thread
+
+        timeouts.delete conn.object_id if timeouts
+      end if conns
+    end
+  end
+
+  ##
+  # Creates a new connection for +uri+
+
+  def connection_for uri
+    Thread.current[@generation_key]     ||= Hash.new { |h,k| h[k] = {} }
+    Thread.current[@ssl_generation_key] ||= Hash.new { |h,k| h[k] = {} }
+    Thread.current[@request_key]        ||= Hash.new 0
+    Thread.current[@timeout_key]        ||= Hash.new EPOCH
+
+    use_ssl = uri.scheme.downcase == 'https'
+
+    if use_ssl then
+      raise Bundler::Persistent::Net::HTTP::Persistent::Error, 'OpenSSL is not available' unless
+        HAVE_OPENSSL
+
+      ssl_generation = @ssl_generation
+
+      ssl_cleanup ssl_generation
+
+      connections = Thread.current[@ssl_generation_key][ssl_generation]
+    else
+      generation = @generation
+
+      cleanup generation
+
+      connections = Thread.current[@generation_key][generation]
+    end
+
+    net_http_args = [uri.host, uri.port]
+    connection_id = net_http_args.join ':'
+
+    if @proxy_uri and not proxy_bypass? uri.host, uri.port then
+      connection_id << @proxy_connection_id
+      net_http_args.concat @proxy_args
+    end
+
+    connection = connections[connection_id]
+
+    unless connection = connections[connection_id] then
+      connections[connection_id] = http_class.new(*net_http_args)
+      connection = connections[connection_id]
+      ssl connection if use_ssl
+    else
+      reset connection if expired? connection
+    end
+
+    start connection unless connection.started?
+
+    connection.read_timeout = @read_timeout if @read_timeout
+    connection.keep_alive_timeout = @idle_timeout if @idle_timeout && connection.respond_to?(:keep_alive_timeout=)
+
+    connection
+  rescue Errno::ECONNREFUSED
+    address = connection.proxy_address || connection.address
+    port    = connection.proxy_port    || connection.port
+
+    raise Error, "connection refused: #{address}:#{port}"
+  rescue Errno::EHOSTDOWN
+    address = connection.proxy_address || connection.address
+    port    = connection.proxy_port    || connection.port
+
+    raise Error, "host down: #{address}:#{port}"
+  end
+
+  ##
+  # Returns an error message containing the number of requests performed on
+  # this connection
+
+  def error_message connection
+    requests = Thread.current[@request_key][connection.object_id] - 1 # fixup
+    last_use = Thread.current[@timeout_key][connection.object_id]
+
+    age = Time.now - last_use
+
+    "after #{requests} requests on #{connection.object_id}, " \
+      "last used #{age} seconds ago"
+  end
+
+  ##
+  # URI::escape wrapper
+
+  def escape str
+    CGI.escape str if str
+  end
+
+  ##
+  # URI::unescape wrapper
+
+  def unescape str
+    CGI.unescape str if str
+  end
+
+
+  ##
+  # Returns true if the connection should be reset due to an idle timeout, or
+  # maximum request count, false otherwise.
+
+  def expired? connection
+    requests = Thread.current[@request_key][connection.object_id]
+    return true  if     @max_requests && requests >= @max_requests
+    return false unless @idle_timeout
+    return true  if     @idle_timeout.zero?
+
+    last_used = Thread.current[@timeout_key][connection.object_id]
+
+    Time.now - last_used > @idle_timeout
+  end
+
+  ##
+  # Starts the Net::HTTP +connection+
+
+  def start connection
+    connection.set_debug_output @debug_output if @debug_output
+    connection.open_timeout = @open_timeout if @open_timeout
+
+    connection.start
+
+    socket = connection.instance_variable_get :@socket
+
+    if socket then # for fakeweb
+      @socket_options.each do |option|
+        socket.io.setsockopt(*option)
+      end
+    end
+  end
+
+  ##
+  # Finishes the Net::HTTP +connection+
+
+  def finish connection, thread = Thread.current
+    if requests = thread[@request_key] then
+      requests.delete connection.object_id
+    end
+
+    connection.finish
+  rescue IOError
+  end
+
+  def http_class # :nodoc:
+    if RUBY_VERSION > '2.0' then
+      Net::HTTP
+    elsif [:Artifice, :FakeWeb, :WebMock].any? { |klass|
+             Object.const_defined?(klass)
+          } or not @reuse_ssl_sessions then
+        Net::HTTP
+    else
+      Bundler::Persistent::Net::HTTP::Persistent::SSLReuse
+    end
+  end
+
+  ##
+  # Returns the HTTP protocol version for +uri+
+
+  def http_version uri
+    @http_versions["#{uri.host}:#{uri.port}"]
+  end
+
+  ##
+  # Is +req+ idempotent according to RFC 2616?
+
+  def idempotent? req
+    case req
+    when Net::HTTP::Delete, Net::HTTP::Get, Net::HTTP::Head,
+         Net::HTTP::Options, Net::HTTP::Put, Net::HTTP::Trace then
+      true
+    end
+  end
+
+  ##
+  # Is the request +req+ idempotent or is retry_change_requests allowed.
+  #
+  # If +retried_on_ruby_2+ is true, true will be returned if we are on ruby,
+  # retry_change_requests is allowed and the request is not idempotent.
+
+  def can_retry? req, retried_on_ruby_2 = false
+    return @retry_change_requests && !idempotent?(req) if retried_on_ruby_2
+
+    @retry_change_requests || idempotent?(req)
+  end
+
+  if RUBY_VERSION > '1.9' then
+    ##
+    # Workaround for missing Net::HTTPHeader#connection_close? on Ruby 1.8
+
+    def connection_close? header
+      header.connection_close?
+    end
+
+    ##
+    # Workaround for missing Net::HTTPHeader#connection_keep_alive? on Ruby 1.8
+
+    def connection_keep_alive? header
+      header.connection_keep_alive?
+    end
+  else
+    ##
+    # Workaround for missing Net::HTTPRequest#connection_close? on Ruby 1.8
+
+    def connection_close? header
+      header['connection'] =~ /close/ or header['proxy-connection'] =~ /close/
+    end
+
+    ##
+    # Workaround for missing Net::HTTPRequest#connection_keep_alive? on Ruby
+    # 1.8
+
+    def connection_keep_alive? header
+      header['connection'] =~ /keep-alive/ or
+        header['proxy-connection'] =~ /keep-alive/
+    end
+  end
+
+  ##
+  # Deprecated in favor of #expired?
+
+  def max_age # :nodoc:
+    return Time.now + 1 unless @idle_timeout
+
+    Time.now - @idle_timeout
+  end
+
+  ##
+  # Adds "http://" to the String +uri+ if it is missing.
+
+  def normalize_uri uri
+    (uri =~ /^https?:/) ? uri : "http://#{uri}"
+  end
+
+  ##
+  # Pipelines +requests+ to the HTTP server at +uri+ yielding responses if a
+  # block is given.  Returns all responses recieved.
+  #
+  # See
+  # Net::HTTP::Pipeline[http://docs.seattlerb.org/net-http-pipeline/Net/HTTP/Pipeline.html]
+  # for further details.
+  #
+  # Only if <tt>net-http-pipeline</tt> was required before
+  # <tt>net-http-persistent</tt> #pipeline will be present.
+
+  def pipeline uri, requests, &block # :yields: responses
+    connection = connection_for uri
+
+    connection.pipeline requests, &block
+  end
+
+  ##
+  # Sets this client's SSL private key
+
+  def private_key= key
+    @private_key = key
+
+    reconnect_ssl
+  end
+
+  # For Net::HTTP parity
+  alias key= private_key=
+
+  ##
+  # Sets the proxy server.  The +proxy+ may be the URI of the proxy server,
+  # the symbol +:ENV+ which will read the proxy from the environment or nil to
+  # disable use of a proxy.  See #proxy_from_env for details on setting the
+  # proxy from the environment.
+  #
+  # If the proxy URI is set after requests have been made, the next request
+  # will shut-down and re-open all connections.
+  #
+  # The +no_proxy+ query parameter can be used to specify hosts which shouldn't
+  # be reached via proxy; if set it should be a comma separated list of
+  # hostname suffixes, optionally with +:port+ appended, for example
+  # <tt>example.com,some.host:8080</tt>.
+
+  def proxy= proxy
+    @proxy_uri = case proxy
+                 when :ENV      then proxy_from_env
+                 when URI::HTTP then proxy
+                 when nil       then # ignore
+                 else raise ArgumentError, 'proxy must be :ENV or a URI::HTTP'
+                 end
+
+    @no_proxy.clear
+
+    if @proxy_uri then
+      @proxy_args = [
+        @proxy_uri.host,
+        @proxy_uri.port,
+        unescape(@proxy_uri.user),
+        unescape(@proxy_uri.password),
+      ]
+
+      @proxy_connection_id = [nil, *@proxy_args].join ':'
+
+      if @proxy_uri.query then
+        @no_proxy = CGI.parse(@proxy_uri.query)['no_proxy'].join(',').downcase.split(',').map { |x| x.strip }.reject { |x| x.empty? }
+      end
+    end
+
+    reconnect
+    reconnect_ssl
+  end
+
+  ##
+  # Creates a URI for an HTTP proxy server from ENV variables.
+  #
+  # If +HTTP_PROXY+ is set a proxy will be returned.
+  #
+  # If +HTTP_PROXY_USER+ or +HTTP_PROXY_PASS+ are set the URI is given the
+  # indicated user and password unless HTTP_PROXY contains either of these in
+  # the URI.
+  #
+  # The +NO_PROXY+ ENV variable can be used to specify hosts which shouldn't
+  # be reached via proxy; if set it should be a comma separated list of
+  # hostname suffixes, optionally with +:port+ appended, for example
+  # <tt>example.com,some.host:8080</tt>. When set to <tt>*</tt> no proxy will
+  # be returned.
+  #
+  # For Windows users, lowercase ENV variables are preferred over uppercase ENV
+  # variables.
+
+  def proxy_from_env
+    env_proxy = ENV['http_proxy'] || ENV['HTTP_PROXY']
+
+    return nil if env_proxy.nil? or env_proxy.empty?
+
+    uri = URI normalize_uri env_proxy
+
+    env_no_proxy = ENV['no_proxy'] || ENV['NO_PROXY']
+
+    # '*' is special case for always bypass
+    return nil if env_no_proxy == '*'
+
+    if env_no_proxy then
+      uri.query = "no_proxy=#{escape(env_no_proxy)}"
+    end
+
+    unless uri.user or uri.password then
+      uri.user     = escape ENV['http_proxy_user'] || ENV['HTTP_PROXY_USER']
+      uri.password = escape ENV['http_proxy_pass'] || ENV['HTTP_PROXY_PASS']
+    end
+
+    uri
+  end
+
+  ##
+  # Returns true when proxy should by bypassed for host.
+
+  def proxy_bypass? host, port
+    host = host.downcase
+    host_port = [host, port].join ':'
+
+    @no_proxy.each do |name|
+      return true if host[-name.length, name.length] == name or
+         host_port[-name.length, name.length] == name
+    end
+
+    false
+  end
+
+  ##
+  # Forces reconnection of HTTP connections.
+
+  def reconnect
+    @generation += 1
+  end
+
+  ##
+  # Forces reconnection of SSL connections.
+
+  def reconnect_ssl
+    @ssl_generation += 1
+  end
+
+  ##
+  # Finishes then restarts the Net::HTTP +connection+
+
+  def reset connection
+    Thread.current[@request_key].delete connection.object_id
+    Thread.current[@timeout_key].delete connection.object_id
+
+    finish connection
+
+    start connection
+  rescue Errno::ECONNREFUSED
+    e = Error.new "connection refused: #{connection.address}:#{connection.port}"
+    e.set_backtrace $@
+    raise e
+  rescue Errno::EHOSTDOWN
+    e = Error.new "host down: #{connection.address}:#{connection.port}"
+    e.set_backtrace $@
+    raise e
+  end
+
+  ##
+  # Makes a request on +uri+.  If +req+ is nil a Net::HTTP::Get is performed
+  # against +uri+.
+  #
+  # If a block is passed #request behaves like Net::HTTP#request (the body of
+  # the response will not have been read).
+  #
+  # +req+ must be a Net::HTTPRequest subclass (see Net::HTTP for a list).
+  #
+  # If there is an error and the request is idempotent according to RFC 2616
+  # it will be retried automatically.
+
+  def request uri, req = nil, &block
+    retried      = false
+    bad_response = false
+
+    req = request_setup req || uri
+
+    connection = connection_for uri
+    connection_id = connection.object_id
+
+    begin
+      Thread.current[@request_key][connection_id] += 1
+      response = connection.request req, &block
+
+      if connection_close?(req) or
+         (response.http_version <= '1.0' and
+          not connection_keep_alive?(response)) or
+         connection_close?(response) then
+        connection.finish
+      end
+    rescue Net::HTTPBadResponse => e
+      message = error_message connection
+
+      finish connection
+
+      raise Error, "too many bad responses #{message}" if
+        bad_response or not can_retry? req
+
+      bad_response = true
+      retry
+    rescue *RETRIED_EXCEPTIONS => e # retried on ruby 2
+      request_failed e, req, connection if
+        retried or not can_retry? req, @retried_on_ruby_2
+
+      reset connection
+
+      retried = true
+      retry
+    rescue Errno::EINVAL, Errno::ETIMEDOUT => e # not retried on ruby 2
+      request_failed e, req, connection if retried or not can_retry? req
+
+      reset connection
+
+      retried = true
+      retry
+    rescue Exception => e
+      finish connection
+
+      raise
+    ensure
+      Thread.current[@timeout_key][connection_id] = Time.now
+    end
+
+    @http_versions["#{uri.host}:#{uri.port}"] ||= response.http_version
+
+    response
+  end
+
+  ##
+  # Raises an Error for +exception+ which resulted from attempting the request
+  # +req+ on the +connection+.
+  #
+  # Finishes the +connection+.
+
+  def request_failed exception, req, connection # :nodoc:
+    due_to = "(due to #{exception.message} - #{exception.class})"
+    message = "too many connection resets #{due_to} #{error_message connection}"
+
+    finish connection
+
+
+    raise Error, message, exception.backtrace
+  end
+
+  ##
+  # Creates a GET request if +req_or_uri+ is a URI and adds headers to the
+  # request.
+  #
+  # Returns the request.
+
+  def request_setup req_or_uri # :nodoc:
+    req = if URI === req_or_uri then
+            Net::HTTP::Get.new req_or_uri.request_uri
+          else
+            req_or_uri
+          end
+
+    @headers.each do |pair|
+      req.add_field(*pair)
+    end
+
+    @override_headers.each do |name, value|
+      req[name] = value
+    end
+
+    unless req['Connection'] then
+      req.add_field 'Connection', 'keep-alive'
+      req.add_field 'Keep-Alive', @keep_alive
+    end
+
+    req
+  end
+
+  ##
+  # Shuts down all connections for +thread+.
+  #
+  # Uses the current thread by default.
+  #
+  # If you've used Bundler::Persistent::Net::HTTP::Persistent across multiple threads you should
+  # call this in each thread when you're done making HTTP requests.
+  #
+  # *NOTE*: Calling shutdown for another thread can be dangerous!
+  #
+  # If the thread is still using the connection it may cause an error!  It is
+  # best to call #shutdown in the thread at the appropriate time instead!
+
+  def shutdown thread = Thread.current
+    generation = reconnect
+    cleanup generation, thread, @generation_key
+
+    ssl_generation = reconnect_ssl
+    cleanup ssl_generation, thread, @ssl_generation_key
+
+    thread[@request_key] = nil
+    thread[@timeout_key] = nil
+  end
+
+  ##
+  # Shuts down all connections in all threads
+  #
+  # *NOTE*: THIS METHOD IS VERY DANGEROUS!
+  #
+  # Do not call this method if other threads are still using their
+  # connections!  Call #shutdown at the appropriate time instead!
+  #
+  # Use this method only as a last resort!
+
+  def shutdown_in_all_threads
+    Thread.list.each do |thread|
+      shutdown thread
+    end
+
+    nil
+  end
+
+  ##
+  # Enables SSL on +connection+
+
+  def ssl connection
+    connection.use_ssl = true
+
+    connection.ssl_version = @ssl_version if @ssl_version
+
+    connection.verify_mode = @verify_mode
+
+    if OpenSSL::SSL::VERIFY_PEER == OpenSSL::SSL::VERIFY_NONE and
+       not Object.const_defined?(:I_KNOW_THAT_OPENSSL_VERIFY_PEER_EQUALS_VERIFY_NONE_IS_WRONG) then
+      warn <<-WARNING
+                             !!!SECURITY WARNING!!!
+
+The SSL HTTP connection to:
+
+  #{connection.address}:#{connection.port}
+
+                           !!!MAY NOT BE VERIFIED!!!
+
+On your platform your OpenSSL implementation is broken.
+
+There is no difference between the values of VERIFY_NONE and VERIFY_PEER.
+
+This means that attempting to verify the security of SSL connections may not
+work.  This exposes you to man-in-the-middle exploits, snooping on the
+contents of your connection and other dangers to the security of your data.
+
+To disable this warning define the following constant at top-level in your
+application:
+
+  I_KNOW_THAT_OPENSSL_VERIFY_PEER_EQUALS_VERIFY_NONE_IS_WRONG = nil
+
+      WARNING
+    end
+
+    if @ca_file then
+      connection.ca_file = @ca_file
+      connection.verify_mode = OpenSSL::SSL::VERIFY_PEER
+      connection.verify_callback = @verify_callback if @verify_callback
+    end
+
+    if @certificate and @private_key then
+      connection.cert = @certificate
+      connection.key  = @private_key
+    end
+
+    connection.cert_store = if @cert_store then
+                              @cert_store
+                            else
+                              store = OpenSSL::X509::Store.new
+                              store.set_default_paths
+                              store
+                            end
+  end
+
+  ##
+  # Finishes all connections that existed before the given SSL parameter
+  # +generation+.
+
+  def ssl_cleanup generation # :nodoc:
+    cleanup generation, Thread.current, @ssl_generation_key
+  end
+
+  ##
+  # SSL version to use
+
+  def ssl_version= ssl_version
+    @ssl_version = ssl_version
+
+    reconnect_ssl
+  end if RUBY_VERSION > '1.9'
+
+  ##
+  # Sets the HTTPS verify mode.  Defaults to OpenSSL::SSL::VERIFY_PEER.
+  #
+  # Setting this to VERIFY_NONE is a VERY BAD IDEA and should NEVER be used.
+  # Securely transfer the correct certificate and update the default
+  # certificate store or set the ca file instead.
+
+  def verify_mode= verify_mode
+    @verify_mode = verify_mode
+
+    reconnect_ssl
+  end
+
+  ##
+  # SSL verification callback.
+
+  def verify_callback= callback
+    @verify_callback = callback
+
+    reconnect_ssl
+  end
+
+end
+
+require 'bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse'
+
diff --git a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb
new file mode 100644
index 0000000..1b6b789
--- /dev/null
+++ b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb
@@ -0,0 +1,129 @@
+##
+# This Net::HTTP subclass adds SSL session reuse and Server Name Indication
+# (SNI) RFC 3546.
+#
+# DO NOT DEPEND UPON THIS CLASS
+#
+# This class is an implementation detail and is subject to change or removal
+# at any time.
+
+class Bundler::Persistent::Net::HTTP::Persistent::SSLReuse < Net::HTTP
+
+  @is_proxy_class = false
+  @proxy_addr = nil
+  @proxy_port = nil
+  @proxy_user = nil
+  @proxy_pass = nil
+
+  def initialize address, port = nil # :nodoc:
+    super
+
+    @ssl_session = nil
+  end
+
+  ##
+  # From ruby trunk r33086 including http://redmine.ruby-lang.org/issues/5341
+
+  def connect # :nodoc:
+    D "opening connection to #{conn_address()}..."
+    s = timeout(@open_timeout) { TCPSocket.open(conn_address(), conn_port()) }
+    D "opened"
+    if use_ssl?
+      ssl_parameters = Hash.new
+      iv_list = instance_variables
+      SSL_ATTRIBUTES.each do |name|
+        ivname = "@#{name}".intern
+        if iv_list.include?(ivname) and
+           value = instance_variable_get(ivname)
+          ssl_parameters[name] = value
+        end
+      end
+      unless @ssl_context then
+        @ssl_context = OpenSSL::SSL::SSLContext.new
+        @ssl_context.set_params(ssl_parameters)
+      end
+      s = OpenSSL::SSL::SSLSocket.new(s, @ssl_context)
+      s.sync_close = true
+    end
+    @socket = Net::BufferedIO.new(s)
+    @socket.read_timeout = @read_timeout
+    @socket.continue_timeout = @continue_timeout if
+      @socket.respond_to? :continue_timeout
+    @socket.debug_output = @debug_output
+    if use_ssl?
+      begin
+        if proxy?
+          @socket.writeline sprintf('CONNECT %s:%s HTTP/%s',
+                                    @address, @port, HTTPVersion)
+          @socket.writeline "Host: #{@address}:#{@port}"
+          if proxy_user
+            credential = ["#{proxy_user}:#{proxy_pass}"].pack('m')
+            credential.delete!("\r\n")
+            @socket.writeline "Proxy-Authorization: Basic #{credential}"
+          end
+          @socket.writeline ''
+          Net::HTTPResponse.read_new(@socket).value
+        end
+        s.session = @ssl_session if @ssl_session
+        # Server Name Indication (SNI) RFC 3546
+        s.hostname = @address if s.respond_to? :hostname=
+        timeout(@open_timeout) { s.connect }
+        if @ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE
+          s.post_connection_check(@address)
+        end
+        @ssl_session = s.session
+      rescue => exception
+        D "Conn close because of connect error #{exception}"
+        @socket.close if @socket and not @socket.closed?
+        raise exception
+      end
+    end
+    on_connect
+  end if RUBY_VERSION > '1.9'
+
+  ##
+  # From ruby_1_8_7 branch r29865 including a modified
+  # http://redmine.ruby-lang.org/issues/5341
+
+  def connect # :nodoc:
+    D "opening connection to #{conn_address()}..."
+    s = timeout(@open_timeout) { TCPSocket.open(conn_address(), conn_port()) }
+    D "opened"
+    if use_ssl?
+      unless @ssl_context.verify_mode
+        warn "warning: peer certificate won't be verified in this SSL session"
+        @ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
+      end
+      s = OpenSSL::SSL::SSLSocket.new(s, @ssl_context)
+      s.sync_close = true
+    end
+    @socket = Net::BufferedIO.new(s)
+    @socket.read_timeout = @read_timeout
+    @socket.debug_output = @debug_output
+    if use_ssl?
+      if proxy?
+        @socket.writeline sprintf('CONNECT %s:%s HTTP/%s',
+                                  @address, @port, HTTPVersion)
+        @socket.writeline "Host: #{@address}:#{@port}"
+        if proxy_user
+          credential = ["#{proxy_user}:#{proxy_pass}"].pack('m')
+          credential.delete!("\r\n")
+          @socket.writeline "Proxy-Authorization: Basic #{credential}"
+        end
+        @socket.writeline ''
+        Net::HTTPResponse.read_new(@socket).value
+      end
+      s.session = @ssl_session if @ssl_session
+      s.connect
+      if @ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE
+        s.post_connection_check(@address)
+      end
+      @ssl_session = s.session
+    end
+    on_connect
+  end if RUBY_VERSION < '1.9'
+
+  private :connect
+
+end
+
diff --git a/lib/bundler/vendored_persistent.rb b/lib/bundler/vendored_persistent.rb
index d5ae513..729ac6b 100644
--- a/lib/bundler/vendored_persistent.rb
+++ b/lib/bundler/vendored_persistent.rb
@@ -6,7 +6,12 @@ begin
 rescue LoadError
   # some Ruby builds don't have OpenSSL
 end
-
-vendor = File.expand_path("../vendor", __FILE__)
-$:.unshift(vendor) unless $:.include?(vendor)
-require "net/http/persistent"
+module Bundler
+  module Persistent
+    module Net
+      module HTTP
+      end
+    end
+  end
+end
+require "bundler/vendor/net-http-persistent/lib/net/http/persistent"
diff --git a/lib/bundler/vendored_thor.rb b/lib/bundler/vendored_thor.rb
index 0d0b45b..4a5d0cf 100644
--- a/lib/bundler/vendored_thor.rb
+++ b/lib/bundler/vendored_thor.rb
@@ -1,4 +1,7 @@
 # frozen_string_literal: true
-module Bundler; end
+module Bundler
+  def self.require_thor_actions
+    Kernel.send(:require, "bundler/vendor/thor/lib/thor/actions")
+  end
+end
 require "bundler/vendor/thor/lib/thor"
-require "bundler/vendor/thor/lib/thor/actions"
diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb
index 9cd9fb0..3f9a121 100644
--- a/lib/bundler/version.rb
+++ b/lib/bundler/version.rb
@@ -7,5 +7,18 @@ module Bundler
   # We're doing this because we might write tests that deal
   # with other versions of bundler and we are unsure how to
   # handle this better.
-  VERSION = "1.13.6" unless defined?(::Bundler::VERSION)
+  VERSION = "1.15.1" unless defined?(::Bundler::VERSION)
+
+  def self.overwrite_loaded_gem_version
+    begin
+      require "rubygems"
+    rescue LoadError
+      return
+    end
+    return unless bundler_spec = Gem.loaded_specs["bundler"]
+    return if bundler_spec.version == VERSION
+    bundler_spec.version = Bundler::VERSION
+  end
+  private_class_method :overwrite_loaded_gem_version
+  overwrite_loaded_gem_version
 end
diff --git a/lib/bundler/version_ranges.rb b/lib/bundler/version_ranges.rb
new file mode 100644
index 0000000..1ee8440
--- /dev/null
+++ b/lib/bundler/version_ranges.rb
@@ -0,0 +1,75 @@
+# frozen_string_literal: true
+module Bundler
+  module VersionRanges
+    NEq = Struct.new(:version)
+    ReqR = Struct.new(:left, :right)
+    class ReqR
+      Endpoint = Struct.new(:version, :inclusive)
+      def to_s
+        "#{left.inclusive ? "[" : "("}#{left.version}, #{right.version}#{right.inclusive ? "]" : ")"}"
+      end
+      INFINITY = Object.new.freeze
+      ZERO = Gem::Version.new("0.a")
+
+      def cover?(v)
+        return false if left.inclusive && left.version > v
+        return false if !left.inclusive && left.version >= v
+
+        if right.version != INFINITY
+          return false if right.inclusive && right.version < v
+          return false if !right.inclusive && right.version <= v
+        end
+
+        true
+      end
+
+      def empty?
+        left.version == right.version && !(left.inclusive && right.inclusive)
+      end
+
+      def single?
+        left.version == right.version
+      end
+
+      UNIVERSAL = ReqR.new(ReqR::Endpoint.new(Gem::Version.new("0.a"), true), ReqR::Endpoint.new(ReqR::INFINITY, false)).freeze
+    end
+
+    def self.for_many(requirements)
+      requirements = requirements.map(&:requirements).flatten(1).map {|r| r.join(" ") }
+      requirements << ">= 0.a" if requirements.empty?
+      requirement = Gem::Requirement.new(requirements)
+      self.for(requirement)
+    end
+
+    def self.for(requirement)
+      ranges = requirement.requirements.map do |op, v|
+        case op
+        when "=" then ReqR.new(ReqR::Endpoint.new(v, true), ReqR::Endpoint.new(v, true))
+        when "!=" then NEq.new(v)
+        when ">=" then ReqR.new(ReqR::Endpoint.new(v, true), ReqR::Endpoint.new(ReqR::INFINITY, false))
+        when ">" then ReqR.new(ReqR::Endpoint.new(v, false), ReqR::Endpoint.new(ReqR::INFINITY, false))
+        when "<" then ReqR.new(ReqR::Endpoint.new(ReqR::ZERO, true), ReqR::Endpoint.new(v, false))
+        when "<=" then ReqR.new(ReqR::Endpoint.new(ReqR::ZERO, true), ReqR::Endpoint.new(v, true))
+        when "~>" then ReqR.new(ReqR::Endpoint.new(v, true), ReqR::Endpoint.new(v.bump, false))
+        else raise "unknown version op #{op} in requirement #{requirement}"
+        end
+      end.uniq
+      ranges, neqs = ranges.partition {|r| !r.is_a?(NEq) }
+
+      [ranges.sort_by {|range| [range.left.version, range.left.inclusive ? 0 : 1] }, neqs.map(&:version)]
+    end
+
+    def self.empty?(ranges, neqs)
+      !ranges.reduce(ReqR::UNIVERSAL) do |last_range, curr_range|
+        next false unless last_range
+        next false if curr_range.single? && neqs.include?(curr_range.left.version)
+        next curr_range if last_range.right.version == ReqR::INFINITY
+        case last_range.right.version <=> curr_range.left.version
+        when 1 then next curr_range
+        when 0 then next(last_range.right.inclusive && curr_range.left.inclusive && !neqs.include?(curr_range.left.version) && curr_range)
+        when -1 then next false
+        end
+      end
+    end
+  end
+end
diff --git a/lib/bundler/worker.rb b/lib/bundler/worker.rb
index 3ef5add..b73a7ed 100644
--- a/lib/bundler/worker.rb
+++ b/lib/bundler/worker.rb
@@ -25,18 +25,16 @@ module Bundler
       @request_queue = Queue.new
       @response_queue = Queue.new
       @func = func
-      @threads = Array.new(size) do |i|
-        Thread.start { process_queue(i) }.tap do |thread|
-          thread.name = "#{name} Worker ##{i}" if thread.respond_to?(:name=)
-        end
-      end
-      trap("INT") { abort_threads }
+      @size = size
+      @threads = nil
+      SharedHelpers.trap("INT") { abort_threads }
     end
 
     # Enqueue a request to be executed in the worker pool
     #
     # @param obj [String] mostly it is name of spec that should be downloaded
     def enq(obj)
+      create_threads unless @threads
       @request_queue.enq obj
     end
 
@@ -70,13 +68,38 @@ module Bundler
     # Stop the worker threads by sending a poison object down the request queue
     # so as worker threads after retrieving it, shut themselves down
     def stop_threads
+      return unless @threads
       @threads.each { @request_queue.enq POISON }
       @threads.each(&:join)
+      @threads = nil
     end
 
     def abort_threads
+      return unless @threads
+      Bundler.ui.debug("\n#{caller.join("\n")}")
       @threads.each(&:exit)
       exit 1
     end
+
+    def create_threads
+      creation_errors = []
+
+      @threads = Array.new(@size) do |i|
+        begin
+          Thread.start { process_queue(i) }.tap do |thread|
+            thread.name = "#{name} Worker ##{i}" if thread.respond_to?(:name=)
+          end
+        rescue ThreadError => e
+          creation_errors << e
+          nil
+        end
+      end.compact
+
+      return if creation_errors.empty?
+
+      message = "Failed to create threads for the #{name} worker: #{creation_errors.map(&:to_s).uniq.join(", ")}"
+      raise ThreadCreationError, message if @threads.empty?
+      Bundler.ui.info message
+    end
   end
 end
diff --git a/lib/bundler/yaml_serializer.rb b/lib/bundler/yaml_serializer.rb
index dede8fd..3c9ecca 100644
--- a/lib/bundler/yaml_serializer.rb
+++ b/lib/bundler/yaml_serializer.rb
@@ -52,7 +52,7 @@ module Bundler
       stack = [res]
       last_hash = nil
       last_empty_key = nil
-      str.split("\n").each do |line|
+      str.split(/\r?\n/).each do |line|
         if match = HASH_REGEX.match(line)
           indent, key, _, val = match.captures
           key = convert_to_backward_compatible_key(key)
diff --git a/man/bundle-add.1 b/man/bundle-add.1
new file mode 100644
index 0000000..6c03ca2
--- /dev/null
+++ b/man/bundle-add.1
@@ -0,0 +1,43 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-ADD" "1" "May 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
+.
+.SH "SYNOPSIS"
+\fBbundle add\fR \fIGEM_NAME\fR [\-\-group=GROUP] [\-\-version=VERSION] [\-\-source=SOURCE]
+.
+.SH "DESCRIPTION"
+Adds the named gem to the Gemfile and run \fBbundle install\fR\.
+.
+.P
+Example:
+.
+.P
+bundle add rails
+.
+.P
+bundle add rails \-\-version "< 3\.0, > 1\.1"
+.
+.P
+bundle add rails \-\-version "~> 5\.0\.0" \-\-source "https://gems\.example\.com" \-\-group "development"
+.
+.P
+bundle add rails \-\-group "development, test"
+.
+.SH "OPTIONS"
+.
+.TP
+\fB\-\-version\fR, \fB\-v\fR
+Specify version requirements(s) for the added gem\.
+.
+.TP
+\fB\-\-group\fR, \fB\-g\fR
+Specify the group(s) for the added gem\. Multiple groups should be separated by commas\.
+.
+.TP
+\fB\-\-source\fR, , \fB\-s\fR
+Specify the source for the added gem\.
+
diff --git a/man/bundle-add.1.txt b/man/bundle-add.1.txt
new file mode 100644
index 0000000..5b9e116
--- /dev/null
+++ b/man/bundle-add.1.txt
@@ -0,0 +1,40 @@
+BUNDLE-ADD(1)							 BUNDLE-ADD(1)
+
+
+
+1mNAME0m
+       1mbundle-add 22m- Add gem to the Gemfile and run bundle install
+
+1mSYNOPSIS0m
+       1mbundle     add     4m22mGEM_NAME24m	 [--group=GROUP]     [--version=VERSION]
+       [--source=SOURCE]
+
+1mDESCRIPTION0m
+       Adds the named gem to the Gemfile and run 1mbundle install22m.
+
+       Example:
+
+       bundle add rails
+
+       bundle add rails --version "< 3.0, > 1.1"
+
+       bundle add rails  --version  "~>  5.0.0"  --source  "https://gems.exam-
+       ple.com" --group "development"
+
+       bundle add rails --group "development, test"
+
+1mOPTIONS0m
+       1m--version22m, 1m-v0m
+	      Specify version requirements(s) for the added gem.
+
+       1m--group22m, 1m-g0m
+	      Specify  the  group(s) for the added gem. Multiple groups should
+	      be separated by commas.
+
+       1m--source22m, , 1m-s0m
+	      Specify the source for the added gem.
+
+
+
+
+				   May 2017			 BUNDLE-ADD(1)
diff --git a/man/bundle-add.ronn b/man/bundle-add.ronn
new file mode 100644
index 0000000..f0f9b54
--- /dev/null
+++ b/man/bundle-add.ronn
@@ -0,0 +1,29 @@
+bundle-add(1) -- Add gem to the Gemfile and run bundle install
+================================================================
+
+## SYNOPSIS
+
+`bundle add` <GEM_NAME> [--group=GROUP] [--version=VERSION] [--source=SOURCE]
+
+## DESCRIPTION
+Adds the named gem to the Gemfile and run `bundle install`.
+
+Example:
+
+bundle add rails
+
+bundle add rails --version "< 3.0, > 1.1"
+
+bundle add rails --version "~> 5.0.0" --source "https://gems.example.com" --group "development"
+
+bundle add rails --group "development, test"
+
+## OPTIONS
+* `--version`, `-v`:
+  Specify version requirements(s) for the added gem.
+
+* `--group`, `-g`:
+  Specify the group(s) for the added gem. Multiple groups should be separated by commas.
+
+* `--source`, , `-s`:
+  Specify the source for the added gem.
diff --git a/man/bundle-binstubs.1 b/man/bundle-binstubs.1
new file mode 100644
index 0000000..fc5fa4e
--- /dev/null
+++ b/man/bundle-binstubs.1
@@ -0,0 +1,30 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-BINSTUBS" "1" "January 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
+.
+.SH "SYNOPSIS"
+\fBbundle binstubs\fR \fIGEM_NAME\fR [\-\-force] [\-\-path PATH] [\-\-standalone]
+.
+.SH "DESCRIPTION"
+This command generates binstubs for executables in \fBGEM_NAME\fR\. Binstubs are put into \fBbin\fR, or the \fB\-\-path\fR directory if one has been set\. Calling binstubs with [GEM [GEM]] will create binstubs for all given gems\.
+.
+.SH "OPTIONS"
+.
+.TP
+\fB\-\-force\fR
+Overwrite existing binstubs if they exist\.
+.
+.TP
+\fB\-\-path\fR
+The location to install the specified binstubs to\. This defaults to \fBbin\fR\.
+.
+.TP
+\fB\-\-standalone\fR
+Makes binstubs that can work without depending on Rubygems or Bundler at runtime\.
+.
+.SH "BUNDLE INSTALL \-\-BINSTUBS"
+To create binstubs for all the gems in the bundle you can use the \fB\-\-binstubs\fR flag in bundle install(1) \fIbundle\-install\.1\.html\fR\.
diff --git a/man/bundle-binstubs.1.txt b/man/bundle-binstubs.1.txt
new file mode 100644
index 0000000..ebfbeae
--- /dev/null
+++ b/man/bundle-binstubs.1.txt
@@ -0,0 +1,33 @@
+BUNDLE-BINSTUBS(1)					    BUNDLE-BINSTUBS(1)
+
+
+
+1mNAME0m
+       1mbundle-binstubs 22m- Install the binstubs of the listed gems
+
+1mSYNOPSIS0m
+       1mbundle binstubs 4m22mGEM_NAME24m [--force] [--path PATH] [--standalone]
+
+1mDESCRIPTION0m
+       This  command  generates binstubs for executables in 1mGEM_NAME22m. Binstubs
+       are put into 1mbin22m, or the 1m--path 22mdirectory if one has been set.  Calling
+       binstubs with [GEM [GEM]] will create binstubs for all given gems.
+
+1mOPTIONS0m
+       1m--force0m
+	      Overwrite existing binstubs if they exist.
+
+       1m--path 22mThe location to install the specified binstubs to. This defaults
+	      to 1mbin22m.
+
+       1m--standalone0m
+	      Makes binstubs that can work without depending  on  Rubygems  or
+	      Bundler at runtime.
+
+1mBUNDLE INSTALL --BINSTUBS0m
+       To  create  binstubs  for  all  the  gems in the bundle you can use the
+       1m--binstubs 22mflag in bundle install(1) 4mbundle-install.1.html24m.
+
+
+
+				 January 2017		    BUNDLE-BINSTUBS(1)
diff --git a/man/bundle-check.1 b/man/bundle-check.1
new file mode 100644
index 0000000..604778c
--- /dev/null
+++ b/man/bundle-check.1
@@ -0,0 +1,31 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-CHECK" "1" "May 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
+.
+.SH "SYNOPSIS"
+\fBbundle check\fR [\-\-dry\-run] [\-\-gemfile=FILE] [\-\-path=PATH]
+.
+.SH "DESCRIPTION"
+\fBcheck\fR searches the local machine for each of the gems requested in the Gemfile\. If all gems are found, Bundler prints a success message and exits with a status of 0\.
+.
+.P
+If not, the first missing gem is listed and Bundler exits status 1\.
+.
+.SH "OPTIONS"
+.
+.TP
+\fB\-\-dry\-run\fR
+Locks the \fBGemfile(5)\fR before running the command\.
+.
+.TP
+\fB\-\-gemfile\fR
+Use the specified gemfile instead of the \fBGemfile(5)\fR
+.
+.TP
+\fB\-\-path\fR
+Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME)\. Bundler will remember this value for future installs on this machine\.
+
diff --git a/man/bundle-check.1.txt b/man/bundle-check.1.txt
new file mode 100644
index 0000000..0271305
--- /dev/null
+++ b/man/bundle-check.1.txt
@@ -0,0 +1,32 @@
+BUNDLE-CHECK(1) 					       BUNDLE-CHECK(1)
+
+
+
+1mNAME0m
+       1mbundle-check 22m- Verifies if dependencies are satisfied by installed gems
+
+1mSYNOPSIS0m
+       1mbundle check 22m[--dry-run] [--gemfile=FILE] [--path=PATH]
+
+1mDESCRIPTION0m
+       1mcheck	22msearches the local machine for each of the gems requested in the
+       Gemfile. If all gems are found, Bundler prints a  success  message  and
+       exits with a status of 0.
+
+       If not, the first missing gem is listed and Bundler exits status 1.
+
+1mOPTIONS0m
+       1m--dry-run0m
+	      Locks the 1mGemfile(5) 22mbefore running the command.
+
+       1m--gemfile0m
+	      Use the specified gemfile instead of the 1mGemfile(5)0m
+
+       1m--path 22mSpecify  a  different path than the system default ($BUNDLE_PATH
+	      or $GEM_HOME). Bundler  will  remember  this  value  for	future
+	      installs on this machine.
+
+
+
+
+				   May 2017		       BUNDLE-CHECK(1)
diff --git a/man/bundle-check.ronn b/man/bundle-check.ronn
new file mode 100644
index 0000000..b299da4
--- /dev/null
+++ b/man/bundle-check.ronn
@@ -0,0 +1,26 @@
+bundle-check(1) -- Verifies if dependencies are satisfied by installed gems
+===========================================================================
+
+## SYNOPSIS
+
+`bundle check` [--dry-run]
+               [--gemfile=FILE]
+               [--path=PATH]
+
+## DESCRIPTION
+
+`check` searches the local machine for each of the gems requested in the
+Gemfile. If all gems are found, Bundler prints a success message and exits with
+a status of 0.
+
+If not, the first missing gem is listed and Bundler exits status 1.
+
+## OPTIONS
+
+* `--dry-run`:
+  Locks the `Gemfile(5)` before running the command.
+* `--gemfile`:
+  Use the specified gemfile instead of the `Gemfile(5)`
+* `--path`:
+  Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).
+  Bundler will remember this value for future installs on this machine.
diff --git a/man/bundle-clean.1 b/man/bundle-clean.1
new file mode 100644
index 0000000..6c1a250
--- /dev/null
+++ b/man/bundle-clean.1
@@ -0,0 +1,24 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-CLEAN" "1" "May 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
+.
+.SH "SYNOPSIS"
+\fBbundle clean\fR [\-\-dry\-run] [\-\-force]
+.
+.SH "DESCRIPTION"
+This command will remove all unused gems in your bundler directory\. This is useful when you have made many changes to your gem dependencies\.
+.
+.SH "OPTIONS"
+.
+.TP
+\fB\-\-dry\-run\fR
+Print the changes, but do not clean the unused gems\.
+.
+.TP
+\fB\-\-force\fR
+Force a clean even if \fB\-\-path\fR is not set\.
+
diff --git a/man/bundle-clean.1.txt b/man/bundle-clean.1.txt
new file mode 100644
index 0000000..1208f32
--- /dev/null
+++ b/man/bundle-clean.1.txt
@@ -0,0 +1,26 @@
+BUNDLE-CLEAN(1) 					       BUNDLE-CLEAN(1)
+
+
+
+1mNAME0m
+       1mbundle-clean 22m- Cleans up unused gems in your bundler directory
+
+1mSYNOPSIS0m
+       1mbundle clean 22m[--dry-run] [--force]
+
+1mDESCRIPTION0m
+       This  command  will  remove  all unused gems in your bundler directory.
+       This is useful when you have made many changes to  your	gem  dependen-
+       cies.
+
+1mOPTIONS0m
+       1m--dry-run0m
+	      Print the changes, but do not clean the unused gems.
+
+       1m--force0m
+	      Force a clean even if 1m--path 22mis not set.
+
+
+
+
+				   May 2017		       BUNDLE-CLEAN(1)
diff --git a/man/bundle-clean.ronn b/man/bundle-clean.ronn
new file mode 100644
index 0000000..de23991
--- /dev/null
+++ b/man/bundle-clean.ronn
@@ -0,0 +1,18 @@
+bundle-clean(1) -- Cleans up unused gems in your bundler directory
+==================================================================
+
+## SYNOPSIS
+
+`bundle clean` [--dry-run] [--force]
+
+## DESCRIPTION
+
+This command will remove all unused gems in your bundler directory. This is
+useful when you have made many changes to your gem dependencies.
+
+## OPTIONS
+
+* `--dry-run`:
+  Print the changes, but do not clean the unused gems.
+* `--force`:
+  Force a clean even if `--path` is not set.
diff --git a/man/bundle-config.1 b/man/bundle-config.1
new file mode 100644
index 0000000..df4b983
--- /dev/null
+++ b/man/bundle-config.1
@@ -0,0 +1,397 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-CONFIG" "1" "June 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-config\fR \- Set bundler configuration options
+.
+.SH "SYNOPSIS"
+\fBbundle config\fR [\fIname\fR [\fIvalue\fR]]
+.
+.SH "DESCRIPTION"
+This command allows you to interact with bundler\'s configuration system\. Bundler retrieves its configuration from the local application (\fBapp/\.bundle/config\fR), environment variables, and the user\'s home directory (\fB~/\.bundle/config\fR), in that order of priority\.
+.
+.P
+Executing \fBbundle config\fR with no parameters will print a list of all bundler configuration for the current bundle, and where that configuration was set\.
+.
+.P
+Executing \fBbundle config <name>\fR will print the value of that configuration setting, and where it was set\.
+.
+.P
+Executing \fBbundle config <name> <value>\fR will set that configuration to the value specified for all bundles executed as the current user\. The configuration will be stored in \fB~/\.bundle/config\fR\. If \fIname\fR already is set, \fIname\fR will be overridden and user will be warned\.
+.
+.P
+Executing \fBbundle config \-\-global <name> <value>\fR works the same as above\.
+.
+.P
+Executing \fBbundle config \-\-local <name> <value>\fR will set that configuration to the local application\. The configuration will be stored in \fBapp/\.bundle/config\fR\.
+.
+.P
+Executing \fBbundle config \-\-delete <name>\fR will delete the configuration in both local and global sources\. Not compatible with \-\-global or \-\-local flag\.
+.
+.P
+Executing bundle with the \fBBUNDLE_IGNORE_CONFIG\fR environment variable set will cause it to ignore all configuration\.
+.
+.P
+Executing \fBbundle config disable_multisource true\fR upgrades the warning about the Gemfile containing multiple primary sources to an error\. Executing \fBbundle config \-\-delete disable_multisource\fR downgrades this error to a warning\.
+.
+.SH "REMEMBERING OPTIONS"
+Flags passed to \fBbundle install\fR or the Bundler runtime, such as \fB\-\-path foo\fR or \fB\-\-without production\fR, are not remembered between commands\. If these options must be remembered,they must be set using \fBbundle config\fR (e\.g\., \fBbundle config path foo\fR)\.
+.
+.P
+The options that can be configured are:
+.
+.TP
+\fBbin\fR
+Creates a directory (defaults to \fB~/bin\fR) and place any executables from the gem there\. These executables run in Bundler\'s context\. If used, you might add this directory to your environment\'s \fBPATH\fR variable\. For instance, if the \fBrails\fR gem comes with a \fBrails\fR executable, this flag will create a \fBbin/rails\fR executable that ensures that all referred dependencies will be resolved using the bundled gems\.
+.
+.TP
+\fBdeployment\fR
+In deployment mode, Bundler will \'roll\-out\' the bundle for \fBproduction\fR use\. Please check carefully if you want to have this option enabled in \fBdevelopment\fR or \fBtest\fR environments\.
+.
+.TP
+\fBpath\fR
+The location to install the specified gems to\. This defaults to Rubygems\' setting\. Bundler shares this location with Rubygems, \fBgem install \.\.\.\fR will have gem installed there, too\. Therefore, gems installed without a \fB\-\-path \.\.\.\fR setting will show up by calling \fBgem list\fR\. Accordingly, gems installed to other locations will not get listed\.
+.
+.TP
+\fBwithout\fR
+A space\-separated list of groups referencing gems to skip during installation\.
+.
+.SH "BUILD OPTIONS"
+You can use \fBbundle config\fR to give bundler the flags to pass to the gem installer every time bundler tries to install a particular gem\.
+.
+.P
+A very common example, the \fBmysql\fR gem, requires Snow Leopard users to pass configuration flags to \fBgem install\fR to specify where to find the \fBmysql_config\fR executable\.
+.
+.IP "" 4
+.
+.nf
+
+gem install mysql \-\- \-\-with\-mysql\-config=/usr/local/mysql/bin/mysql_config
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Since the specific location of that executable can change from machine to machine, you can specify these flags on a per\-machine basis\.
+.
+.IP "" 4
+.
+.nf
+
+bundle config build\.mysql \-\-with\-mysql\-config=/usr/local/mysql/bin/mysql_config
+.
+.fi
+.
+.IP "" 0
+.
+.P
+After running this command, every time bundler needs to install the \fBmysql\fR gem, it will pass along the flags you specified\.
+.
+.SH "CONFIGURATION KEYS"
+Configuration keys in bundler have two forms: the canonical form and the environment variable form\.
+.
+.P
+For instance, passing the \fB\-\-without\fR flag to bundle install(1) \fIbundle\-install\.1\.html\fR prevents Bundler from installing certain groups specified in the Gemfile(5)\. Bundler persists this value in \fBapp/\.bundle/config\fR so that calls to \fBBundler\.setup\fR do not try to find gems from the \fBGemfile\fR that you didn\'t install\. Additionally, subsequent calls to bundle install(1) \fIbundle\-install\.1\.html\fR remember this setting and skip those groups\.
+.
+.P
+The canonical form of this configuration is \fB"without"\fR\. To convert the canonical form to the environment variable form, capitalize it, and prepend \fBBUNDLE_\fR\. The environment variable form of \fB"without"\fR is \fBBUNDLE_WITHOUT\fR\.
+.
+.P
+Any periods in the configuration keys must be replaced with two underscores when setting it via environment variables\. The configuration key \fBlocal\.rack\fR becomes the environment variable \fBBUNDLE_LOCAL__RACK\fR\.
+.
+.SH "LIST OF AVAILABLE KEYS"
+The following is a list of all configuration keys and their purpose\. You can learn more about their operation in bundle install(1) \fIbundle\-install\.1\.html\fR\.
+.
+.IP "\(bu" 4
+\fBpath\fR (\fBBUNDLE_PATH\fR): The location on disk where all gems in your bundle will be located regardless of \fB$GEM_HOME\fR or \fB$GEM_PATH\fR values\. Bundle gems not found in this location will be installed by \fBbundle install\fR\. Defaults to \fBGem\.dir\fR\. When \-\-deployment is used, defaults to vendor/bundle\.
+.
+.IP "\(bu" 4
+\fBfrozen\fR (\fBBUNDLE_FROZEN\fR): Disallow changes to the \fBGemfile\fR\. Defaults to \fBtrue\fR when \fB\-\-deployment\fR is used\.
+.
+.IP "\(bu" 4
+\fBwithout\fR (\fBBUNDLE_WITHOUT\fR): A \fB:\fR\-separated list of groups whose gems bundler should not install
+.
+.IP "\(bu" 4
+\fBbin\fR (\fBBUNDLE_BIN\fR): Install executables from gems in the bundle to the specified directory\. Defaults to \fBfalse\fR\.
+.
+.IP "\(bu" 4
+\fBgemfile\fR (\fBBUNDLE_GEMFILE\fR): The name of the file that bundler should use as the \fBGemfile\fR\. This location of this file also sets the root of the project, which is used to resolve relative paths in the \fBGemfile\fR, among other things\. By default, bundler will search up from the current working directory until it finds a \fBGemfile\fR\.
+.
+.IP "\(bu" 4
+\fBssl_ca_cert\fR (\fBBUNDLE_SSL_CA_CERT\fR): Path to a designated CA certificate file or folder containing multiple certificates for trusted CAs in PEM format\.
+.
+.IP "\(bu" 4
+\fBssl_client_cert\fR (\fBBUNDLE_SSL_CLIENT_CERT\fR): Path to a designated file containing a X\.509 client certificate and key in PEM format\.
+.
+.IP "\(bu" 4
+\fBcache_path\fR (\fBBUNDLE_CACHE_PATH\fR): The directory that bundler will place cached gems in when running \fBbundle package\fR, and that bundler will look in when installing gems\. Defaults to \fBvendor/bundle\fR\.
+.
+.IP "\(bu" 4
+\fBdisable_multisource\fR (\fBBUNDLE_DISABLE_MULTISOURCE\fR): When set, Gemfiles containing multiple sources will produce errors instead of warnings\. Use \fBbundle config \-\-delete disable_multisource\fR to unset\.
+.
+.IP "\(bu" 4
+\fBignore_messages\fR (\fBBUNDLE_IGNORE_MESSAGES\fR): When set, no post install messages will be printed\. To silence a single gem, use dot notation like \fBignore_messages\.httparty true\fR\.
+.
+.IP "\(bu" 4
+\fBretry\fR (\fBBUNDLE_RETRY\fR): The number of times to retry failed network requests\. Defaults to \fB3\fR\.
+.
+.IP "\(bu" 4
+\fBredirect\fR (\fBBUNDLE_REDIRECT\fR): The number of redirects allowed for network requests\. Defaults to \fB5\fR\.
+.
+.IP "\(bu" 4
+\fBtimeout\fR (\fBBUNDLE_TIMEOUT\fR): The seconds allowed before timing out for network requests\. Defaults to \fB10\fR\.
+.
+.IP "\(bu" 4
+\fBforce_ruby_platform\fR (\fBBUNDLE_FORCE_RUBY_PLATFORM\fR): Ignore the current machine\'s platform and install only \fBruby\fR platform gems\. As a result, gems with native extensions will be compiled from source\.
+.
+.IP "\(bu" 4
+\fBspecific_platform\fR (\fBBUNDLE_SPECIFIC_PLATFORM\fR): Allow bundler to resolve for the specific running platform and store it in the lockfile, instead of only using a generic platform\. A specific platform is the exact platform triple reported by \fBGem::Platform\.local\fR, such as \fBx86_64\-darwin\-16\fR or \fBuniversal\-java\-1\.8\fR\. On the other hand, generic platforms are those such as \fBruby\fR, \fBmswin\fR, or \fBjava\fR\. In this example, \fBx86_64\-darwin\-16\fR would map [...]
+.
+.IP "\(bu" 4
+\fBdisable_checksum_validation\fR (\fBBUNDLE_DISABLE_CHECKSUM_VALIDATION\fR): Allow installing gems even if they do not match the checksum provided by RubyGems\.
+.
+.IP "\(bu" 4
+\fBdisable_version_check\fR (\fBBUNDLE_DISABLE_VERSION_CHECK\fR): Stop Bundler from checking if a newer Bundler version is available on rubygems\.org\.
+.
+.IP "\(bu" 4
+\fBallow_offline_install\fR (\fBBUNDLE_ALLOW_OFFLINE_INSTALL\fR): Allow Bundler to use cached data when installing without network access\.
+.
+.IP "\(bu" 4
+\fBauto_install\fR (\fBBUNDLE_AUTO_INSTALL\fR): Automatically run \fBbundle install\fR when gems are missing\.
+.
+.IP "\(bu" 4
+\fBcache_all_platforms\fR (\fBBUNDLE_CACHE_ALL_PLATFORMS\fR): Cache gems for all platforms\.
+.
+.IP "\(bu" 4
+\fBcache_all\fR (\fBBUNDLE_CACHE_ALL\fR): Cache all gems, including path and git gems\.
+.
+.IP "\(bu" 4
+\fBclean\fR (\fBBUNDLE_CLEAN\fR): Whether Bundler should run \fBbundle clean\fR automatically after \fBbundle install\fR\.
+.
+.IP "\(bu" 4
+\fBconsole\fR (\fBBUNDLE_CONSOLE\fR): The console that \fBbundle console\fR starts\. Defaults to \fBirb\fR\.
+.
+.IP "\(bu" 4
+\fBdisable_exec_load\fR (\fBBUNDLE_DISABLE_EXEC_LOAD\fR): Stop Bundler from using \fBload\fR to launch an executable in\-process in \fBbundle exec\fR\.
+.
+.IP "\(bu" 4
+\fBdisable_local_branch_check\fR (\fBBUNDLE_DISABLE_LOCAL_BRANCH_CHECK\fR): Allow Bundler to use a local git override without a branch specified in the Gemfile\.
+.
+.IP "\(bu" 4
+\fBdisable_shared_gems\fR (\fBBUNDLE_DISABLE_SHARED_GEMS\fR): Stop Bundler from accessing gems installed to RubyGems\' normal location\.
+.
+.IP "\(bu" 4
+\fBjobs\fR (\fBBUNDLE_JOBS\fR): The number of gems Bundler can install in parallel\. Defaults to 1\.
+.
+.IP "\(bu" 4
+\fBmajor_deprecations\fR (\fBBUNDLE_MAJOR_DEPRECATIONS\fR): Whether Bundler should print deprecation warnings for behavior that will be changed in the next major version\.
+.
+.IP "\(bu" 4
+\fBno_install\fR (\fBBUNDLE_NO_INSTALL\fR): Whether \fBbundle package\fR should skip installing gems\.
+.
+.IP "\(bu" 4
+\fBno_prune\fR (\fBBUNDLE_NO_PRUNE\fR): Whether Bundler should leave outdated gems unpruned when caching\.
+.
+.IP "\(bu" 4
+\fBonly_update_to_newer_versions\fR (\fBBUNDLE_ONLY_UPDATE_TO_NEWER_VERSIONS\fR): During \fBbundle update\fR, only resolve to newer versions of the gems in the lockfile\.
+.
+.IP "\(bu" 4
+\fBplugins\fR (\fBBUNDLE_PLUGINS\fR): Enable Bundler\'s experimental plugin system\.
+.
+.IP "\(bu" 4
+\fBshebang\fR (\fBBUNDLE_SHEBANG\fR): The program name that should be invoked for generated binstubs\. Defaults to the ruby install name used to generate the binstub\.
+.
+.IP "\(bu" 4
+\fBsilence_root_warning\fR (\fBBUNDLE_SILENCE_ROOT_WARNING\fR): Silence the warning Bundler prints when installing gems as root\.
+.
+.IP "\(bu" 4
+\fBssl_verify_mode\fR (\fBBUNDLE_SSL_VERIFY_MODE\fR): The SSL verification mode Bundler uses when making HTTPS requests\. Defaults to verify peer\.
+.
+.IP "\(bu" 4
+\fBsystem_bindir\fR (\fBBUNDLE_SYSTEM_BINDIR\fR): The location where RubyGems installs binstubs\. Defaults to \fBGem\.bindir\fR\.
+.
+.IP "\(bu" 4
+\fBuser_agent\fR (\fBBUNDLE_USER_AGENT\fR): The custom user agent fragment Bundler includes in API requests\.
+.
+.IP "\(bu" 4
+\fBgem\.push_key\fR (\fBBUNDLE_GEM__PUSH_KEY\fR): Sets the \fB\-\-key\fR paramter for \fBgem push\fR when using the \fBrake release\fR command with a private gemstash server\.
+.
+.IP "" 0
+.
+.P
+In general, you should set these settings per\-application by using the applicable flag to the bundle install(1) \fIbundle\-install\.1\.html\fR or bundle package(1) \fIbundle\-package\.1\.html\fR command\.
+.
+.P
+You can set them globally either via environment variables or \fBbundle config\fR, whichever is preferable for your setup\. If you use both, environment variables will take preference over global settings\.
+.
+.SH "LOCAL GIT REPOS"
+Bundler also allows you to work against a git repository locally instead of using the remote version\. This can be achieved by setting up a local override:
+.
+.IP "" 4
+.
+.nf
+
+bundle config local\.GEM_NAME /path/to/local/git/repository
+.
+.fi
+.
+.IP "" 0
+.
+.P
+For example, in order to use a local Rack repository, a developer could call:
+.
+.IP "" 4
+.
+.nf
+
+bundle config local\.rack ~/Work/git/rack
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Now instead of checking out the remote git repository, the local override will be used\. Similar to a path source, every time the local git repository change, changes will be automatically picked up by Bundler\. This means a commit in the local git repo will update the revision in the \fBGemfile\.lock\fR to the local git repo revision\. This requires the same attention as git submodules\. Before pushing to the remote, you need to ensure the local override was pushed, otherwise you may po [...]
+.
+.P
+Bundler does many checks to ensure a developer won\'t work with invalid references\. Particularly, we force a developer to specify a branch in the \fBGemfile\fR in order to use this feature\. If the branch specified in the \fBGemfile\fR and the current branch in the local git repository do not match, Bundler will abort\. This ensures that a developer is always working against the correct branches, and prevents accidental locking to a different branch\.
+.
+.P
+Finally, Bundler also ensures that the current revision in the \fBGemfile\.lock\fR exists in the local git repository\. By doing this, Bundler forces you to fetch the latest changes in the remotes\.
+.
+.SH "MIRRORS OF GEM SOURCES"
+Bundler supports overriding gem sources with mirrors\. This allows you to configure rubygems\.org as the gem source in your Gemfile while still using your mirror to fetch gems\.
+.
+.IP "" 4
+.
+.nf
+
+bundle config mirror\.SOURCE_URL MIRROR_URL
+.
+.fi
+.
+.IP "" 0
+.
+.P
+For example, to use a mirror of rubygems\.org hosted at rubygems\-mirror\.org:
+.
+.IP "" 4
+.
+.nf
+
+bundle config mirror\.http://rubygems\.org http://rubygems\-mirror\.org
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Each mirror also provides a fallback timeout setting\. If the mirror does not respond within the fallback timeout, Bundler will try to use the original server instead of the mirror\.
+.
+.IP "" 4
+.
+.nf
+
+bundle config mirror\.SOURCE_URL\.fallback_timeout TIMEOUT
+.
+.fi
+.
+.IP "" 0
+.
+.P
+For example, to fall back to rubygems\.org after 3 seconds:
+.
+.IP "" 4
+.
+.nf
+
+bundle config mirror\.https://rubygems\.org\.fallback_timeout 3
+.
+.fi
+.
+.IP "" 0
+.
+.P
+The default fallback timeout is 0\.1 seconds, but the setting can currently only accept whole seconds (for example, 1, 15, or 30)\.
+.
+.SH "CREDENTIALS FOR GEM SOURCES"
+Bundler allows you to configure credentials for any gem source, which allows you to avoid putting secrets into your Gemfile\.
+.
+.IP "" 4
+.
+.nf
+
+bundle config SOURCE_HOSTNAME USERNAME:PASSWORD
+.
+.fi
+.
+.IP "" 0
+.
+.P
+For example, to save the credentials of user \fBclaudette\fR for the gem source at \fBgems\.longerous\.com\fR, you would run:
+.
+.IP "" 4
+.
+.nf
+
+bundle config gems\.longerous\.com claudette:s00pers3krit
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Or you can set the credentials as an environment variable like this:
+.
+.IP "" 4
+.
+.nf
+
+export BUNDLE_GEMS__LONGEROUS__COM="claudette:s00pers3krit"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+For gems with a git source with HTTP(S) URL you can specify credentials like so:
+.
+.IP "" 4
+.
+.nf
+
+bundle config https://github\.com/bundler/bundler\.git username:password
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Or you can set the credentials as an environment variable like so:
+.
+.IP "" 4
+.
+.nf
+
+export BUNDLE_GITHUB__COM=username:password
+.
+.fi
+.
+.IP "" 0
+.
+.P
+This is especially useful for private repositories on hosts such as Github, where you can use personal OAuth tokens:
+.
+.IP "" 4
+.
+.nf
+
+export BUNDLE_GITHUB__COM=abcd0123generatedtoken:x\-oauth\-basic
+.
+.fi
+.
+.IP "" 0
+
diff --git a/man/bundle-config.1.txt b/man/bundle-config.1.txt
new file mode 100644
index 0000000..80e9a59
--- /dev/null
+++ b/man/bundle-config.1.txt
@@ -0,0 +1,418 @@
+BUNDLE-CONFIG(1)					      BUNDLE-CONFIG(1)
+
+
+
+1mNAME0m
+       1mbundle-config 22m- Set bundler configuration options
+
+1mSYNOPSIS0m
+       1mbundle config 22m[4mname24m [4mvalue24m]]
+
+1mDESCRIPTION0m
+       This  command  allows you to interact with bundler's configuration sys-
+       tem. Bundler retrieves its configuration  from  the  local  application
+       (1mapp/.bundle/config22m), environment variables, and the user's home direc-
+       tory (1m~/.bundle/config22m), in that order of priority.
+
+       Executing 1mbundle config 22mwith no parameters will print  a  list  of	all
+       bundler configuration for the current bundle, and where that configura-
+       tion was set.
+
+       Executing 1mbundle config <name> 22mwill print the value of that  configura-
+       tion setting, and where it was set.
+
+       Executing  1mbundle  config <name> <value> 22mwill set that configuration to
+       the value specified for all bundles executed as the current  user.  The
+       configuration  will  be	stored in 1m~/.bundle/config22m. If 4mname24m already is
+       set, 4mname24m will be overridden and user will be warned.
+
+       Executing 1mbundle config --global  <name>  <value>  22mworks  the  same  as
+       above.
+
+       Executing 1mbundle config --local <name> <value> 22mwill set that configura-
+       tion to the local application. The  configuration  will	be  stored  in
+       1mapp/.bundle/config22m.
+
+       Executing  1mbundle  config --delete <name> 22mwill delete the configuration
+       in both local and global  sources.  Not	compatible  with  --global  or
+       --local flag.
+
+       Executing bundle with the 1mBUNDLE_IGNORE_CONFIG 22menvironment variable set
+       will cause it to ignore all configuration.
+
+       Executing 1mbundle config disable_multisource true 22mupgrades  the  warning
+       about the Gemfile containing multiple primary sources to an error. Exe-
+       cuting 1mbundle config --delete disable_multisource 22mdowngrades this error
+       to a warning.
+
+1mREMEMBERING OPTIONS0m
+       Flags  passed  to 1mbundle install 22mor the Bundler runtime, such as 1m--path0m
+       1mfoo 22mor 1m--without production22m, are not remembered  between  commands.  If
+       these  options  must be remembered,they must be set using 1mbundle config0m
+       (e.g., 1mbundle config path foo22m).
+
+       The options that can be configured are:
+
+       1mbin	22mCreates a directory (defaults to 1m~/bin22m) and place  any	executa-
+	      bles from the gem there. These executables run in Bundler's con-
+	      text. If used, you might add this  directory  to	your  environ-
+	      ment's  1mPATH 22mvariable. For instance, if the 1mrails 22mgem comes with
+	      a 1mrails 22mexecutable, this flag will create a 1mbin/rails 22mexecutable
+	      that  ensures  that  all	referred dependencies will be resolved
+	      using the bundled gems.
+
+       1mdeployment0m
+	      In deployment mode, Bundler will 'roll-out' the bundle for  1mpro-0m
+	      1mduction  22muse.  Please  check  carefully if you want to have this
+	      option enabled in 1mdevelopment 22mor 1mtest 22menvironments.
+
+       1mpath	22mThe location to install the specified gems to. This defaults  to
+	      Rubygems'  setting.  Bundler shares this location with Rubygems,
+	      1mgem install ... 22mwill have gem installed there,  too.  Therefore,
+	      gems  installed  without	a  1m--path  ... 22msetting will show up by
+	      calling 1mgem list22m. Accordingly, gems installed to other locations
+	      will not get listed.
+
+       1mwithout0m
+	      A space-separated list of groups referencing gems to skip during
+	      installation.
+
+1mBUILD OPTIONS0m
+       You can use 1mbundle config 22mto give bundler the flags to pass to the	gem
+       installer every time bundler tries to install a particular gem.
+
+       A  very	common	example, the 1mmysql 22mgem, requires Snow Leopard users to
+       pass configuration flags to 1mgem install 22mto specify where  to  find	the
+       1mmysql_config 22mexecutable.
+
+
+
+	   gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
+
+
+
+       Since  the specific location of that executable can change from machine
+       to machine, you can specify these flags on a per-machine basis.
+
+
+
+	   bundle config build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config
+
+
+
+       After running this command, every time bundler  needs  to  install  the
+       1mmysql 22mgem, it will pass along the flags you specified.
+
+1mCONFIGURATION KEYS0m
+       Configuration  keys  in	bundler have two forms: the canonical form and
+       the environment variable form.
+
+       For instance, passing the 1m--without  22mflag  to  bundle  install(1)  4mbun-0m
+       4mdle-install.1.html24m	prevents  Bundler  from  installing  certain groups
+       specified in the Gemfile(5). Bundler persists this value  in  1mapp/.bun-0m
+       1mdle/config  22mso that calls to 1mBundler.setup 22mdo not try to find gems from
+       the 1mGemfile 22mthat you didn't install. Additionally, subsequent calls  to
+       bundle  install(1) 4mbundle-install.1.html24m remember this setting and skip
+       those groups.
+
+       The canonical form of this configuration is 1m"without"22m. To  convert	the
+       canonical  form	to  the  environment variable form, capitalize it, and
+       prepend 1mBUNDLE_22m. The environment variable form  of	1m"without"  22mis  1mBUN-0m
+       1mDLE_WITHOUT22m.
+
+       Any  periods in the configuration keys must be replaced with two under-
+       scores when setting it via environment variables. The configuration key
+       1mlocal.rack 22mbecomes the environment variable 1mBUNDLE_LOCAL__RACK22m.
+
+1mLIST OF AVAILABLE KEYS0m
+       The  following  is  a list of all configuration keys and their purpose.
+       You can learn more about their  operation  in  bundle  install(1)  4mbun-0m
+       4mdle-install.1.html24m.
+
+       o   1mpath  22m(1mBUNDLE_PATH22m):  The	location  on disk where all gems in your
+	   bundle will be located regardless of 1m$GEM_HOME 22mor 1m$GEM_PATH 22mvalues.
+	   Bundle  gems not found in this location will be installed by 1mbundle0m
+	   1minstall22m. Defaults to 1mGem.dir22m. When --deployment is  used,	defaults
+	   to vendor/bundle.
+
+       o   1mfrozen  22m(1mBUNDLE_FROZEN22m):  Disallow changes to the 1mGemfile22m. Defaults
+	   to 1mtrue 22mwhen 1m--deployment 22mis used.
+
+       o   1mwithout 22m(1mBUNDLE_WITHOUT22m): A 1m:22m-separated list of groups  whose  gems
+	   bundler should not install
+
+       o   1mbin  22m(1mBUNDLE_BIN22m):  Install  executables from gems in the bundle to
+	   the specified directory. Defaults to 1mfalse22m.
+
+       o   1mgemfile 22m(1mBUNDLE_GEMFILE22m): The name of the file that bundler  should
+	   use	as  the 1mGemfile22m. This location of this file also sets the root
+	   of the project, which is used to resolve relative paths in the 1mGem-0m
+	   1mfile22m,  among  other things. By default, bundler will search up from
+	   the current working directory until it finds a 1mGemfile22m.
+
+       o   1mssl_ca_cert 22m(1mBUNDLE_SSL_CA_CERT22m): Path to a designated CA	certifi-
+	   cate  file  or  folder containing multiple certificates for trusted
+	   CAs in PEM format.
+
+       o   1mssl_client_cert 22m(1mBUNDLE_SSL_CLIENT_CERT22m): Path to a designated file
+	   containing a X.509 client certificate and key in PEM format.
+
+       o   1mcache_path  22m(1mBUNDLE_CACHE_PATH22m):  The  directory  that bundler will
+	   place cached gems in when running 1mbundle package22m, and that  bundler
+	   will look in when installing gems. Defaults to 1mvendor/bundle22m.
+
+       o   1mdisable_multisource  22m(1mBUNDLE_DISABLE_MULTISOURCE22m):  When  set, Gem-
+	   files containing multiple sources will produce  errors  instead  of
+	   warnings. Use 1mbundle config --delete disable_multisource 22mto unset.
+
+       o   1mignore_messages 22m(1mBUNDLE_IGNORE_MESSAGES22m): When set, no post install
+	   messages will be printed. To silence a single gem, use dot notation
+	   like 1mignore_messages.httparty true22m.
+
+       o   1mretry  22m(1mBUNDLE_RETRY22m):  The number of times to retry failed network
+	   requests. Defaults to 1m322m.
+
+       o   1mredirect 22m(1mBUNDLE_REDIRECT22m): The number  of  redirects  allowed  for
+	   network requests. Defaults to 1m522m.
+
+       o   1mtimeout 22m(1mBUNDLE_TIMEOUT22m): The seconds allowed before timing out for
+	   network requests. Defaults to 1m1022m.
+
+       o   1mforce_ruby_platform 22m(1mBUNDLE_FORCE_RUBY_PLATFORM22m): Ignore  the  cur-
+	   rent  machine's  platform and install only 1mruby 22mplatform gems. As a
+	   result, gems with native extensions will be compiled from source.
+
+       o   1mspecific_platform	22m(1mBUNDLE_SPECIFIC_PLATFORM22m):  Allow  bundler   to
+	   resolve for the specific running platform and store it in the lock-
+	   file, instead of only using a generic platform. A specific platform
+	   is  the exact platform triple reported by 1mGem::Platform.local22m, such
+	   as 1mx86_64-darwin-16  22mor  1muniversal-java-1.822m.  On  the  other  hand,
+	   generic  platforms  are those such as 1mruby22m, 1mmswin22m, or 1mjava22m. In this
+	   example, 1mx86_64-darwin-16 22mwould map to 1mruby 22mand  1muniversal-java-1.80m
+	   to 1mjava22m.
+
+       o   1mdisable_checksum_validation   22m(1mBUNDLE_DISABLE_CHECKSUM_VALIDATION22m):
+	   Allow installing gems even if they do not match the	checksum  pro-
+	   vided by RubyGems.
+
+       o   1mdisable_version_check  22m(1mBUNDLE_DISABLE_VERSION_CHECK22m): Stop Bundler
+	   from  checking  if  a  newer  Bundler  version  is	available   on
+	   rubygems.org.
+
+       o   1mallow_offline_install 22m(1mBUNDLE_ALLOW_OFFLINE_INSTALL22m): Allow Bundler
+	   to use cached data when installing without network access.
+
+       o   1mauto_install  22m(1mBUNDLE_AUTO_INSTALL22m):   Automatically   run   1mbundle0m
+	   1minstall 22mwhen gems are missing.
+
+       o   1mcache_all_platforms  22m(1mBUNDLE_CACHE_ALL_PLATFORMS22m):  Cache	gems for
+	   all platforms.
+
+       o   1mcache_all 22m(1mBUNDLE_CACHE_ALL22m): Cache all gems,  including  path  and
+	   git gems.
+
+       o   1mclean 22m(1mBUNDLE_CLEAN22m): Whether Bundler should run 1mbundle clean 22mauto-
+	   matically after 1mbundle install22m.
+
+       o   1mconsole 22m(1mBUNDLE_CONSOLE22m): The console that 1mbundle  console  22mstarts.
+	   Defaults to 1mirb22m.
+
+       o   1mdisable_exec_load	22m(1mBUNDLE_DISABLE_EXEC_LOAD22m):  Stop  Bundler  from
+	   using 1mload 22mto launch an executable in-process in 1mbundle exec22m.
+
+       o   1mdisable_local_branch_check     22m(1mBUNDLE_DISABLE_LOCAL_BRANCH_CHECK22m):
+	   Allow  Bundler  to use a local git override without a branch speci-
+	   fied in the Gemfile.
+
+       o   1mdisable_shared_gems 22m(1mBUNDLE_DISABLE_SHARED_GEMS22m): Stop Bundler from
+	   accessing gems installed to RubyGems' normal location.
+
+       o   1mjobs  22m(1mBUNDLE_JOBS22m): The number of gems Bundler can install in par-
+	   allel. Defaults to 1.
+
+       o   1mmajor_deprecations  22m(1mBUNDLE_MAJOR_DEPRECATIONS22m):  Whether	 Bundler
+	   should print deprecation warnings for behavior that will be changed
+	   in the next major version.
+
+       o   1mno_install 22m(1mBUNDLE_NO_INSTALL22m): Whether 1mbundle package 22mshould  skip
+	   installing gems.
+
+       o   1mno_prune  22m(1mBUNDLE_NO_PRUNE22m):  Whether Bundler should leave outdated
+	   gems unpruned when caching.
+
+       o   1monly_update_to_newer_versions     22m(1mBUNDLE_ONLY_UPDATE_TO_NEWER_VER-0m
+	   1mSIONS22m): During 1mbundle update22m, only resolve to newer versions of the
+	   gems in the lockfile.
+
+       o   1mplugins 22m(1mBUNDLE_PLUGINS22m): Enable Bundler's experimental plugin sys-
+	   tem.
+
+       o   1mshebang  22m(1mBUNDLE_SHEBANG22m):  The program name that should be invoked
+	   for generated binstubs. Defaults to the ruby install name  used  to
+	   generate the binstub.
+
+       o   1msilence_root_warning   22m(1mBUNDLE_SILENCE_ROOT_WARNING22m):  Silence  the
+	   warning Bundler prints when installing gems as root.
+
+       o   1mssl_verify_mode 22m(1mBUNDLE_SSL_VERIFY_MODE22m): The SSL verification mode
+	   Bundler uses when making HTTPS requests. Defaults to verify peer.
+
+       o   1msystem_bindir  22m(1mBUNDLE_SYSTEM_BINDIR22m):  The location where RubyGems
+	   installs binstubs. Defaults to 1mGem.bindir22m.
+
+       o   1muser_agent 22m(1mBUNDLE_USER_AGENT22m):  The  custom  user  agent	fragment
+	   Bundler includes in API requests.
+
+       o   1mgem.push_key  22m(1mBUNDLE_GEM__PUSH_KEY22m):  Sets  the 1m--key 22mparamter for
+	   1mgem push 22mwhen using the 1mrake release 22mcommand with	a  private  gem-
+	   stash server.
+
+
+
+       In  general, you should set these settings per-application by using the
+       applicable flag to the bundle install(1) 4mbundle-install.1.html24m or  bun-
+       dle package(1) 4mbundle-package.1.html24m command.
+
+       You  can  set  them globally either via environment variables or 1mbundle0m
+       1mconfig22m, whichever is preferable for your setup. If you use both,  envi-
+       ronment variables will take preference over global settings.
+
+1mLOCAL GIT REPOS0m
+       Bundler	also  allows  you  to  work  against  a git repository locally
+       instead of using the remote version. This can be achieved by setting up
+       a local override:
+
+
+
+	   bundle config local.GEM_NAME /path/to/local/git/repository
+
+
+
+       For example, in order to use a local Rack repository, a developer could
+       call:
+
+
+
+	   bundle config local.rack ~/Work/git/rack
+
+
+
+       Now instead of checking out the remote git repository, the local  over-
+       ride  will  be used. Similar to a path source, every time the local git
+       repository change, changes will be automatically picked up by  Bundler.
+       This  means  a commit in the local git repo will update the revision in
+       the 1mGemfile.lock 22mto the local git repo revision. This requires the same
+       attention  as git submodules. Before pushing to the remote, you need to
+       ensure the local override was pushed, otherwise you may point to a com-
+       mit that only exists in your local machine.
+
+       Bundler	does many checks to ensure a developer won't work with invalid
+       references. Particularly, we force a developer to specify a  branch  in
+       the  1mGemfile  22min  order to use this feature. If the branch specified in
+       the 1mGemfile 22mand the current branch in the local git repository  do	not
+       match,  Bundler	will  abort.  This  ensures that a developer is always
+       working against the correct branches, and prevents  accidental  locking
+       to a different branch.
+
+       Finally,  Bundler  also	ensures  that the current revision in the 1mGem-0m
+       1mfile.lock 22mexists in the local git repository. By  doing  this,  Bundler
+       forces you to fetch the latest changes in the remotes.
+
+1mMIRRORS OF GEM SOURCES0m
+       Bundler	supports  overriding gem sources with mirrors. This allows you
+       to configure rubygems.org as the gem source in your Gemfile while still
+       using your mirror to fetch gems.
+
+
+
+	   bundle config mirror.SOURCE_URL MIRROR_URL
+
+
+
+       For  example,  to  use a mirror of rubygems.org hosted at rubygems-mir-
+       ror.org:
+
+
+
+	   bundle config mirror.http://rubygems.org http://rubygems-mirror.org
+
+
+
+       Each mirror also provides a fallback timeout  setting.  If  the	mirror
+       does  not  respond within the fallback timeout, Bundler will try to use
+       the original server instead of the mirror.
+
+
+
+	   bundle config mirror.SOURCE_URL.fallback_timeout TIMEOUT
+
+
+
+       For example, to fall back to rubygems.org after 3 seconds:
+
+
+
+	   bundle config mirror.https://rubygems.org.fallback_timeout 3
+
+
+
+       The default fallback timeout is 0.1 seconds, but the setting  can  cur-
+       rently only accept whole seconds (for example, 1, 15, or 30).
+
+1mCREDENTIALS FOR GEM SOURCES0m
+       Bundler	allows	you to configure credentials for any gem source, which
+       allows you to avoid putting secrets into your Gemfile.
+
+
+
+	   bundle config SOURCE_HOSTNAME USERNAME:PASSWORD
+
+
+
+       For example, to save the credentials of	user  1mclaudette  22mfor  the	gem
+       source at 1mgems.longerous.com22m, you would run:
+
+
+
+	   bundle config gems.longerous.com claudette:s00pers3krit
+
+
+
+       Or you can set the credentials as an environment variable like this:
+
+
+
+	   export BUNDLE_GEMS__LONGEROUS__COM="claudette:s00pers3krit"
+
+
+
+       For gems with a git source with HTTP(S) URL you can specify credentials
+       like so:
+
+
+
+	   bundle config https://github.com/bundler/bundler.git username:password
+
+
+
+       Or you can set the credentials as an environment variable like so:
+
+
+
+	   export BUNDLE_GITHUB__COM=username:password
+
+
+
+       This is especially useful for private repositories  on  hosts  such  as
+       Github, where you can use personal OAuth tokens:
+
+
+
+	   export BUNDLE_GITHUB__COM=abcd0123generatedtoken:x-oauth-basic
+
+
+
+
+
+
+				   June 2017		      BUNDLE-CONFIG(1)
diff --git a/man/bundle-config.ronn b/man/bundle-config.ronn
index 3ea6d10..f64f5b4 100644
--- a/man/bundle-config.ronn
+++ b/man/bundle-config.ronn
@@ -48,7 +48,7 @@ If these options must be remembered,they must be set using `bundle config`
 
 The options that can be configured are:
 
-* `binstubs`:
+* `bin`:
   Creates a directory (defaults to `~/bin`) and place any executables from the
   gem there. These executables run in Bundler's context. If used, you might add
   this directory to your environment's `PATH` variable. For instance, if the
@@ -65,7 +65,7 @@ The options that can be configured are:
   The location to install the specified gems to. This defaults to Rubygems'
   setting. Bundler shares this location with Rubygems, `gem install ...` will
   have gem installed there, too. Therefore, gems installed without a
-  `--path ...` setting will show up by calling `gem list`. Accodingly, gems
+  `--path ...` setting will show up by calling `gem list`. Accordingly, gems
   installed to other locations will not get listed.
 
 * `without`:
@@ -142,7 +142,7 @@ learn more about their operation in [bundle install(1)][bundle-install].
   and key in PEM format.
 * `cache_path` (`BUNDLE_CACHE_PATH`): The directory that bundler will place
   cached gems in when running <code>bundle package</code>, and that bundler
-  will look in when installing gems.
+  will look in when installing gems. Defaults to `vendor/bundle`.
 * `disable_multisource` (`BUNDLE_DISABLE_MULTISOURCE`): When set, Gemfiles
   containing multiple sources will produce errors instead of warnings. Use
   `bundle config --delete disable_multisource` to unset.
@@ -155,6 +155,73 @@ learn more about their operation in [bundle install(1)][bundle-install].
    The number of redirects allowed for network requests. Defaults to `5`.
 * `timeout` (`BUNDLE_TIMEOUT`):
    The seconds allowed before timing out for network requests. Defaults to `10`.
+* `force_ruby_platform` (`BUNDLE_FORCE_RUBY_PLATFORM`):
+   Ignore the current machine's platform and install only `ruby` platform gems.
+   As a result, gems with native extensions will be compiled from source.
+* `specific_platform` (`BUNDLE_SPECIFIC_PLATFORM`):
+   Allow bundler to resolve for the specific running platform and store it in
+   the lockfile, instead of only using a generic platform.
+   A specific platform is the exact platform triple reported by
+   `Gem::Platform.local`, such as `x86_64-darwin-16` or `universal-java-1.8`.
+   On the other hand, generic platforms are those such as `ruby`, `mswin`, or
+   `java`. In this example, `x86_64-darwin-16` would map to `ruby` and
+   `universal-java-1.8` to `java`.
+* `disable_checksum_validation` (`BUNDLE_DISABLE_CHECKSUM_VALIDATION`):
+   Allow installing gems even if they do not match the checksum provided by
+   RubyGems.
+* `disable_version_check` (`BUNDLE_DISABLE_VERSION_CHECK`):
+   Stop Bundler from checking if a newer Bundler version is available on
+   rubygems.org.
+* `allow_offline_install` (`BUNDLE_ALLOW_OFFLINE_INSTALL`):
+   Allow Bundler to use cached data when installing without network access.
+* `auto_install` (`BUNDLE_AUTO_INSTALL`):
+   Automatically run `bundle install` when gems are missing.
+* `cache_all_platforms` (`BUNDLE_CACHE_ALL_PLATFORMS`):
+   Cache gems for all platforms.
+* `cache_all` (`BUNDLE_CACHE_ALL`):
+   Cache all gems, including path and git gems.
+* `clean` (`BUNDLE_CLEAN`):
+   Whether Bundler should run `bundle clean` automatically after
+   `bundle install`.
+* `console` (`BUNDLE_CONSOLE`):
+   The console that `bundle console` starts. Defaults to `irb`.
+* `disable_exec_load` (`BUNDLE_DISABLE_EXEC_LOAD`):
+   Stop Bundler from using `load` to launch an executable in-process in
+   `bundle exec`.
+* `disable_local_branch_check` (`BUNDLE_DISABLE_LOCAL_BRANCH_CHECK`):
+   Allow Bundler to use a local git override without a branch specified in the
+   Gemfile.
+* `disable_shared_gems` (`BUNDLE_DISABLE_SHARED_GEMS`):
+   Stop Bundler from accessing gems installed to RubyGems' normal location.
+* `jobs` (`BUNDLE_JOBS`):
+   The number of gems Bundler can install in parallel. Defaults to 1.
+* `major_deprecations` (`BUNDLE_MAJOR_DEPRECATIONS`):
+   Whether Bundler should print deprecation warnings for behavior that will
+   be changed in the next major version.
+* `no_install` (`BUNDLE_NO_INSTALL`):
+   Whether `bundle package` should skip installing gems.
+* `no_prune` (`BUNDLE_NO_PRUNE`):
+   Whether Bundler should leave outdated gems unpruned when caching.
+* `only_update_to_newer_versions` (`BUNDLE_ONLY_UPDATE_TO_NEWER_VERSIONS`):
+   During `bundle update`, only resolve to newer versions of the gems in the
+   lockfile.
+* `plugins` (`BUNDLE_PLUGINS`):
+   Enable Bundler's experimental plugin system.
+* `shebang` (`BUNDLE_SHEBANG`):
+   The program name that should be invoked for generated binstubs. Defaults to
+   the ruby install name used to generate the binstub.
+* `silence_root_warning` (`BUNDLE_SILENCE_ROOT_WARNING`):
+   Silence the warning Bundler prints when installing gems as root.
+* `ssl_verify_mode` (`BUNDLE_SSL_VERIFY_MODE`):
+   The SSL verification mode Bundler uses when making HTTPS requests.
+   Defaults to verify peer.
+* `system_bindir` (`BUNDLE_SYSTEM_BINDIR`):
+   The location where RubyGems installs binstubs. Defaults to `Gem.bindir`.
+* `user_agent` (`BUNDLE_USER_AGENT`):
+   The custom user agent fragment Bundler includes in API requests.
+* `gem.push_key` (`BUNDLE_GEM__PUSH_KEY`):
+   Sets the `--key` paramter for `gem push` when using the `rake release`
+   command with a private gemstash server.
 
 In general, you should set these settings per-application by using the applicable
 flag to the [bundle install(1)][bundle-install] or [bundle package(1)][bundle-package] command.
@@ -204,10 +271,23 @@ mirror to fetch gems.
 
     bundle config mirror.SOURCE_URL MIRROR_URL
 
-For example, to use a mirror of rubygems.org hosted at
+For example, to use a mirror of rubygems.org hosted at rubygems-mirror.org:
 
     bundle config mirror.http://rubygems.org http://rubygems-mirror.org
 
+Each mirror also provides a fallback timeout setting. If the mirror does not
+respond within the fallback timeout, Bundler will try to use the original
+server instead of the mirror.
+
+    bundle config mirror.SOURCE_URL.fallback_timeout TIMEOUT
+
+For example, to fall back to rubygems.org after 3 seconds:
+
+    bundle config mirror.https://rubygems.org.fallback_timeout 3
+
+The default fallback timeout is 0.1 seconds, but the setting can currently
+only accept whole seconds (for example, 1, 15, or 30).
+
 ## CREDENTIALS FOR GEM SOURCES
 
 Bundler allows you to configure credentials for any gem source, which allows
@@ -223,3 +303,16 @@ For example, to save the credentials of user `claudette` for the gem source at
 Or you can set the credentials as an environment variable like this:
 
     export BUNDLE_GEMS__LONGEROUS__COM="claudette:s00pers3krit"
+
+For gems with a git source with HTTP(S) URL you can specify credentials like so:
+
+    bundle config https://github.com/bundler/bundler.git username:password
+
+Or you can set the credentials as an environment variable like so:
+
+    export BUNDLE_GITHUB__COM=username:password
+
+This is especially useful for private repositories on hosts such as Github,
+where you can use personal OAuth tokens:
+
+    export BUNDLE_GITHUB__COM=abcd0123generatedtoken:x-oauth-basic
diff --git a/man/bundle-exec.1 b/man/bundle-exec.1
new file mode 100644
index 0000000..48710f2
--- /dev/null
+++ b/man/bundle-exec.1
@@ -0,0 +1,162 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-EXEC" "1" "May 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-exec\fR \- Execute a command in the context of the bundle
+.
+.SH "SYNOPSIS"
+\fBbundle exec\fR [\-\-keep\-file\-descriptors] \fIcommand\fR
+.
+.SH "DESCRIPTION"
+This command executes the command, making all gems specified in the \fBGemfile(5)\fR available to \fBrequire\fR in Ruby programs\.
+.
+.P
+Essentially, if you would normally have run something like \fBrspec spec/my_spec\.rb\fR, and you want to use the gems specified in the \fBGemfile(5)\fR and installed via bundle install(1) \fIbundle\-install\.1\.html\fR, you should run \fBbundle exec rspec spec/my_spec\.rb\fR\.
+.
+.P
+Note that \fBbundle exec\fR does not require that an executable is available on your shell\'s \fB$PATH\fR\.
+.
+.SH "OPTIONS"
+.
+.TP
+\fB\-\-keep\-file\-descriptors\fR
+Exec in Ruby 2\.0 began discarding non\-standard file descriptors\. When this flag is passed, exec will revert to the 1\.9 behaviour of passing all file descriptors to the new process\.
+.
+.SH "BUNDLE INSTALL \-\-BINSTUBS"
+If you use the \fB\-\-binstubs\fR flag in bundle install(1) \fIbundle\-install\.1\.html\fR, Bundler will automatically create a directory (which defaults to \fBapp_root/bin\fR) containing all of the executables available from gems in the bundle\.
+.
+.P
+After using \fB\-\-binstubs\fR, \fBbin/rspec spec/my_spec\.rb\fR is identical to \fBbundle exec rspec spec/my_spec\.rb\fR\.
+.
+.SH "ENVIRONMENT MODIFICATIONS"
+\fBbundle exec\fR makes a number of changes to the shell environment, then executes the command you specify in full\.
+.
+.IP "\(bu" 4
+make sure that it\'s still possible to shell out to \fBbundle\fR from inside a command invoked by \fBbundle exec\fR (using \fB$BUNDLE_BIN_PATH\fR)
+.
+.IP "\(bu" 4
+put the directory containing executables (like \fBrails\fR, \fBrspec\fR, \fBrackup\fR) for your bundle on \fB$PATH\fR
+.
+.IP "\(bu" 4
+make sure that if bundler is invoked in the subshell, it uses the same \fBGemfile\fR (by setting \fBBUNDLE_GEMFILE\fR)
+.
+.IP "\(bu" 4
+add \fB\-rbundler/setup\fR to \fB$RUBYOPT\fR, which makes sure that Ruby programs invoked in the subshell can see the gems in the bundle
+.
+.IP "" 0
+.
+.P
+It also modifies Rubygems:
+.
+.IP "\(bu" 4
+disallow loading additional gems not in the bundle
+.
+.IP "\(bu" 4
+modify the \fBgem\fR method to be a no\-op if a gem matching the requirements is in the bundle, and to raise a \fBGem::LoadError\fR if it\'s not
+.
+.IP "\(bu" 4
+Define \fBGem\.refresh\fR to be a no\-op, since the source index is always frozen when using bundler, and to prevent gems from the system leaking into the environment
+.
+.IP "\(bu" 4
+Override \fBGem\.bin_path\fR to use the gems in the bundle, making system executables work
+.
+.IP "\(bu" 4
+Add all gems in the bundle into Gem\.loaded_specs
+.
+.IP "" 0
+.
+.SS "Loading"
+By default, when attempting to \fBbundle exec\fR to a file with a ruby shebang, Bundler will \fBKernel\.load\fR that file instead of using \fBKernel\.exec\fR\. For the vast majority of cases, this is a performance improvement\. In a rare few cases, this could cause some subtle side\-effects (such as dependence on the exact contents of \fB$0\fR or \fB__FILE__\fR) and the optimization can be disabled by enabling the \fBdisable_exec_load\fR setting\.
+.
+.SS "Shelling out"
+Any Ruby code that opens a subshell (like \fBsystem\fR, backticks, or \fB%x{}\fR) will automatically use the current Bundler environment\. If you need to shell out to a Ruby command that is not part of your current bundle, use the \fBwith_clean_env\fR method with a block\. Any subshells created inside the block will be given the environment present before Bundler was activated\. For example, Homebrew commands run Ruby, but don\'t work inside a bundle:
+.
+.IP "" 4
+.
+.nf
+
+Bundler\.with_clean_env do
+  `brew install wget`
+end
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Using \fBwith_clean_env\fR is also necessary if you are shelling out to a different bundle\. Any Bundler commands run in a subshell will inherit the current Gemfile, so commands that need to run in the context of a different bundle also need to use \fBwith_clean_env\fR\.
+.
+.IP "" 4
+.
+.nf
+
+Bundler\.with_clean_env do
+  Dir\.chdir "/other/bundler/project" do
+    `bundle exec \./script`
+  end
+end
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Bundler provides convenience helpers that wrap \fBsystem\fR and \fBexec\fR, and they can be used like this:
+.
+.IP "" 4
+.
+.nf
+
+Bundler\.clean_system(\'brew install wget\')
+Bundler\.clean_exec(\'brew install wget\')
+.
+.fi
+.
+.IP "" 0
+.
+.SH "RUBYGEMS PLUGINS"
+At present, the Rubygems plugin system requires all files named \fBrubygems_plugin\.rb\fR on the load path of \fIany\fR installed gem when any Ruby code requires \fBrubygems\.rb\fR\. This includes executables installed into the system, like \fBrails\fR, \fBrackup\fR, and \fBrspec\fR\.
+.
+.P
+Since Rubygems plugins can contain arbitrary Ruby code, they commonly end up activating themselves or their dependencies\.
+.
+.P
+For instance, the \fBgemcutter 0\.5\fR gem depended on \fBjson_pure\fR\. If you had that version of gemcutter installed (even if you \fIalso\fR had a newer version without this problem), Rubygems would activate \fBgemcutter 0\.5\fR and \fBjson_pure <latest>\fR\.
+.
+.P
+If your Gemfile(5) also contained \fBjson_pure\fR (or a gem with a dependency on \fBjson_pure\fR), the latest version on your system might conflict with the version in your Gemfile(5), or the snapshot version in your \fBGemfile\.lock\fR\.
+.
+.P
+If this happens, bundler will say:
+.
+.IP "" 4
+.
+.nf
+
+You have already activated json_pure 1\.4\.6 but your Gemfile
+requires json_pure 1\.4\.3\. Consider using bundle exec\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+In this situation, you almost certainly want to remove the underlying gem with the problematic gem plugin\. In general, the authors of these plugins (in this case, the \fBgemcutter\fR gem) have released newer versions that are more careful in their plugins\.
+.
+.P
+You can find a list of all the gems containing gem plugins by running
+.
+.IP "" 4
+.
+.nf
+
+ruby \-rubygems \-e "puts Gem\.find_files(\'rubygems_plugin\.rb\')"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+At the very least, you should remove all but the newest version of each gem plugin, and also remove all gem plugins that you aren\'t using (\fBgem uninstall gem_name\fR)\.
diff --git a/man/bundle-exec.1.txt b/man/bundle-exec.1.txt
new file mode 100644
index 0000000..a6aa042
--- /dev/null
+++ b/man/bundle-exec.1.txt
@@ -0,0 +1,171 @@
+BUNDLE-EXEC(1)							BUNDLE-EXEC(1)
+
+
+
+1mNAME0m
+       1mbundle-exec 22m- Execute a command in the context of the bundle
+
+1mSYNOPSIS0m
+       1mbundle exec 22m[--keep-file-descriptors] 4mcommand0m
+
+1mDESCRIPTION0m
+       This  command  executes	the  command, making all gems specified in the
+       1mGemfile(5) 22mavailable to 1mrequire 22min Ruby programs.
+
+       Essentially, if you  would  normally  have  run	something  like  1mrspec0m
+       1mspec/my_spec.rb22m,  and  you	want  to use the gems specified in the 1mGem-0m
+       1mfile(5) 22mand installed via bundle install(1) 4mbundle-install.1.html24m,  you
+       should run 1mbundle exec rspec spec/my_spec.rb22m.
+
+       Note  that 1mbundle exec 22mdoes not require that an executable is available
+       on your shell's 1m$PATH22m.
+
+1mOPTIONS0m
+       1m--keep-file-descriptors0m
+	      Exec in Ruby 2.0 began discarding non-standard file descriptors.
+	      When  this flag is passed, exec will revert to the 1.9 behaviour
+	      of passing all file descriptors to the new process.
+
+1mBUNDLE INSTALL --BINSTUBS0m
+       If  you	use  the   1m--binstubs   22mflag   in	 bundle   install(1)   4mbun-0m
+       4mdle-install.1.html24m,  Bundler  will	automatically  create  a  directory
+       (which defaults to 1mapp_root/bin22m)  containing  all  of  the	executables
+       available from gems in the bundle.
+
+       After  using 1m--binstubs22m, 1mbin/rspec spec/my_spec.rb 22mis identical to 1mbun-0m
+       1mdle exec rspec spec/my_spec.rb22m.
+
+1mENVIRONMENT MODIFICATIONS0m
+       1mbundle exec 22mmakes a number of changes to the  shell  environment,  then
+       executes the command you specify in full.
+
+       o   make  sure  that  it's  still  possible to shell out to 1mbundle 22mfrom
+	   inside a command invoked by 1mbundle exec 22m(using 1m$BUNDLE_BIN_PATH22m)
+
+       o   put	the  directory	containing  executables  (like	1mrails22m,  1mrspec22m,
+	   1mrackup22m) for your bundle on 1m$PATH0m
+
+       o   make  sure  that if bundler is invoked in the subshell, it uses the
+	   same 1mGemfile 22m(by setting 1mBUNDLE_GEMFILE22m)
+
+       o   add 1m-rbundler/setup 22mto 1m$RUBYOPT22m, which makes sure	that  Ruby  pro-
+	   grams invoked in the subshell can see the gems in the bundle
+
+
+
+       It also modifies Rubygems:
+
+       o   disallow loading additional gems not in the bundle
+
+       o   modify  the 1mgem 22mmethod to be a no-op if a gem matching the require-
+	   ments is in the bundle, and to raise a 1mGem::LoadError 22mif it's not
+
+       o   Define 1mGem.refresh 22mto be a no-op, since the source index is  always
+	   frozen  when  using	bundler,  and  to prevent gems from the system
+	   leaking into the environment
+
+       o   Override 1mGem.bin_path 22mto use the gems in the bundle, making  system
+	   executables work
+
+       o   Add all gems in the bundle into Gem.loaded_specs
+
+
+
+   1mLoading0m
+       By  default,  when attempting to 1mbundle exec 22mto a file with a ruby she-
+       bang, Bundler will 1mKernel.load 22mthat file instead of using  1mKernel.exec22m.
+       For the vast majority of cases, this is a performance improvement. In a
+       rare few cases, this could cause  some  subtle  side-effects  (such  as
+       dependence  on  the exact contents of 1m$0 22mor 1m__FILE__22m) and the optimiza-
+       tion can be disabled by enabling the 1mdisable_exec_load 22msetting.
+
+   1mShelling out0m
+       Any Ruby code that opens a subshell (like 1msystem22m, backticks,  or  1m%x{}22m)
+       will  automatically use the current Bundler environment. If you need to
+       shell out to a Ruby command that is not part of	your  current  bundle,
+       use  the  1mwith_clean_env  22mmethod  with  a  block. Any subshells created
+       inside the block will be given the environment present  before  Bundler
+       was  activated. For example, Homebrew commands run Ruby, but don't work
+       inside a bundle:
+
+
+
+	   Bundler.with_clean_env do
+	     `brew install wget`
+	   end
+
+
+
+       Using 1mwith_clean_env 22mis also necessary if you are  shelling  out  to  a
+       different  bundle.  Any Bundler commands run in a subshell will inherit
+       the current Gemfile, so commands that need to run in the context  of  a
+       different bundle also need to use 1mwith_clean_env22m.
+
+
+
+	   Bundler.with_clean_env do
+	     Dir.chdir "/other/bundler/project" do
+	       `bundle exec ./script`
+	     end
+	   end
+
+
+
+       Bundler	provides  convenience  helpers	that wrap 1msystem 22mand 1mexec22m, and
+       they can be used like this:
+
+
+
+	   Bundler.clean_system('brew install wget')
+	   Bundler.clean_exec('brew install wget')
+
+
+
+1mRUBYGEMS PLUGINS0m
+       At present,  the  Rubygems  plugin  system  requires  all  files  named
+       1mrubygems_plugin.rb  22mon the load path of 4many24m installed gem when any Ruby
+       code requires 1mrubygems.rb22m. This includes executables installed into the
+       system, like 1mrails22m, 1mrackup22m, and 1mrspec22m.
+
+       Since  Rubygems	plugins can contain arbitrary Ruby code, they commonly
+       end up activating themselves or their dependencies.
+
+       For instance, the 1mgemcutter 0.5 22mgem depended on 1mjson_pure22m. If	you  had
+       that  version of gemcutter installed (even if you 4malso24m had a newer ver-
+       sion without this problem), Rubygems would activate 1mgemcutter	0.5  22mand
+       1mjson_pure <latest>22m.
+
+       If your Gemfile(5) also contained 1mjson_pure 22m(or a gem with a dependency
+       on 1mjson_pure22m), the latest version on your system  might  conflict  with
+       the  version  in  your Gemfile(5), or the snapshot version in your 1mGem-0m
+       1mfile.lock22m.
+
+       If this happens, bundler will say:
+
+
+
+	   You have already activated json_pure 1.4.6 but your Gemfile
+	   requires json_pure 1.4.3. Consider using bundle exec.
+
+
+
+       In this situation, you almost certainly want to remove  the  underlying
+       gem  with  the problematic gem plugin. In general, the authors of these
+       plugins (in this case, the 1mgemcutter 22mgem) have released newer  versions
+       that are more careful in their plugins.
+
+       You can find a list of all the gems containing gem plugins by running
+
+
+
+	   ruby -rubygems -e "puts Gem.find_files('rubygems_plugin.rb')"
+
+
+
+       At the very least, you should remove all but the newest version of each
+       gem plugin, and also remove all gem plugins that you aren't using  (1mgem0m
+       1muninstall gem_name22m).
+
+
+
+				   May 2017			BUNDLE-EXEC(1)
diff --git a/man/bundle-gem.1 b/man/bundle-gem.1
new file mode 100644
index 0000000..1af302c
--- /dev/null
+++ b/man/bundle-gem.1
@@ -0,0 +1,80 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-GEM" "1" "November 2016" "" ""
+.
+.SH "NAME"
+\fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
+.
+.SH "SYNOPSIS"
+\fBbundle gem\fR \fIGEM_NAME\fR \fIOPTIONS\fR
+.
+.SH "DESCRIPTION"
+Generates a directory named \fBGEM_NAME\fR with a \fBRakefile\fR, \fBGEM_NAME\.gemspec\fR, and other supporting files and directories that can be used to develop a rubygem with that name\.
+.
+.P
+Run \fBrake \-T\fR in the resulting project for a list of Rake tasks that can used to test and publish the gem to rubygems\.org\.
+.
+.P
+The generated project skeleton can be customized with OPTIONS, as explained below\. Note that these options can also be specified via Bundler\'s global configuration file using the following names:
+.
+.IP "\(bu" 4
+\fBgem\.coc\fR
+.
+.IP "\(bu" 4
+\fBgem\.mit\fR
+.
+.IP "\(bu" 4
+\fBgem\.test\fR
+.
+.IP "" 0
+.
+.SH "OPTIONS"
+.
+.TP
+\fB\-\-exe\fR or \fB\-b\fR or \fB\-\-bin\fR
+Specify that Bundler should create a binary executable (as \fBexe/GEM_NAME\fR) in the generated rubygem project\. This binary will also be added to the \fBGEM_NAME\.gemspec\fR manifest\. This behavior is disabled by default\.
+.
+.TP
+\fB\-\-no\-exe\fR
+Do not create a binary (overrides \fB\-\-exe\fR specified in the global config)\.
+.
+.TP
+\fB\-\-coc\fR
+Add a \fBCODE_OF_CONDUCT\.md\fR file to the root of the generated project\. If this option is unspecified, an interactive prompt will be displayed and the answer will be saved in Bundler\'s global config for future \fBbundle gem\fR use\.
+.
+.TP
+\fB\-\-no\-coc\fR
+Do not create a \fBCODE_OF_CONDUCT\.md\fR (overrides \fB\-\-coc\fR specified in the global config)\.
+.
+.TP
+\fB\-\-ext\fR
+Add boilerplate for C extension code to the generated project\. This behavior is disabled by default\.
+.
+.TP
+\fB\-\-no\-ext\fR
+Do not add C extension code (overrides \fB\-\-ext\fR specified in the global config)\.
+.
+.TP
+\fB\-\-mit\fR
+Add an MIT license to a \fBLICENSE\.txt\fR file in the root of the generated project\. Your name from the global git config is used for the copyright statement\. If this option is unspecified, an interactive prompt will be displayed and the answer will be saved in Bundler\'s global config for future \fBbundle gem\fR use\.
+.
+.TP
+\fB\-\-no\-mit\fR
+Do not create a \fBLICENSE\.txt\fR (overrides \fB\-\-mit\fR specified in the global config)\.
+.
+.TP
+\fB\-t\fR, \fB\-\-test=minitest\fR, \fB\-\-test=rspec\fR
+Specify the test framework that Bundler should use when generating the project\. Acceptable values are \fBminitest\fR and \fBrspec\fR\. The \fBGEM_NAME\.gemspec\fR will be configured and a skeleton test/spec directory will be created based on this option\. If this option is unspecified, an interactive prompt will be displayed and the answer will be saved in Bundler\'s global config for future \fBbundle gem\fR use\.
+.
+.TP
+\fB\-e\fR, \fB\-\-edit[=EDITOR]\fR
+Open the resulting GEM_NAME\.gemspec in EDITOR, or the default editor if not specified\. The default is \fB$BUNDLER_EDITOR\fR, \fB$VISUAL\fR, or \fB$EDITOR\fR\.
+.
+.SH "SEE ALSO"
+.
+.IP "\(bu" 4
+bundle\-config(1)
+.
+.IP "" 0
+
diff --git a/man/bundle-gem.1.txt b/man/bundle-gem.1.txt
new file mode 100644
index 0000000..74bd4af
--- /dev/null
+++ b/man/bundle-gem.1.txt
@@ -0,0 +1,90 @@
+BUNDLE-GEM(1)							 BUNDLE-GEM(1)
+
+
+
+1mNAME0m
+       1mbundle-gem 22m- Generate a project skeleton for creating a rubygem
+
+1mSYNOPSIS0m
+       1mbundle gem 4m22mGEM_NAME24m 4mOPTIONS0m
+
+1mDESCRIPTION0m
+       Generates a directory named 1mGEM_NAME 22mwith a 1mRakefile22m, 1mGEM_NAME.gemspec22m,
+       and other supporting files and directories that can be used to  develop
+       a rubygem with that name.
+
+       Run  1mrake -T 22min the resulting project for a list of Rake tasks that can
+       used to test and publish the gem to rubygems.org.
+
+       The generated project skeleton  can  be	customized  with  OPTIONS,  as
+       explained  below.  Note	that  these  options can also be specified via
+       Bundler's global configuration file using the following names:
+
+       o   1mgem.coc0m
+
+       o   1mgem.mit0m
+
+       o   1mgem.test0m
+
+
+
+1mOPTIONS0m
+       1m--exe 22mor 1m-b 22mor 1m--bin0m
+	      Specify that Bundler  should  create  a  binary  executable  (as
+	      1mexe/GEM_NAME22m) in the generated rubygem project. This binary will
+	      also be added to the 1mGEM_NAME.gemspec 22mmanifest. This behavior is
+	      disabled by default.
+
+       1m--no-exe0m
+	      Do  not create a binary (overrides 1m--exe 22mspecified in the global
+	      config).
+
+       1m--coc	22mAdd a 1mCODE_OF_CONDUCT.md 22mfile  to  the	root  of  the  generated
+	      project.	If  this  option is unspecified, an interactive prompt
+	      will be displayed and the answer	will  be  saved  in  Bundler's
+	      global config for future 1mbundle gem 22muse.
+
+       1m--no-coc0m
+	      Do not create a 1mCODE_OF_CONDUCT.md 22m(overrides 1m--coc 22mspecified in
+	      the global config).
+
+       1m--ext	22mAdd boilerplate for C extension code to the	generated  project.
+	      This behavior is disabled by default.
+
+       1m--no-ext0m
+	      Do  not  add  C extension code (overrides 1m--ext 22mspecified in the
+	      global config).
+
+       1m--mit	22mAdd an MIT license to a 1mLICENSE.txt 22mfile in the root of the gen-
+	      erated project. Your name from the global git config is used for
+	      the copyright statement.	If  this  option  is  unspecified,  an
+	      interactive  prompt  will  be  displayed	and the answer will be
+	      saved in Bundler's global config for future 1mbundle gem 22muse.
+
+       1m--no-mit0m
+	      Do not create a 1mLICENSE.txt 22m(overrides 1m--mit  22mspecified  in  the
+	      global config).
+
+       1m-t22m, 1m--test=minitest22m, 1m--test=rspec0m
+	      Specify the test framework that Bundler should use when generat-
+	      ing the project. Acceptable values are 1mminitest 22mand	1mrspec22m.  The
+	      1mGEM_NAME.gemspec  22mwill  be  configured  and a skeleton test/spec
+	      directory will be created based on this option. If  this	option
+	      is  unspecified, an interactive prompt will be displayed and the
+	      answer will be saved in Bundler's global config for future  1mbun-0m
+	      1mdle gem 22muse.
+
+       1m-e22m, 1m--edit[=EDITOR]0m
+	      Open  the  resulting  GEM_NAME.gemspec in EDITOR, or the default
+	      editor if not specified. The default is  1m$BUNDLER_EDITOR22m,  1m$VIS-0m
+	      1mUAL22m, or 1m$EDITOR22m.
+
+1mSEE ALSO0m
+       o   bundle-config(1)
+
+
+
+
+
+
+				 November 2016			 BUNDLE-GEM(1)
diff --git a/man/bundle-info.1 b/man/bundle-info.1
new file mode 100644
index 0000000..15aefdf
--- /dev/null
+++ b/man/bundle-info.1
@@ -0,0 +1,20 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-INFO" "1" "May 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-info\fR \- Show information for the given gem in your bundle
+.
+.SH "SYNOPSIS"
+\fBbundle info\fR [GEM] [\-\-path]
+.
+.SH "DESCRIPTION"
+Print the basic information about the provided GEM such as homepage, version, path and summary\.
+.
+.SH "OPTIONS"
+.
+.TP
+\fB\-\-path\fR
+Print the path of the given gem
+
diff --git a/man/bundle-info.1.txt b/man/bundle-info.1.txt
new file mode 100644
index 0000000..6c78195
--- /dev/null
+++ b/man/bundle-info.1.txt
@@ -0,0 +1,21 @@
+BUNDLE-INFO(1)							BUNDLE-INFO(1)
+
+
+
+1mNAME0m
+       1mbundle-info 22m- Show information for the given gem in your bundle
+
+1mSYNOPSIS0m
+       1mbundle info 22m[GEM] [--path]
+
+1mDESCRIPTION0m
+       Print  the  basic  information about the provided GEM such as homepage,
+       version, path and summary.
+
+1mOPTIONS0m
+       1m--path 22mPrint the path of the given gem
+
+
+
+
+				   May 2017			BUNDLE-INFO(1)
diff --git a/man/bundle-info.ronn b/man/bundle-info.ronn
new file mode 100644
index 0000000..47e457a
--- /dev/null
+++ b/man/bundle-info.ronn
@@ -0,0 +1,17 @@
+bundle-info(1) -- Show information for the given gem in your bundle
+=========================================================================
+
+## SYNOPSIS
+
+`bundle info` [GEM]
+              [--path]
+
+## DESCRIPTION
+
+Print the basic information about the provided GEM such as homepage, version,
+path and summary.
+
+## OPTIONS
+
+* `--path`:
+Print the path of the given gem
diff --git a/man/bundle-init.1 b/man/bundle-init.1
new file mode 100644
index 0000000..029ff86
--- /dev/null
+++ b/man/bundle-init.1
@@ -0,0 +1,20 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-INIT" "1" "May 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-init\fR \- Generates a Gemfile into the current working directory
+.
+.SH "SYNOPSIS"
+\fBbundle init\fR [\-\-gemspec=FILE]
+.
+.SH "DESCRIPTION"
+Init generates a default \fBGemfile(5)\fR in the current working directory\. When adding a \fBGemfile(5)\fR to a gem with a gemspec, the \fB\-\-gemspec\fR option will automatically add each dependency listed in the gemspec file to the newly created \fBGemfile(5)\fR\.
+.
+.SH "OPTIONS"
+.
+.TP
+\fB\-\-gemspec\fR
+Use the specified \.gemspec to create the \fBGemfile(5)\fR
+
diff --git a/man/bundle-init.1.txt b/man/bundle-init.1.txt
new file mode 100644
index 0000000..5832c70
--- /dev/null
+++ b/man/bundle-init.1.txt
@@ -0,0 +1,24 @@
+BUNDLE-INIT(1)							BUNDLE-INIT(1)
+
+
+
+1mNAME0m
+       1mbundle-init 22m- Generates a Gemfile into the current working directory
+
+1mSYNOPSIS0m
+       1mbundle init 22m[--gemspec=FILE]
+
+1mDESCRIPTION0m
+       Init  generates	a default 1mGemfile(5) 22min the current working directory.
+       When adding a 1mGemfile(5) 22mto a gem with a gemspec, the 1m--gemspec  22moption
+       will  automatically  add  each dependency listed in the gemspec file to
+       the newly created 1mGemfile(5)22m.
+
+1mOPTIONS0m
+       1m--gemspec0m
+	      Use the specified .gemspec to create the 1mGemfile(5)0m
+
+
+
+
+				   May 2017			BUNDLE-INIT(1)
diff --git a/man/bundle-init.ronn b/man/bundle-init.ronn
new file mode 100644
index 0000000..e5dfd42
--- /dev/null
+++ b/man/bundle-init.ronn
@@ -0,0 +1,18 @@
+bundle-init(1) -- Generates a Gemfile into the current working directory
+========================================================================
+
+## SYNOPSIS
+
+`bundle init` [--gemspec=FILE]
+
+## DESCRIPTION
+
+Init generates a default `Gemfile(5)` in the current working directory. When
+adding a `Gemfile(5)` to a gem with a gemspec, the `--gemspec` option will
+automatically add each dependency listed in the gemspec file to the newly
+created `Gemfile(5)`.
+
+## OPTIONS
+
+* `--gemspec`:
+  Use the specified .gemspec to create the `Gemfile(5)`
diff --git a/man/bundle-inject.1 b/man/bundle-inject.1
new file mode 100644
index 0000000..d94ef6a
--- /dev/null
+++ b/man/bundle-inject.1
@@ -0,0 +1,33 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-INJECT" "1" "May 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
+.
+.SH "SYNOPSIS"
+\fBbundle inject\fR [GEM] [VERSION]
+.
+.SH "DESCRIPTION"
+Adds the named gem(s) with their version requirements to the resolved \fBGemfile(5)\fR\.
+.
+.P
+This command will add the gem to both your \fBGemfile(5)\fR and Gemfile\.lock if it isn\'t listed yet\.
+.
+.P
+Example:
+.
+.IP "" 4
+.
+.nf
+
+bundle install
+bundle inject \'rack\' \'> 0\'
+.
+.fi
+.
+.IP "" 0
+.
+.P
+This will inject the \'rack\' gem with a version greater than 0 in your \fBGemfile(5)\fR and Gemfile\.lock
diff --git a/man/bundle-inject.1.txt b/man/bundle-inject.1.txt
new file mode 100644
index 0000000..9498d5a
--- /dev/null
+++ b/man/bundle-inject.1.txt
@@ -0,0 +1,32 @@
+BUNDLE-INJECT(1)					      BUNDLE-INJECT(1)
+
+
+
+1mNAME0m
+       1mbundle-inject 22m- Add named gem(s) with version requirements to Gemfile
+
+1mSYNOPSIS0m
+       1mbundle inject 22m[GEM] [VERSION]
+
+1mDESCRIPTION0m
+       Adds  the  named gem(s) with their version requirements to the resolved
+       1mGemfile(5)22m.
+
+       This command will add the gem to both your 1mGemfile(5) 22mand  Gemfile.lock
+       if it isn't listed yet.
+
+       Example:
+
+
+
+	   bundle install
+	   bundle inject 'rack' '> 0'
+
+
+
+       This  will  inject the 'rack' gem with a version greater than 0 in your
+       1mGemfile(5) 22mand Gemfile.lock
+
+
+
+				   May 2017		      BUNDLE-INJECT(1)
diff --git a/man/bundle-inject.ronn b/man/bundle-inject.ronn
new file mode 100644
index 0000000..02f5dd8
--- /dev/null
+++ b/man/bundle-inject.ronn
@@ -0,0 +1,22 @@
+bundle-inject(1) -- Add named gem(s) with version requirements to Gemfile
+=========================================================================
+
+## SYNOPSIS
+
+`bundle inject` [GEM] [VERSION]
+
+## DESCRIPTION
+
+Adds the named gem(s) with their version requirements to the resolved
+`Gemfile(5)`.
+
+This command will add the gem to both your `Gemfile(5)` and Gemfile.lock if it
+isn't listed yet.
+
+Example:
+
+    bundle install
+    bundle inject 'rack' '> 0'
+
+This will inject the 'rack' gem with a version greater than 0 in your
+`Gemfile(5)` and Gemfile.lock
diff --git a/man/bundle-install.1 b/man/bundle-install.1
new file mode 100644
index 0000000..0ba5681
--- /dev/null
+++ b/man/bundle-install.1
@@ -0,0 +1,305 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-INSTALL" "1" "June 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
+.
+.SH "SYNOPSIS"
+\fBbundle install\fR [\-\-binstubs[=DIRECTORY]] [\-\-clean] [\-\-full\-index] [\-\-gemfile=GEMFILE] [\-\-jobs=NUMBER] [\-\-local] [\-\-deployment] [\-\-force] [\-\-frozen] [\-\-no\-cache] [\-\-no\-prune] [\-\-path PATH] [\-\-system] [\-\-quiet] [\-\-retry=NUMBER] [\-\-shebang] [\-\-standalone[=GROUP[ GROUP\.\.\.]]] [\-\-trust\-policy=POLICY] [\-\-without=GROUP[ GROUP\.\.\.]] [\-\-with=GROUP[ GROUP\.\.\.]]
+.
+.SH "DESCRIPTION"
+Install the gems specified in your Gemfile(5)\. If this is the first time you run bundle install (and a \fBGemfile\.lock\fR does not exist), Bundler will fetch all remote sources, resolve dependencies and install all needed gems\.
+.
+.P
+If a \fBGemfile\.lock\fR does exist, and you have not updated your Gemfile(5), Bundler will fetch all remote sources, but use the dependencies specified in the \fBGemfile\.lock\fR instead of resolving dependencies\.
+.
+.P
+If a \fBGemfile\.lock\fR does exist, and you have updated your Gemfile(5), Bundler will use the dependencies in the \fBGemfile\.lock\fR for all gems that you did not update, but will re\-resolve the dependencies of gems that you did update\. You can find more information about this update process below under \fICONSERVATIVE UPDATING\fR\.
+.
+.SH "OPTIONS"
+To apply any of \fB\-\-deployment\fR, \fB\-\-path\fR, \fB\-\-binstubs\fR, or \fB\-\-without\fR every time \fBbundle install\fR is run, use \fBbundle config\fR (see bundle\-config(1))\.
+.
+.TP
+\fB\-\-binstubs[=<directory>]\fR
+Creates a directory (defaults to \fB~/bin\fR) and place any executables from the gem there\. These executables run in Bundler\'s context\. If used, you might add this directory to your environment\'s \fBPATH\fR variable\. For instance, if the \fBrails\fR gem comes with a \fBrails\fR executable, this flag will create a \fBbin/rails\fR executable that ensures that all referred dependencies will be resolved using the bundled gems\.
+.
+.TP
+\fB\-\-clean\fR
+On finishing the installation Bundler is going to remove any gems not present in the current Gemfile(5)\. Don\'t worry, gems currently in use will not be removed\.
+.
+.TP
+\fB\-\-full\-index\fR
+Bundler will not call Rubygems\' API endpoint (default) but download and cache a (currently big) index file of all gems\. Performance can be improved for large bundles that seldomly change by enabling this option\.
+.
+.TP
+\fB\-\-gemfile=<gemfile>\fR
+The location of the Gemfile(5) which Bundler should use\. This defaults to a Gemfile(5) in the current working directory\. In general, Bundler will assume that the location of the Gemfile(5) is also the project\'s root and will try to find \fBGemfile\.lock\fR and \fBvendor/cache\fR relative to this location\.
+.
+.TP
+\fB\-\-jobs=[<number>]\fR
+The maximum number of parallel download and install jobs\. The default is \fB1\fR\.
+.
+.TP
+\fB\-\-local\fR
+Do not attempt to connect to \fBrubygems\.org\fR\. Instead, Bundler will use the gems already present in Rubygems\' cache or in \fBvendor/cache\fR\. Note that if a appropriate platform\-specific gem exists on \fBrubygems\.org\fR it will not be found\.
+.
+.TP
+\fB\-\-deployment\fR
+In \fIdeployment mode\fR, Bundler will \'roll\-out\' the bundle for production or CI use\. Please check carefully if you want to have this option enabled in your development environment\.
+.
+.TP
+\fB\-\-force\fR
+Force download every gem, even if the required versions are already available locally\.
+.
+.TP
+\fB\-\-frozen\fR
+Do not allow the Gemfile\.lock to be updated after this install\. Exits non\-zero if there are going to be changes to the Gemfile\.lock\.
+.
+.TP
+\fB\-\-system\fR
+Installs the gems specified in the bundle to the system\'s Rubygems location\. This overrides any previous configuration of \fB\-\-path\fR\.
+.
+.TP
+\fB\-\-no\-cache\fR
+Do not update the cache in \fBvendor/cache\fR with the newly bundled gems\. This does not remove any gems in the cache but keeps the newly bundled gems from being cached during the install\.
+.
+.TP
+\fB\-\-no\-prune\fR
+Don\'t remove stale gems from the cache when the installation finishes\.
+.
+.TP
+\fB\-\-path=<path>\fR
+The location to install the specified gems to\. This defaults to Rubygems\' setting\. Bundler shares this location with Rubygems, \fBgem install \.\.\.\fR will have gem installed there, too\. Therefore, gems installed without a \fB\-\-path \.\.\.\fR setting will show up by calling \fBgem list\fR\. Accordingly, gems installed to other locations will not get listed\.
+.
+.TP
+\fB\-\-quiet\fR
+Do not print progress information to the standard output\. Instead, Bundler will exit using a status code (\fB$?\fR)\.
+.
+.TP
+\fB\-\-retry=[<number>]\fR
+Retry failed network or git requests for \fInumber\fR times\.
+.
+.TP
+\fB\-\-shebang=<ruby\-executable>\fR
+Uses the specified ruby executable (usually \fBruby\fR) to execute the scripts created with \fB\-\-binstubs\fR\. In addition, if you use \fB\-\-binstubs\fR together with \fB\-\-shebang jruby\fR these executables will be changed to execute \fBjruby\fR instead\.
+.
+.TP
+\fB\-\-standalone[=<list>]\fR
+Makes a bundle that can work without depending on Rubygems or Bundler at runtime\. A space separated list of groups to install has to be specified\. Bundler creates a directory named \fBbundle\fR and installs the bundle there\. It also generates a \fBbundle/bundler/setup\.rb\fR file to replace Bundler\'s own setup in the manner required\. Using this option implicitly sets \fBpath\fR, which is a [remembered option][REMEMBERED OPTIONS]\.
+.
+.TP
+\fB\-\-trust\-policy=[<policy>]\fR
+Apply the Rubygems security policy \fIpolicy\fR, where policy is one of \fBHighSecurity\fR, \fBMediumSecurity\fR, \fBLowSecurity\fR, \fBAlmostNoSecurity\fR, or \fBNoSecurity\fR\. For more details, please see the Rubygems signing documentation linked below in \fISEE ALSO\fR\.
+.
+.TP
+\fB\-\-without=<list>\fR
+A space\-separated list of groups referencing gems to skip during installation\. If a group is given that is in the remembered list of groups given to \-\-with, it is removed from that list\.
+.
+.TP
+\fB\-\-with=<list>\fR
+A space\-separated list of groups referencing gems to install\. If an optional group is given it is installed\. If a group is given that is in the remembered list of groups given to \-\-without, it is removed from that list\.
+.
+.SH "DEPLOYMENT MODE"
+Bundler\'s defaults are optimized for development\. To switch to defaults optimized for deployment and for CI, use the \fB\-\-deployment\fR flag\. Do not activate deployment mode on development machines, as it will cause an error when the Gemfile(5) is modified\.
+.
+.IP "1." 4
+A \fBGemfile\.lock\fR is required\.
+.
+.IP
+To ensure that the same versions of the gems you developed with and tested with are also used in deployments, a \fBGemfile\.lock\fR is required\.
+.
+.IP
+This is mainly to ensure that you remember to check your \fBGemfile\.lock\fR into version control\.
+.
+.IP "2." 4
+The \fBGemfile\.lock\fR must be up to date
+.
+.IP
+In development, you can modify your Gemfile(5) and re\-run \fBbundle install\fR to \fIconservatively update\fR your \fBGemfile\.lock\fR snapshot\.
+.
+.IP
+In deployment, your \fBGemfile\.lock\fR should be up\-to\-date with changes made in your Gemfile(5)\.
+.
+.IP "3." 4
+Gems are installed to \fBvendor/bundle\fR not your default system location
+.
+.IP
+In development, it\'s convenient to share the gems used in your application with other applications and other scripts that run on the system\.
+.
+.IP
+In deployment, isolation is a more important default\. In addition, the user deploying the application may not have permission to install gems to the system, or the web server may not have permission to read them\.
+.
+.IP
+As a result, \fBbundle install \-\-deployment\fR installs gems to the \fBvendor/bundle\fR directory in the application\. This may be overridden using the \fB\-\-path\fR option\.
+.
+.IP "" 0
+.
+.SH "SUDO USAGE"
+By default, Bundler installs gems to the same location as \fBgem install\fR\.
+.
+.P
+In some cases, that location may not be writable by your Unix user\. In that case, Bundler will stage everything in a temporary directory, then ask you for your \fBsudo\fR password in order to copy the gems into their system location\.
+.
+.P
+From your perspective, this is identical to installing the gems directly into the system\.
+.
+.P
+You should never use \fBsudo bundle install\fR\. This is because several other steps in \fBbundle install\fR must be performed as the current user:
+.
+.IP "\(bu" 4
+Updating your \fBGemfile\.lock\fR
+.
+.IP "\(bu" 4
+Updating your \fBvendor/cache\fR, if necessary
+.
+.IP "\(bu" 4
+Checking out private git repositories using your user\'s SSH keys
+.
+.IP "" 0
+.
+.P
+Of these three, the first two could theoretically be performed by \fBchown\fRing the resulting files to \fB$SUDO_USER\fR\. The third, however, can only be performed by invoking the \fBgit\fR command as the current user\. Therefore, git gems are downloaded and installed into \fB~/\.bundle\fR rather than $GEM_HOME or $BUNDLE_PATH\.
+.
+.P
+As a result, you should run \fBbundle install\fR as the current user, and Bundler will ask for your password if it is needed to put the gems into their final location\.
+.
+.SH "INSTALLING GROUPS"
+By default, \fBbundle install\fR will install all gems in all groups in your Gemfile(5), except those declared for a different platform\.
+.
+.P
+However, you can explicitly tell Bundler to skip installing certain groups with the \fB\-\-without\fR option\. This option takes a space\-separated list of groups\.
+.
+.P
+While the \fB\-\-without\fR option will skip \fIinstalling\fR the gems in the specified groups, it will still \fIdownload\fR those gems and use them to resolve the dependencies of every gem in your Gemfile(5)\.
+.
+.P
+This is so that installing a different set of groups on another machine (such as a production server) will not change the gems and versions that you have already developed and tested against\.
+.
+.P
+\fBBundler offers a rock\-solid guarantee that the third\-party code you are running in development and testing is also the third\-party code you are running in production\. You can choose to exclude some of that code in different environments, but you will never be caught flat\-footed by different versions of third\-party code being used in different environments\.\fR
+.
+.P
+For a simple illustration, consider the following Gemfile(5):
+.
+.IP "" 4
+.
+.nf
+
+source \'https://rubygems\.org\'
+
+gem \'sinatra\'
+
+group :production do
+  gem \'rack\-perftools\-profiler\'
+end
+.
+.fi
+.
+.IP "" 0
+.
+.P
+In this case, \fBsinatra\fR depends on any version of Rack (\fB>= 1\.0\fR), while \fBrack\-perftools\-profiler\fR depends on 1\.x (\fB~> 1\.0\fR)\.
+.
+.P
+When you run \fBbundle install \-\-without production\fR in development, we look at the dependencies of \fBrack\-perftools\-profiler\fR as well\. That way, you do not spend all your time developing against Rack 2\.0, using new APIs unavailable in Rack 1\.x, only to have Bundler switch to Rack 1\.2 when the \fBproduction\fR group \fIis\fR used\.
+.
+.P
+This should not cause any problems in practice, because we do not attempt to \fBinstall\fR the gems in the excluded groups, and only evaluate as part of the dependency resolution process\.
+.
+.P
+This also means that you cannot include different versions of the same gem in different groups, because doing so would result in different sets of dependencies used in development and production\. Because of the vagaries of the dependency resolution process, this usually affects more than the gems you list in your Gemfile(5), and can (surprisingly) radically change the gems you are using\.
+.
+.SH "THE GEMFILE\.LOCK"
+When you run \fBbundle install\fR, Bundler will persist the full names and versions of all gems that you used (including dependencies of the gems specified in the Gemfile(5)) into a file called \fBGemfile\.lock\fR\.
+.
+.P
+Bundler uses this file in all subsequent calls to \fBbundle install\fR, which guarantees that you always use the same exact code, even as your application moves across machines\.
+.
+.P
+Because of the way dependency resolution works, even a seemingly small change (for instance, an update to a point\-release of a dependency of a gem in your Gemfile(5)) can result in radically different gems being needed to satisfy all dependencies\.
+.
+.P
+As a result, you \fBSHOULD\fR check your \fBGemfile\.lock\fR into version control\. If you do not, every machine that checks out your repository (including your production server) will resolve all dependencies again, which will result in different versions of third\-party code being used if \fBany\fR of the gems in the Gemfile(5) or any of their dependencies have been updated\.
+.
+.SH "CONSERVATIVE UPDATING"
+When you make a change to the Gemfile(5) and then run \fBbundle install\fR, Bundler will update only the gems that you modified\.
+.
+.P
+In other words, if a gem that you \fBdid not modify\fR worked before you called \fBbundle install\fR, it will continue to use the exact same versions of all dependencies as it used before the update\.
+.
+.P
+Let\'s take a look at an example\. Here\'s your original Gemfile(5):
+.
+.IP "" 4
+.
+.nf
+
+source \'https://rubygems\.org\'
+
+gem \'actionpack\', \'2\.3\.8\'
+gem \'activemerchant\'
+.
+.fi
+.
+.IP "" 0
+.
+.P
+In this case, both \fBactionpack\fR and \fBactivemerchant\fR depend on \fBactivesupport\fR\. The \fBactionpack\fR gem depends on \fBactivesupport 2\.3\.8\fR and \fBrack ~> 1\.1\.0\fR, while the \fBactivemerchant\fR gem depends on \fBactivesupport >= 2\.3\.2\fR, \fBbraintree >= 2\.0\.0\fR, and \fBbuilder >= 2\.0\.0\fR\.
+.
+.P
+When the dependencies are first resolved, Bundler will select \fBactivesupport 2\.3\.8\fR, which satisfies the requirements of both gems in your Gemfile(5)\.
+.
+.P
+Next, you modify your Gemfile(5) to:
+.
+.IP "" 4
+.
+.nf
+
+source \'https://rubygems\.org\'
+
+gem \'actionpack\', \'3\.0\.0\.rc\'
+gem \'activemerchant\'
+.
+.fi
+.
+.IP "" 0
+.
+.P
+The \fBactionpack 3\.0\.0\.rc\fR gem has a number of new dependencies, and updates the \fBactivesupport\fR dependency to \fB= 3\.0\.0\.rc\fR and the \fBrack\fR dependency to \fB~> 1\.2\.1\fR\.
+.
+.P
+When you run \fBbundle install\fR, Bundler notices that you changed the \fBactionpack\fR gem, but not the \fBactivemerchant\fR gem\. It evaluates the gems currently being used to satisfy its requirements:
+.
+.TP
+\fBactivesupport 2\.3\.8\fR
+also used to satisfy a dependency in \fBactivemerchant\fR, which is not being updated
+.
+.TP
+\fBrack ~> 1\.1\.0\fR
+not currently being used to satisfy another dependency
+.
+.P
+Because you did not explicitly ask to update \fBactivemerchant\fR, you would not expect it to suddenly stop working after updating \fBactionpack\fR\. However, satisfying the new \fBactivesupport 3\.0\.0\.rc\fR dependency of actionpack requires updating one of its dependencies\.
+.
+.P
+Even though \fBactivemerchant\fR declares a very loose dependency that theoretically matches \fBactivesupport 3\.0\.0\.rc\fR, Bundler treats gems in your Gemfile(5) that have not changed as an atomic unit together with their dependencies\. In this case, the \fBactivemerchant\fR dependency is treated as \fBactivemerchant 1\.7\.1 + activesupport 2\.3\.8\fR, so \fBbundle install\fR will report that it cannot update \fBactionpack\fR\.
+.
+.P
+To explicitly update \fBactionpack\fR, including its dependencies which other gems in the Gemfile(5) still depend on, run \fBbundle update actionpack\fR (see \fBbundle update(1)\fR)\.
+.
+.P
+\fBSummary\fR: In general, after making a change to the Gemfile(5) , you should first try to run \fBbundle install\fR, which will guarantee that no other gem in the Gemfile(5) is impacted by the change\. If that does not work, run bundle update(1) \fIbundle\-update\.1\.html\fR\.
+.
+.SH "SEE ALSO"
+.
+.IP "\(bu" 4
+Gem install docs: http://guides\.rubygems\.org/rubygems\-basics/#installing\-gems
+.
+.IP "\(bu" 4
+Rubygems signing docs: http://guides\.rubygems\.org/security/
+.
+.IP "" 0
+
diff --git a/man/bundle-install.1.txt b/man/bundle-install.1.txt
new file mode 100644
index 0000000..bccfcfd
--- /dev/null
+++ b/man/bundle-install.1.txt
@@ -0,0 +1,385 @@
+BUNDLE-INSTALL(1)					     BUNDLE-INSTALL(1)
+
+
+
+1mNAME0m
+       1mbundle-install 22m- Install the dependencies specified in your Gemfile
+
+1mSYNOPSIS0m
+       1mbundle   install   22m[--binstubs[=DIRECTORY]]   [--clean]  [--full-index]
+       [--gemfile=GEMFILE] [--jobs=NUMBER] [--local] [--deployment]  [--force]
+       [--frozen] [--no-cache] [--no-prune] [--path PATH] [--system] [--quiet]
+       [--retry=NUMBER]    [--shebang]	  [--standalone[=GROUP[    GROUP...]]]
+       [--trust-policy=POLICY]	 [--without=GROUP[  GROUP...]]	[--with=GROUP[
+       GROUP...]]
+
+1mDESCRIPTION0m
+       Install the gems specified in your Gemfile(5). If  this	is  the  first
+       time  you  run  bundle  install	(and  a  1mGemfile.lock 22mdoes not exist),
+       Bundler will fetch all remote sources, resolve dependencies and install
+       all needed gems.
+
+       If a 1mGemfile.lock 22mdoes exist, and you have not updated your Gemfile(5),
+       Bundler will fetch all remote sources, but use the dependencies	speci-
+       fied in the 1mGemfile.lock 22minstead of resolving dependencies.
+
+       If  a  1mGemfile.lock  22mdoes  exist, and you have updated your Gemfile(5),
+       Bundler will use the dependencies in the 1mGemfile.lock 22mfor all gems that
+       you  did  not update, but will re-resolve the dependencies of gems that
+       you did update. You can find more information about this update process
+       below under 4mCONSERVATIVE24m 4mUPDATING24m.
+
+1mOPTIONS0m
+       To  apply  any  of 1m--deployment22m, 1m--path22m, 1m--binstubs22m, or 1m--without 22mevery
+       time 1mbundle install 22mis run, use 1mbundle config 22m(see bundle-config(1)).
+
+       1m--binstubs[=<directory>]0m
+	      Creates a directory (defaults to 1m~/bin22m) and place  any  executa-
+	      bles from the gem there. These executables run in Bundler's con-
+	      text. If used, you might add this  directory  to	your  environ-
+	      ment's  1mPATH 22mvariable. For instance, if the 1mrails 22mgem comes with
+	      a 1mrails 22mexecutable, this flag will create a 1mbin/rails 22mexecutable
+	      that  ensures  that  all	referred dependencies will be resolved
+	      using the bundled gems.
+
+       1m--clean0m
+	      On finishing the installation Bundler is	going  to  remove  any
+	      gems  not  present  in the current Gemfile(5). Don't worry, gems
+	      currently in use will not be removed.
+
+       1m--full-index0m
+	      Bundler will not call Rubygems' API endpoint (default) but down-
+	      load and cache a (currently big) index file of all gems. Perfor-
+	      mance can be improved for large bundles that seldomly change  by
+	      enabling this option.
+
+       1m--gemfile=<gemfile>0m
+	      The  location  of  the Gemfile(5) which Bundler should use. This
+	      defaults to a Gemfile(5) in the current  working	directory.  In
+	      general, Bundler will assume that the location of the Gemfile(5)
+	      is also the project's root and will try to find 1mGemfile.lock 22mand
+	      1mvendor/cache 22mrelative to this location.
+
+       1m--jobs=[<number>]0m
+	      The  maximum  number  of parallel download and install jobs. The
+	      default is 1m122m.
+
+       1m--local0m
+	      Do not attempt to connect to 1mrubygems.org22m. Instead, Bundler will
+	      use  the	gems  already  present	in  Rubygems' cache or in 1mven-0m
+	      1mdor/cache22m. Note that  if  a	appropriate  platform-specific	gem
+	      exists on 1mrubygems.org 22mit will not be found.
+
+       1m--deployment0m
+	      In  4mdeployment24m 4mmode24m, Bundler will 'roll-out' the bundle for pro-
+	      duction or CI use. Please check carefully if you	want  to  have
+	      this option enabled in your development environment.
+
+       1m--force0m
+	      Force  download  every  gem,  even  if the required versions are
+	      already available locally.
+
+       1m--frozen0m
+	      Do not allow the Gemfile.lock to be updated after this  install.
+	      Exits  non-zero  if  there  are  going to be changes to the Gem-
+	      file.lock.
+
+       1m--system0m
+	      Installs the gems  specified  in	the  bundle  to  the  system's
+	      Rubygems	location. This overrides any previous configuration of
+	      1m--path22m.
+
+       1m--no-cache0m
+	      Do not update the cache in 1mvendor/cache 22mwith the  newly  bundled
+	      gems.  This  does not remove any gems in the cache but keeps the
+	      newly bundled gems from being cached during the install.
+
+       1m--no-prune0m
+	      Don't remove stale gems from the	cache  when  the  installation
+	      finishes.
+
+       1m--path=<path>0m
+	      The  location to install the specified gems to. This defaults to
+	      Rubygems' setting. Bundler shares this location  with  Rubygems,
+	      1mgem  install  ... 22mwill have gem installed there, too. Therefore,
+	      gems installed without a 1m--path ...  22msetting  will  show  up  by
+	      calling 1mgem list22m. Accordingly, gems installed to other locations
+	      will not get listed.
+
+       1m--quiet0m
+	      Do not  print  progress  information  to	the  standard  output.
+	      Instead, Bundler will exit using a status code (1m$?22m).
+
+       1m--retry=[<number>]0m
+	      Retry failed network or git requests for 4mnumber24m times.
+
+       1m--shebang=<ruby-executable>0m
+	      Uses the specified ruby executable (usually 1mruby22m) to execute the
+	      scripts created with 1m--binstubs22m. In addition, if you use  1m--bin-0m
+	      1mstubs  22mtogether  with  1m--shebang jruby 22mthese executables will be
+	      changed to execute 1mjruby 22minstead.
+
+       1m--standalone[=<list>]0m
+	      Makes a bundle that can work without depending  on  Rubygems  or
+	      Bundler  at runtime. A space separated list of groups to install
+	      has to be specified. Bundler creates a  directory  named	1mbundle0m
+	      and  installs  the  bundle  there.  It  also  generates  a  1mbun-0m
+	      1mdle/bundler/setup.rb 22mfile to replace Bundler's own setup in	the
+	      manner  required.  Using this option implicitly sets 1mpath22m, which
+	      is a [remembered option][REMEMBERED OPTIONS].
+
+       1m--trust-policy=[<policy>]0m
+	      Apply the Rubygems security policy 4mpolicy24m, where policy  is	one
+	      of  1mHighSecurity22m, 1mMediumSecurity22m, 1mLowSecurity22m, 1mAlmostNoSecurity22m,
+	      or 1mNoSecurity22m. For more details, please see the Rubygems signing
+	      documentation linked below in 4mSEE24m 4mALSO24m.
+
+       1m--without=<list>0m
+	      A space-separated list of groups referencing gems to skip during
+	      installation. If a group is given that is in the remembered list
+	      of groups given to --with, it is removed from that list.
+
+       1m--with=<list>0m
+	      A space-separated list of groups referencing gems to install. If
+	      an optional group is given it is installed. If a group is  given
+	      that  is in the remembered list of groups given to --without, it
+	      is removed from that list.
+
+1mDEPLOYMENT MODE0m
+       Bundler's defaults are optimized for development. To switch to defaults
+       optimized  for deployment and for CI, use the 1m--deployment 22mflag. Do not
+       activate deployment mode on development machines, as it will  cause  an
+       error when the Gemfile(5) is modified.
+
+       1.  A 1mGemfile.lock 22mis required.
+
+	   To ensure that the same versions of the gems you developed with and
+	   tested with	are  also  used  in  deployments,  a  1mGemfile.lock  22mis
+	   required.
+
+	   This  is  mainly  to  ensure  that  you remember to check your 1mGem-0m
+	   1mfile.lock 22minto version control.
+
+       2.  The 1mGemfile.lock 22mmust be up to date
+
+	   In development, you can modify your Gemfile(5)  and	re-run	1mbundle0m
+	   1minstall 22mto 4mconservatively24m 4mupdate24m your 1mGemfile.lock 22msnapshot.
+
+	   In  deployment, your 1mGemfile.lock 22mshould be up-to-date with changes
+	   made in your Gemfile(5).
+
+       3.  Gems are installed to 1mvendor/bundle 22mnot your default  system  loca-
+	   tion
+
+	   In  development,  it's  convenient  to  share the gems used in your
+	   application with other applications and other scripts that  run  on
+	   the system.
+
+	   In  deployment, isolation is a more important default. In addition,
+	   the user deploying the  application	may  not  have	permission  to
+	   install  gems to the system, or the web server may not have permis-
+	   sion to read them.
+
+	   As a result, 1mbundle install --deployment 22minstalls gems to the  1mven-0m
+	   1mdor/bundle  22mdirectory  in  the	application. This may be overridden
+	   using the 1m--path 22moption.
+
+
+
+1mSUDO USAGE0m
+       By default, Bundler installs gems to the same location as 1mgem install22m.
+
+       In some cases, that location may not be writable by your Unix user.  In
+       that case, Bundler will stage everything in a temporary directory, then
+       ask you for your 1msudo 22mpassword in order to copy  the  gems	into  their
+       system location.
+
+       From  your  perspective,  this  is  identical  to  installing  the gems
+       directly into the system.
+
+       You should never use 1msudo bundle install22m. This is because several other
+       steps in 1mbundle install 22mmust be performed as the current user:
+
+       o   Updating your 1mGemfile.lock0m
+
+       o   Updating your 1mvendor/cache22m, if necessary
+
+       o   Checking out private git repositories using your user's SSH keys
+
+
+
+       Of  these  three,  the  first  two  could theoretically be performed by
+       1mchown22ming the resulting files to 1m$SUDO_USER22m.  The  third,  however,  can
+       only  be  performed  by	invoking  the 1mgit 22mcommand as the current user.
+       Therefore, git gems are downloaded and installed into 1m~/.bundle  22mrather
+       than $GEM_HOME or $BUNDLE_PATH.
+
+       As  a  result,  you  should run 1mbundle install 22mas the current user, and
+       Bundler will ask for your password if it is needed to put the gems into
+       their final location.
+
+1mINSTALLING GROUPS0m
+       By  default, 1mbundle install 22mwill install all gems in all groups in your
+       Gemfile(5), except those declared for a different platform.
+
+       However, you can explicitly tell Bundler  to  skip  installing  certain
+       groups  with  the 1m--without 22moption. This option takes a space-separated
+       list of groups.
+
+       While the 1m--without 22moption will skip 4minstalling24m the gems in the  speci-
+       fied  groups, it will still 4mdownload24m those gems and use them to resolve
+       the dependencies of every gem in your Gemfile(5).
+
+       This is so that installing a different set of groups on another machine
+       (such  as  a  production  server) will not change the gems and versions
+       that you have already developed and tested against.
+
+       1mBundler offers a rock-solid guarantee that the third-party code you are0m
+       1mrunning in development and testing is also the third-party code you are0m
+       1mrunning in production. You can choose to exclude some of that	code  in0m
+       1mdifferent  environments,  but	you  will never be caught flat-footed by0m
+       1mdifferent versions of third-party code being used in different environ-0m
+       1mments.0m
+
+       For a simple illustration, consider the following Gemfile(5):
+
+
+
+	   source 'https://rubygems.org'
+
+	   gem 'sinatra'
+
+	   group :production do
+	     gem 'rack-perftools-profiler'
+	   end
+
+
+
+       In  this  case,	1msinatra 22mdepends on any version of Rack (1m>= 1.022m), while
+       1mrack-perftools-profiler 22mdepends on 1.x (1m~> 1.022m).
+
+       When you run 1mbundle install --without	production  22min  development,  we
+       look  at the dependencies of 1mrack-perftools-profiler 22mas well. That way,
+       you do not spend all your time developing against Rack 2.0,  using  new
+       APIs  unavailable  in Rack 1.x, only to have Bundler switch to Rack 1.2
+       when the 1mproduction 22mgroup 4mis24m used.
+
+       This should not cause any problems  in  practice,  because  we  do  not
+       attempt	to  1minstall 22mthe gems in the excluded groups, and only evaluate
+       as part of the dependency resolution process.
+
+       This also means that you cannot include different versions of the  same
+       gem  in	different  groups,  because doing so would result in different
+       sets of dependencies used in development and production. Because of the
+       vagaries  of  the  dependency  resolution process, this usually affects
+       more than the gems you list in your Gemfile(5), and can	(surprisingly)
+       radically change the gems you are using.
+
+1mTHE GEMFILE.LOCK0m
+       When  you  run  1mbundle install22m, Bundler will persist the full names and
+       versions of all gems that you used (including dependencies of the  gems
+       specified in the Gemfile(5)) into a file called 1mGemfile.lock22m.
+
+       Bundler uses this file in all subsequent calls to 1mbundle install22m, which
+       guarantees that you always use the same exact code, even as your appli-
+       cation moves across machines.
+
+       Because	of the way dependency resolution works, even a seemingly small
+       change (for instance, an update to a point-release of a dependency of a
+       gem  in	your  Gemfile(5)) can result in radically different gems being
+       needed to satisfy all dependencies.
+
+       As a result, you 1mSHOULD 22mcheck your 1mGemfile.lock 22minto  version	control.
+       If you do not, every machine that checks out your repository (including
+       your production server) will resolve all dependencies again, which will
+       result  in  different versions of third-party code being used if 1many 22mof
+       the gems in the Gemfile(5) or  any  of  their  dependencies  have  been
+       updated.
+
+1mCONSERVATIVE UPDATING0m
+       When  you  make a change to the Gemfile(5) and then run 1mbundle install22m,
+       Bundler will update only the gems that you modified.
+
+       In other words, if a gem that you 1mdid	not  modify  22mworked	before	you
+       called  1mbundle install22m, it will continue to use the exact same versions
+       of all dependencies as it used before the update.
+
+       Let's take a look at an example. Here's your original Gemfile(5):
+
+
+
+	   source 'https://rubygems.org'
+
+	   gem 'actionpack', '2.3.8'
+	   gem 'activemerchant'
+
+
+
+       In this case, both 1mactionpack 22mand 1mactivemerchant 22mdepend  on  1mactivesup-0m
+       1mport22m.  The	1mactionpack  22mgem  depends on 1mactivesupport 2.3.8 22mand 1mrack ~>0m
+       1m1.1.022m, while the 1mactivemerchant 22mgem depends on 1mactivesupport >=  2.3.222m,
+       1mbraintree >= 2.0.022m, and 1mbuilder >= 2.0.022m.
+
+       When   the   dependencies  are  first  resolved,  Bundler  will	select
+       1mactivesupport 2.3.822m, which satisfies the requirements of both  gems  in
+       your Gemfile(5).
+
+       Next, you modify your Gemfile(5) to:
+
+
+
+	   source 'https://rubygems.org'
+
+	   gem 'actionpack', '3.0.0.rc'
+	   gem 'activemerchant'
+
+
+
+       The  1mactionpack  3.0.0.rc  22mgem  has  a  number of new dependencies, and
+       updates the 1mactivesupport 22mdependency to 1m= 3.0.0.rc 22mand the 1mrack  22mdepen-
+       dency to 1m~> 1.2.122m.
+
+       When  you  run  1mbundle  install22m,  Bundler  notices that you changed the
+       1mactionpack 22mgem, but not the 1mactivemerchant 22mgem. It evaluates  the  gems
+       currently being used to satisfy its requirements:
+
+       1mactivesupport 2.3.80m
+	      also  used  to  satisfy a dependency in 1mactivemerchant22m, which is
+	      not being updated
+
+       1mrack ~> 1.1.00m
+	      not currently being used to satisfy another dependency
+
+       Because you did not explicitly ask to update 1mactivemerchant22m, you  would
+       not  expect it to suddenly stop working after updating 1mactionpack22m. How-
+       ever, satisfying the new 1mactivesupport 3.0.0.rc 22mdependency	of  action-
+       pack requires updating one of its dependencies.
+
+       Even  though 1mactivemerchant 22mdeclares a very loose dependency that theo-
+       retically matches 1mactivesupport 3.0.0.rc22m, Bundler treats gems  in  your
+       Gemfile(5)  that have not changed as an atomic unit together with their
+       dependencies. In this case, the 1mactivemerchant 22mdependency is treated as
+       1mactivemerchant  1.7.1	+  activesupport  2.3.822m,  so 1mbundle install 22mwill
+       report that it cannot update 1mactionpack22m.
+
+       To explicitly update 1mactionpack22m, including its dependencies which other
+       gems  in  the  Gemfile(5) still depend on, run 1mbundle update actionpack0m
+       (see 1mbundle update(1)22m).
+
+       1mSummary22m: In general, after making a change	to  the  Gemfile(5)  ,	you
+       should  first  try  to run 1mbundle install22m, which will guarantee that no
+       other gem in the Gemfile(5) is impacted by the change. If that does not
+       work, run bundle update(1) 4mbundle-update.1.html24m.
+
+1mSEE ALSO0m
+       o   Gem				install 			 docs:
+	   http://guides.rubygems.org/rubygems-basics/#installing-gems
+
+       o   Rubygems signing docs: http://guides.rubygems.org/security/
+
+
+
+
+
+
+				   June 2017		     BUNDLE-INSTALL(1)
diff --git a/man/bundle-install.ronn b/man/bundle-install.ronn
index 92d1d8d..3a03090 100644
--- a/man/bundle-install.ronn
+++ b/man/bundle-install.ronn
@@ -110,7 +110,7 @@ time `bundle install` is run, use `bundle config` (see bundle-config(1)).
   The location to install the specified gems to. This defaults to Rubygems'
   setting. Bundler shares this location with Rubygems, `gem install ...` will
   have gem installed there, too. Therefore, gems installed without a
-  `--path ...` setting will show up by calling `gem list`. Accodingly, gems
+  `--path ...` setting will show up by calling `gem list`. Accordingly, gems
   installed to other locations will not get listed.
 
 * `--quiet`:
diff --git a/man/bundle-lock.1 b/man/bundle-lock.1
new file mode 100644
index 0000000..e0a4ec7
--- /dev/null
+++ b/man/bundle-lock.1
@@ -0,0 +1,84 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-LOCK" "1" "May 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
+.
+.SH "SYNOPSIS"
+\fBbundle lock\fR [\-\-update] [\-\-local] [\-\-print] [\-\-lockfile=PATH] [\-\-full\-index] [\-\-add\-platform] [\-\-remove\-platform] [\-\-patch] [\-\-minor] [\-\-major] [\-\-strict] [\-\-conservative]
+.
+.SH "DESCRIPTION"
+Lock the gems specified in Gemfile\.
+.
+.SH "OPTIONS"
+.
+.TP
+\fB\-\-update=<*gems>\fR
+Ignores the existing lockfile\. Resolve then updates lockfile\. Taking a list of gems or updating all gems if no list is given\.
+.
+.TP
+\fB\-\-local\fR
+Do not attempt to connect to \fBrubygems\.org\fR\. Instead, Bundler will use the gems already present in Rubygems\' cache or in \fBvendor/cache\fR\. Note that if a appropriate platform\-specific gem exists on \fBrubygems\.org\fR it will not be found\.
+.
+.TP
+\fB\-\-print\fR
+Prints the lockfile to STDOUT instead of writing to the file system\.
+.
+.TP
+\fB\-\-lockfile=<path>\fR
+The path where the lockfile should be written to\.
+.
+.TP
+\fB\-\-full\-index\fR
+Fall back to using the single\-file index of all gems\.
+.
+.TP
+\fB\-\-add\-platform\fR
+Add a new platform to the lockfile, re\-resolving for the addition of that platform\.
+.
+.TP
+\fB\-\-remove\-platform\fR
+Remove a platform from the lockfile\.
+.
+.TP
+\fB\-\-patch\fR
+If updating, prefer updating only to next patch version\.
+.
+.TP
+\fB\-\-minor\fR
+If updating, prefer updating only to next minor version\.
+.
+.TP
+\fB\-\-major\fR
+If updating, prefer updating to next major version (default)\.
+.
+.TP
+\fB\-\-strict\fR
+If updating, do not allow any gem to be updated past latest \-\-patch | \-\-minor | \-\-major\.
+.
+.TP
+\fB\-\-conservative\fR
+If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated\.
+.
+.SH "UPDATING ALL GEMS"
+If you run \fBbundle lock\fR with \fB\-\-update\fR option without list of gems, bundler will ignore any previously installed gems and resolve all dependencies again based on the latest versions of all gems available in the sources\.
+.
+.SH "UPDATING A LIST OF GEMS"
+Sometimes, you want to update a single gem in the Gemfile(5), and leave the rest of the gems that you specified locked to the versions in the \fBGemfile\.lock\fR\.
+.
+.P
+For instance, you only want to update \fBnokogiri\fR, run \fBbundle lock \-\-update nokogiri\fR\.
+.
+.P
+Bundler will update \fBnokogiri\fR and any of its dependencies, but leave the rest of the gems that you specified locked to the versions in the \fBGemfile\.lock\fR\.
+.
+.SH "SUPPORTING OTHER PLATFORMS"
+If you want your bundle to support platforms other than the one you\'re running locally, you can run \fBbundle lock \-\-add\-platform PLATFORM\fR to add PLATFORM to the lockfile, force bundler to re\-resolve and consider the new platform when picking gems, all without needing to have a machine that matches PLATFORM handy to install those platform\-specific gems on\.
+.
+.P
+For a full explanation of gem platforms, see \fBgem help platform\fR\.
+.
+.SH "PATCH LEVEL OPTIONS"
+See bundle update(1) \fIbundle\-update\.1\.html\fR for details\.
diff --git a/man/bundle-lock.1.txt b/man/bundle-lock.1.txt
new file mode 100644
index 0000000..b6dc1a5
--- /dev/null
+++ b/man/bundle-lock.1.txt
@@ -0,0 +1,93 @@
+BUNDLE-LOCK(1)							BUNDLE-LOCK(1)
+
+
+
+1mNAME0m
+       1mbundle-lock 22m- Creates / Updates a lockfile without installing
+
+1mSYNOPSIS0m
+       1mbundle    lock   22m[--update]   [--local]   [--print]   [--lockfile=PATH]
+       [--full-index] [--add-platform] [--remove-platform] [--patch] [--minor]
+       [--major] [--strict] [--conservative]
+
+1mDESCRIPTION0m
+       Lock the gems specified in Gemfile.
+
+1mOPTIONS0m
+       1m--update=<*gems>0m
+	      Ignores  the  existing  lockfile. Resolve then updates lockfile.
+	      Taking a list of gems or updating all gems if no list is given.
+
+       1m--local0m
+	      Do not attempt to connect to 1mrubygems.org22m. Instead, Bundler will
+	      use  the	gems  already  present	in  Rubygems' cache or in 1mven-0m
+	      1mdor/cache22m. Note that  if  a	appropriate  platform-specific	gem
+	      exists on 1mrubygems.org 22mit will not be found.
+
+       1m--print0m
+	      Prints  the  lockfile  to  STDOUT instead of writing to the file
+	      system.
+
+       1m--lockfile=<path>0m
+	      The path where the lockfile should be written to.
+
+       1m--full-index0m
+	      Fall back to using the single-file index of all gems.
+
+       1m--add-platform0m
+	      Add a new platform to the lockfile, re-resolving for  the  addi-
+	      tion of that platform.
+
+       1m--remove-platform0m
+	      Remove a platform from the lockfile.
+
+       1m--patch0m
+	      If updating, prefer updating only to next patch version.
+
+       1m--minor0m
+	      If updating, prefer updating only to next minor version.
+
+       1m--major0m
+	      If updating, prefer updating to next major version (default).
+
+       1m--strict0m
+	      If  updating,  do  not  allow  any gem to be updated past latest
+	      --patch | --minor | --major.
+
+       1m--conservative0m
+	      If updating, use bundle install conservative update behavior and
+	      do not allow shared dependencies to be updated.
+
+1mUPDATING ALL GEMS0m
+       If  you	run  1mbundle  lock  22mwith  1m--update 22moption without list of gems,
+       bundler will ignore any	previously  installed  gems  and  resolve  all
+       dependencies  again  based on the latest versions of all gems available
+       in the sources.
+
+1mUPDATING A LIST OF GEMS0m
+       Sometimes, you want to update a single gem in the Gemfile(5), and leave
+       the  rest  of the gems that you specified locked to the versions in the
+       1mGemfile.lock22m.
+
+       For instance, you  only	want  to  update  1mnokogiri22m,  run  1mbundle  lock0m
+       1m--update nokogiri22m.
+
+       Bundler will update 1mnokogiri 22mand any of its dependencies, but leave the
+       rest of the gems that you specified locked to the versions in the  1mGem-0m
+       1mfile.lock22m.
+
+1mSUPPORTING OTHER PLATFORMS0m
+       If  you want your bundle to support platforms other than the one you're
+       running locally, you can run 1mbundle lock --add-platform PLATFORM 22mto add
+       PLATFORM  to the lockfile, force bundler to re-resolve and consider the
+       new platform when picking gems, all without needing to have  a  machine
+       that matches PLATFORM handy to install those platform-specific gems on.
+
+       For a full explanation of gem platforms, see 1mgem help platform22m.
+
+1mPATCH LEVEL OPTIONS0m
+       See bundle update(1) 4mbundle-update.1.html24m for details.
+
+
+
+				   May 2017			BUNDLE-LOCK(1)
diff --git a/man/bundle-lock.ronn b/man/bundle-lock.ronn
index 8afc50a..31ecd3c 100644
--- a/man/bundle-lock.ronn
+++ b/man/bundle-lock.ronn
@@ -7,6 +7,14 @@ bundle-lock(1) -- Creates / Updates a lockfile without installing
               [--local]
               [--print]
               [--lockfile=PATH]
+              [--full-index]
+              [--add-platform]
+              [--remove-platform]
+              [--patch]
+              [--minor]
+              [--major]
+              [--strict]
+              [--conservative]
 
 ## DESCRIPTION
 
@@ -30,6 +38,31 @@ Lock the gems specified in Gemfile.
 * `--lockfile=<path>`:
   The path where the lockfile should be written to.
 
+* `--full-index`:
+  Fall back to using the single-file index of all gems.
+
+* `--add-platform`:
+  Add a new platform to the lockfile, re-resolving for the addition of that
+  platform.
+
+* `--remove-platform`:
+  Remove a platform from the lockfile.
+
+* `--patch`:
+  If updating, prefer updating only to next patch version.
+
+* `--minor`:
+  If updating, prefer updating only to next minor version.
+
+* `--major`:
+  If updating, prefer updating to next major version (default).
+
+* `--strict`:
+  If updating, do not allow any gem to be updated past latest --patch | --minor | --major.
+
+* `--conservative`:
+  If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated.
+
 ## UPDATING ALL GEMS
 
 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
 
 Bundler will update `nokogiri` and any of its dependencies, but leave the rest of the
 gems that you specified locked to the versions in the `Gemfile.lock`.
+
+## SUPPORTING OTHER PLATFORMS
+
+If you want your bundle to support platforms other than the one you're running
+locally, you can run `bundle lock --add-platform PLATFORM` to add PLATFORM to
+the lockfile, force bundler to re-resolve and consider the new platform when
+picking gems, all without needing to have a machine that matches PLATFORM handy
+to install those platform-specific gems on.
+
+For a full explanation of gem platforms, see `gem help platform`.
+
+## PATCH LEVEL OPTIONS
+
+See [bundle update(1)][bundle-update] for details.
diff --git a/man/bundle-open.1 b/man/bundle-open.1
new file mode 100644
index 0000000..1ab2ef9
--- /dev/null
+++ b/man/bundle-open.1
@@ -0,0 +1,32 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-OPEN" "1" "May 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
+.
+.SH "SYNOPSIS"
+\fBbundle open\fR [GEM]
+.
+.SH "DESCRIPTION"
+Opens the source directory of the provided GEM in your editor\.
+.
+.P
+For this to work the \fBEDITOR\fR or \fBBUNDLER_EDITOR\fR environment variable has to be set\.
+.
+.P
+Example:
+.
+.IP "" 4
+.
+.nf
+
+bundle open \'rack\'
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Will open the source directory for the \'rack\' gem in your bundle\.
diff --git a/man/bundle-open.1.txt b/man/bundle-open.1.txt
new file mode 100644
index 0000000..79f7192
--- /dev/null
+++ b/man/bundle-open.1.txt
@@ -0,0 +1,29 @@
+BUNDLE-OPEN(1)							BUNDLE-OPEN(1)
+
+
+
+1mNAME0m
+       1mbundle-open 22m- Opens the source directory for a gem in your bundle
+
+1mSYNOPSIS0m
+       1mbundle open 22m[GEM]
+
+1mDESCRIPTION0m
+       Opens the source directory of the provided GEM in your editor.
+
+       For  this to work the 1mEDITOR 22mor 1mBUNDLER_EDITOR 22menvironment variable has
+       to be set.
+
+       Example:
+
+
+
+	   bundle open 'rack'
+
+
+
+       Will open the source directory for the 'rack' gem in your bundle.
+
+
+
+				   May 2017			BUNDLE-OPEN(1)
diff --git a/man/bundle-open.ronn b/man/bundle-open.ronn
new file mode 100644
index 0000000..497beac
--- /dev/null
+++ b/man/bundle-open.ronn
@@ -0,0 +1,19 @@
+bundle-open(1) -- Opens the source directory for a gem in your bundle
+=====================================================================
+
+## SYNOPSIS
+
+`bundle open` [GEM]
+
+## DESCRIPTION
+
+Opens the source directory of the provided GEM in your editor.
+
+For this to work the `EDITOR` or `BUNDLER_EDITOR` environment variable has to
+be set.
+
+Example:
+
+    bundle open 'rack'
+
+Will open the source directory for the 'rack' gem in your bundle.
diff --git a/man/bundle-outdated.1 b/man/bundle-outdated.1
new file mode 100644
index 0000000..ed5bff1
--- /dev/null
+++ b/man/bundle-outdated.1
@@ -0,0 +1,151 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-OUTDATED" "1" "May 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-outdated\fR \- List installed gems with newer versions available
+.
+.SH "SYNOPSIS"
+\fBbundle outdated\fR [GEM] [\-\-local] [\-\-pre] [\-\-source] [\-\-strict] [\-\-parseable | \-\-porcelain] [\-\-group=GROUP] [\-\-groups] [\-\-update\-strict] [\-\-patch|\-\-minor|\-\-major] [\-\-filter\-major] [\-\-filter\-minor] [\-\-filter\-patch]
+.
+.SH "DESCRIPTION"
+Outdated lists the names and versions of gems that have a newer version available in the given source\. Calling outdated with [GEM [GEM]] will only check for newer versions of the given gems\. Prerelease gems are ignored by default\. If your gems are up to date, Bundler will exit with a status of 0\. Otherwise, it will exit 1\.
+.
+.SH "OPTIONS"
+.
+.TP
+\fB\-\-local\fR
+Do not attempt to fetch gems remotely and use the gem cache instead\.
+.
+.TP
+\fB\-\-pre\fR
+Check for newer pre\-release gems\.
+.
+.TP
+\fB\-\-source\fR
+Check against a specific source\.
+.
+.TP
+\fB\-\-strict\fR
+Only list newer versions allowed by your Gemfile requirements\.
+.
+.TP
+\fB\-\-parseable\fR
+Use minimal formatting for more parseable output\.
+.
+.TP
+\fB\-\-group\fR
+List gems from a specific group\.
+.
+.TP
+\fB\-\-groups\fR
+List gems organized by groups\.
+.
+.TP
+\fB\-\-update\-strict\fR
+Strict conservative resolution, do not allow any gem to be updated past latest \-\-patch | \-\-minor| \-\-major\.
+.
+.TP
+\fB\-\-minor\fR
+Prefer updating only to next minor version\.
+.
+.TP
+\fB\-\-major\fR
+Prefer updating to next major version (default)\.
+.
+.TP
+\fB\-\-patch\fR
+Prefer updating only to next patch version\.
+.
+.TP
+\fB\-\-filter\-major\fR
+Only list major newer versions\.
+.
+.TP
+\fB\-\-filter\-minor\fR
+Only list minor newer versions\.
+.
+.TP
+\fB\-\-filter\-patch\fR
+Only list patch newer versions\.
+.
+.SH "PATCH LEVEL OPTIONS"
+See bundle update(1) \fIbundle\-update\.1\.html\fR for details\.
+.
+.P
+One difference between the patch level options in \fBbundle update\fR and here is the \fB\-\-strict\fR option\. \fB\-\-strict\fR was already an option on outdated before the patch level options were added\. \fB\-\-strict\fR wasn\'t altered, and the \fB\-\-update\-strict\fR option on \fBoutdated\fR reflects what \fB\-\-strict\fR does on \fBbundle update\fR\.
+.
+.SH "FILTERING OUTPUT"
+The 3 filtering options do not affect the resolution of versions, merely what versions are shown in the output\.
+.
+.P
+If the regular output shows the following:
+.
+.IP "" 4
+.
+.nf
+
+* faker (newest 1\.6\.6, installed 1\.6\.5, requested ~> 1\.4) in groups "development, test"
+* hashie (newest 3\.4\.6, installed 1\.2\.0, requested = 1\.2\.0) in groups "default"
+* headless (newest 2\.3\.1, installed 2\.2\.3) in groups "test"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+\fB\-\-filter\-major\fR would only show:
+.
+.IP "" 4
+.
+.nf
+
+* hashie (newest 3\.4\.6, installed 1\.2\.0, requested = 1\.2\.0) in groups "default"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+\fB\-\-filter\-minor\fR would only show:
+.
+.IP "" 4
+.
+.nf
+
+* headless (newest 2\.3\.1, installed 2\.2\.3) in groups "test"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+\fB\-\-filter\-patch\fR would only show:
+.
+.IP "" 4
+.
+.nf
+
+* faker (newest 1\.6\.6, installed 1\.6\.5, requested ~> 1\.4) in groups "development, test"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Filter options can be combined\. \fB\-\-filter\-minor\fR and \fB\-\-filter\-patch\fR would show:
+.
+.IP "" 4
+.
+.nf
+
+* faker (newest 1\.6\.6, installed 1\.6\.5, requested ~> 1\.4) in groups "development, test"
+* headless (newest 2\.3\.1, installed 2\.2\.3) in groups "test"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Combining all three \fBfilter\fR options would be the same result as providing none of them\.
diff --git a/man/bundle-outdated.1.txt b/man/bundle-outdated.1.txt
new file mode 100644
index 0000000..402195a
--- /dev/null
+++ b/man/bundle-outdated.1.txt
@@ -0,0 +1,127 @@
+BUNDLE-OUTDATED(1)					    BUNDLE-OUTDATED(1)
+
+
+
+1mNAME0m
+       1mbundle-outdated 22m- List installed gems with newer versions available
+
+1mSYNOPSIS0m
+       1mbundle   outdated   22m[GEM]	[--local]   [--pre]  [--source]  [--strict]
+       [--parseable	|     --porcelain]     [--group=GROUP]	    [--groups]
+       [--update-strict]  [--patch|--minor|--major]  [--filter-major]  [--fil-
+       ter-minor] [--filter-patch]
+
+1mDESCRIPTION0m
+       Outdated lists the names and versions of gems that have a newer version
+       available  in  the given source. Calling outdated with [GEM [GEM]] will
+       only check for newer versions of the given gems.  Prerelease  gems  are
+       ignored by default. If your gems are up to date, Bundler will exit with
+       a status of 0. Otherwise, it will exit 1.
+
+1mOPTIONS0m
+       1m--local0m
+	      Do not attempt to fetch gems remotely  and  use  the  gem  cache
+	      instead.
+
+       1m--pre	22mCheck for newer pre-release gems.
+
+       1m--source0m
+	      Check against a specific source.
+
+       1m--strict0m
+	      Only list newer versions allowed by your Gemfile requirements.
+
+       1m--parseable0m
+	      Use minimal formatting for more parseable output.
+
+       1m--group0m
+	      List gems from a specific group.
+
+       1m--groups0m
+	      List gems organized by groups.
+
+       1m--update-strict0m
+	      Strict  conservative  resolution,  do  not  allow  any gem to be
+	      updated past latest --patch | --minor| --major.
+
+       1m--minor0m
+	      Prefer updating only to next minor version.
+
+       1m--major0m
+	      Prefer updating to next major version (default).
+
+       1m--patch0m
+	      Prefer updating only to next patch version.
+
+       1m--filter-major0m
+	      Only list major newer versions.
+
+       1m--filter-minor0m
+	      Only list minor newer versions.
+
+       1m--filter-patch0m
+	      Only list patch newer versions.
+
+1mPATCH LEVEL OPTIONS0m
+       See bundle update(1) 4mbundle-update.1.html24m for details.
+
+       One difference between the patch level options  in  1mbundle  update  22mand
+       here is the 1m--strict 22moption. 1m--strict 22mwas already an option on outdated
+       before the patch level options were added. 1m--strict 22mwasn't altered, and
+       the  1m--update-strict  22moption on 1moutdated 22mreflects what 1m--strict 22mdoes on
+       1mbundle update22m.
+
+1mFILTERING OUTPUT0m
+       The 3 filtering options do  not	affect	the  resolution  of  versions,
+       merely what versions are shown in the output.
+
+       If the regular output shows the following:
+
+
+
+	   * faker (newest 1.6.6, installed 1.6.5, requested ~> 1.4) in groups "development, test"
+	   * hashie (newest 3.4.6, installed 1.2.0, requested = 1.2.0) in groups "default"
+	   * headless (newest 2.3.1, installed 2.2.3) in groups "test"
+
+
+
+       1m--filter-major 22mwould only show:
+
+
+
+	   * hashie (newest 3.4.6, installed 1.2.0, requested = 1.2.0) in groups "default"
+
+
+
+       1m--filter-minor 22mwould only show:
+
+
+
+	   * headless (newest 2.3.1, installed 2.2.3) in groups "test"
+
+
+
+       1m--filter-patch 22mwould only show:
+
+
+
+	   * faker (newest 1.6.6, installed 1.6.5, requested ~> 1.4) in groups "development, test"
+
+
+
+       Filter options can be combined. 1m--filter-minor 22mand 1m--filter-patch 22mwould
+       show:
+
+
+
+	   * faker (newest 1.6.6, installed 1.6.5, requested ~> 1.4) in groups "development, test"
+	   * headless (newest 2.3.1, installed 2.2.3) in groups "test"
+
+
+
+       Combining all three 1mfilter 22moptions would be the same result as  provid-
+       ing none of them.
+
+
+
+				   May 2017		    BUNDLE-OUTDATED(1)
diff --git a/man/bundle-outdated.ronn b/man/bundle-outdated.ronn
new file mode 100644
index 0000000..47792e6
--- /dev/null
+++ b/man/bundle-outdated.ronn
@@ -0,0 +1,107 @@
+bundle-outdated(1) -- List installed gems with newer versions available
+=======================================================================
+
+## SYNOPSIS
+
+`bundle outdated` [GEM] [--local]
+                        [--pre]
+                        [--source]
+                        [--strict]
+                        [--parseable | --porcelain]
+                        [--group=GROUP]
+                        [--groups]
+                        [--update-strict]
+                        [--patch|--minor|--major]
+                        [--filter-major]
+                        [--filter-minor]
+                        [--filter-patch]
+
+## DESCRIPTION
+
+Outdated lists the names and versions of gems that have a newer version available
+in the given source. Calling outdated with [GEM [GEM]] will only check for newer
+versions of the given gems. Prerelease gems are ignored by default. If your gems
+are up to date, Bundler will exit with a status of 0. Otherwise, it will exit 1.
+
+## OPTIONS
+
+* `--local`:
+  Do not attempt to fetch gems remotely and use the gem cache instead.
+
+* `--pre`:
+  Check for newer pre-release gems.
+
+* `--source`:
+  Check against a specific source.
+
+* `--strict`:
+  Only list newer versions allowed by your Gemfile requirements.
+
+* `--parseable`:
+   Use minimal formatting for more parseable output.
+
+* `--group`:
+  List gems from a specific group.
+
+* `--groups`:
+  List gems organized by groups.
+
+* `--update-strict`:
+  Strict conservative resolution, do not allow any gem to be updated past latest --patch | --minor| --major.
+
+* `--minor`:
+  Prefer updating only to next minor version.
+
+* `--major`:
+  Prefer updating to next major version (default).
+
+* `--patch`:
+  Prefer updating only to next patch version.
+
+* `--filter-major`:
+  Only list major newer versions.
+
+* `--filter-minor`:
+  Only list minor newer versions.
+
+* `--filter-patch`:
+  Only list patch newer versions.
+
+## PATCH LEVEL OPTIONS
+
+See [bundle update(1)][bundle-update] for details.
+
+One difference between the patch level options in `bundle update` and here is the `--strict` option.
+`--strict` was already an option on outdated before the patch level options were added. `--strict`
+wasn't altered, and the `--update-strict` option on `outdated` reflects what `--strict` does on
+`bundle update`.
+
+## FILTERING OUTPUT
+
+The 3 filtering options do not affect the resolution of versions, merely what versions are shown
+in the output.
+
+If the regular output shows the following:
+
+    * faker (newest 1.6.6, installed 1.6.5, requested ~> 1.4) in groups "development, test"
+    * hashie (newest 3.4.6, installed 1.2.0, requested = 1.2.0) in groups "default"
+    * headless (newest 2.3.1, installed 2.2.3) in groups "test"
+
+`--filter-major` would only show:
+
+    * hashie (newest 3.4.6, installed 1.2.0, requested = 1.2.0) in groups "default"
+
+`--filter-minor` would only show:
+
+    * headless (newest 2.3.1, installed 2.2.3) in groups "test"
+
+`--filter-patch` would only show:
+
+    * faker (newest 1.6.6, installed 1.6.5, requested ~> 1.4) in groups "development, test"
+
+Filter options can be combined. `--filter-minor` and `--filter-patch` would show:
+
+    * faker (newest 1.6.6, installed 1.6.5, requested ~> 1.4) in groups "development, test"
+    * headless (newest 2.3.1, installed 2.2.3) in groups "test"
+
+Combining all three `filter` options would be the same result as providing none of them.
diff --git a/man/bundle-package.1 b/man/bundle-package.1
new file mode 100644
index 0000000..a438d58
--- /dev/null
+++ b/man/bundle-package.1
@@ -0,0 +1,52 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-PACKAGE" "1" "January 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-package\fR \- Package your needed \fB\.gem\fR files into your application
+.
+.SH "SYNOPSIS"
+\fBbundle package\fR
+.
+.SH "DESCRIPTION"
+Copy all of the \fB\.gem\fR files needed to run the application into the \fBvendor/cache\fR directory\. In the future, when running bundle install(1) \fIbundle\-install\.1\.html\fR, use the gems in the cache in preference to the ones on \fBrubygems\.org\fR\.
+.
+.SH "GIT AND PATH GEMS"
+Since Bundler 1\.2, the \fBbundle package\fR command can also package \fB:git\fR and \fB:path\fR dependencies besides \.gem files\. This needs to be explicitly enabled via the \fB\-\-all\fR option\. Once used, the \fB\-\-all\fR option will be remembered\.
+.
+.SH "SUPPORT FOR MULTIPLE PLATFORMS"
+When using gems that have different packages for different platforms, Bundler 1\.8 and newer support caching of gems for other platforms where the Gemfile has been resolved (i\.e\. present in the lockfile) in \fBvendor/cache\fR\. This needs to be enabled via the \fB\-\-all\-platforms\fR option\. This setting will be remembered in your local bundler configuration\.
+.
+.SH "REMOTE FETCHING"
+By default, if you run bundle install(1) \fIbundle\-install\.1\.html\fR after running bundle package(1) \fIbundle\-package\.1\.html\fR, bundler will still connect to \fBrubygems\.org\fR to check whether a platform\-specific gem exists for any of the gems in \fBvendor/cache\fR\.
+.
+.P
+For instance, consider this Gemfile(5):
+.
+.IP "" 4
+.
+.nf
+
+source "https://rubygems\.org"
+
+gem "nokogiri"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+If you run \fBbundle package\fR under C Ruby, bundler will retrieve the version of \fBnokogiri\fR for the \fB"ruby"\fR platform\. If you deploy to JRuby and run \fBbundle install\fR, bundler is forced to check to see whether a \fB"java"\fR platformed \fBnokogiri\fR exists\.
+.
+.P
+Even though the \fBnokogiri\fR gem for the Ruby platform is \fItechnically\fR acceptable on JRuby, it has a C extension that does not run on JRuby\. As a result, bundler will, by default, still connect to \fBrubygems\.org\fR to check whether it has a version of one of your gems more specific to your platform\.
+.
+.P
+This problem is also not limited to the \fB"java"\fR platform\. A similar (common) problem can happen when developing on Windows and deploying to Linux, or even when developing on OSX and deploying to Linux\.
+.
+.P
+If you know for sure that the gems packaged in \fBvendor/cache\fR are appropriate for the platform you are on, you can run \fBbundle install \-\-local\fR to skip checking for more appropriate gems, and use the ones in \fBvendor/cache\fR\.
+.
+.P
+One way to be sure that you have the right platformed versions of all your gems is to run \fBbundle package\fR on an identical machine and check in the gems\. For instance, you can run \fBbundle package\fR on an identical staging box during your staging process, and check in the \fBvendor/cache\fR before deploying to production\.
diff --git a/man/bundle-package.1.txt b/man/bundle-package.1.txt
new file mode 100644
index 0000000..3761970
--- /dev/null
+++ b/man/bundle-package.1.txt
@@ -0,0 +1,74 @@
+BUNDLE-PACKAGE(1)					     BUNDLE-PACKAGE(1)
+
+
+
+1mNAME0m
+       1mbundle-package 22m- Package your needed 1m.gem 22mfiles into your application
+
+1mSYNOPSIS0m
+       1mbundle package0m
+
+1mDESCRIPTION0m
+       Copy  all of the 1m.gem 22mfiles needed to run the application into the 1mven-0m
+       1mdor/cache 22mdirectory. In the future, when running bundle install(1) 4mbun-0m
+       4mdle-install.1.html24m, use the gems in the cache in preference to the ones
+       on 1mrubygems.org22m.
+
+1mGIT AND PATH GEMS0m
+       Since Bundler 1.2, the 1mbundle package 22mcommand can also package 1m:git 22mand
+       1m:path	22mdependencies  besides  .gem	files.	This needs to be explicitly
+       enabled via the 1m--all 22moption. Once	used,  the  1m--all  22moption	will  be
+       remembered.
+
+1mSUPPORT FOR MULTIPLE PLATFORMS0m
+       When  using  gems that have different packages for different platforms,
+       Bundler 1.8 and newer support caching of gems for other platforms where
+       the  Gemfile  has  been resolved (i.e. present in the lockfile) in 1mven-0m
+       1mdor/cache22m. This needs to be enabled  via  the  1m--all-platforms  22moption.
+       This setting will be remembered in your local bundler configuration.
+
+1mREMOTE FETCHING0m
+       By  default,  if  you run bundle install(1) 4mbundle-install.1.html24m after
+       running bundle package(1)  4mbundle-package.1.html24m,  bundler	will  still
+       connect to 1mrubygems.org 22mto check whether a platform-specific gem exists
+       for any of the gems in 1mvendor/cache22m.
+
+       For instance, consider this Gemfile(5):
+
+
+
+	   source "https://rubygems.org"
+
+	   gem "nokogiri"
+
+
+
+       If you run 1mbundle package 22munder C Ruby, bundler will retrieve the  ver-
+       sion  of  1mnokogiri  22mfor the 1m"ruby" 22mplatform. If you deploy to JRuby and
+       run 1mbundle install22m, bundler is forced to check to see whether a  1m"java"0m
+       platformed 1mnokogiri 22mexists.
+
+       Even  though  the  1mnokogiri  22mgem  for  the Ruby platform is 4mtechnically0m
+       acceptable on JRuby, it has a C extension that does not run  on	JRuby.
+       As a result, bundler will, by default, still connect to 1mrubygems.org 22mto
+       check whether it has a version of one of your  gems  more  specific  to
+       your platform.
+
+       This  problem  is  also	not  limited to the 1m"java" 22mplatform. A similar
+       (common) problem can happen when developing on Windows and deploying to
+       Linux, or even when developing on OSX and deploying to Linux.
+
+       If  you know for sure that the gems packaged in 1mvendor/cache 22mare appro-
+       priate for the platform you are on, you can run 1mbundle install  --local0m
+       to  skip  checking  for more appropriate gems, and use the ones in 1mven-0m
+       1mdor/cache22m.
+
+       One way to be sure that you have the right platformed versions  of  all
+       your gems is to run 1mbundle package 22mon an identical machine and check in
+       the gems. For instance, you can run  1mbundle  package  22mon  an  identical
+       staging	box during your staging process, and check in the 1mvendor/cache0m
+       before deploying to production.
+
+
+
+				 January 2017		     BUNDLE-PACKAGE(1)
diff --git a/man/bundle-platform.1 b/man/bundle-platform.1
new file mode 100644
index 0000000..df6c9df
--- /dev/null
+++ b/man/bundle-platform.1
@@ -0,0 +1,61 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-PLATFORM" "1" "January 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-platform\fR \- Displays platform compatibility information
+.
+.SH "SYNOPSIS"
+\fBbundle platform\fR [\-\-ruby]
+.
+.SH "DESCRIPTION"
+\fBplatform\fR will display information from your Gemfile, Gemfile\.lock, and Ruby VM about your platform\.
+.
+.P
+For instance, using this Gemfile(5):
+.
+.IP "" 4
+.
+.nf
+
+source "https://rubygems\.org"
+
+ruby "1\.9\.3"
+
+gem "rack"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+If you run \fBbundle platform\fR on Ruby 1\.9\.3, it will display the following output:
+.
+.IP "" 4
+.
+.nf
+
+Your platform is: x86_64\-linux
+
+Your app has gems that work on these platforms:
+* ruby
+
+Your Gemfile specifies a Ruby version requirement:
+* ruby 1\.9\.3
+
+Your current platform satisfies the Ruby version requirement\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+\fBplatform\fR will list all the platforms in your \fBGemfile\.lock\fR as well as the \fBruby\fR directive if applicable from your Gemfile(5)\. It will also let you know if the \fBruby\fR directive requirement has been met\. If \fBruby\fR directive doesn\'t match the running Ruby VM, it will tell you what part does not\.
+.
+.SH "OPTIONS"
+.
+.TP
+\fB\-\-ruby\fR
+It will display the ruby directive information, so you don\'t have to parse it from the Gemfile(5)\.
+
diff --git a/man/bundle-platform.1.txt b/man/bundle-platform.1.txt
new file mode 100644
index 0000000..d721088
--- /dev/null
+++ b/man/bundle-platform.1.txt
@@ -0,0 +1,57 @@
+BUNDLE-PLATFORM(1)					    BUNDLE-PLATFORM(1)
+
+
+
+1mNAME0m
+       1mbundle-platform 22m- Displays platform compatibility information
+
+1mSYNOPSIS0m
+       1mbundle platform 22m[--ruby]
+
+1mDESCRIPTION0m
+       1mplatform  22mwill display information from your Gemfile, Gemfile.lock, and
+       Ruby VM about your platform.
+
+       For instance, using this Gemfile(5):
+
+
+
+	   source "https://rubygems.org"
+
+	   ruby "1.9.3"
+
+	   gem "rack"
+
+
+
+       If you run 1mbundle platform 22mon Ruby 1.9.3, it will display the following
+       output:
+
+
+
+	   Your platform is: x86_64-linux
+
+	   Your app has gems that work on these platforms:
+	   * ruby
+
+	   Your Gemfile specifies a Ruby version requirement:
+	   * ruby 1.9.3
+
+	   Your current platform satisfies the Ruby version requirement.
+
+
+
+       1mplatform  22mwill  list  all the platforms in your 1mGemfile.lock 22mas well as
+       the 1mruby 22mdirective if applicable from your Gemfile(5). It will also let
+       you know if the 1mruby 22mdirective requirement has been met. If 1mruby 22mdirec-
+       tive doesn't match the running Ruby VM, it will tell you what part does
+       not.
+
+1mOPTIONS0m
+       1m--ruby 22mIt  will  display  the  ruby directive information, so you don't
+	      have to parse it from the Gemfile(5).
+
+
+
+
+				 January 2017		    BUNDLE-PLATFORM(1)
diff --git a/man/bundle-pristine.1 b/man/bundle-pristine.1
new file mode 100644
index 0000000..03c12e3
--- /dev/null
+++ b/man/bundle-pristine.1
@@ -0,0 +1,16 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-PRISTINE" "1" "May 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
+.
+.SH "SYNOPSIS"
+\fBbundle pristine\fR
+.
+.SH "DESCRIPTION"
+\fBpristine\fR restores the installed gems in the bundle to their pristine condition using the local gem cache from RubyGems\. For git gems \- a forced checkout will be performed\.
+.
+.P
+Note the Bundler gem cannot be restored to its original state with \fBpristine\fR\.
diff --git a/man/bundle-pristine.1.txt b/man/bundle-pristine.1.txt
new file mode 100644
index 0000000..55fdb0f
--- /dev/null
+++ b/man/bundle-pristine.1.txt
@@ -0,0 +1,21 @@
+BUNDLE-PRISTINE(1)					    BUNDLE-PRISTINE(1)
+
+
+
+1mNAME0m
+       1mbundle-pristine 22m- Restores installed gems to their pristine condition
+
+1mSYNOPSIS0m
+       1mbundle pristine0m
+
+1mDESCRIPTION0m
+       1mpristine  22mrestores	the  installed gems in the bundle to their pristine
+       condition using the local gem cache from RubyGems. For  git  gems  -  a
+       forced checkout will be performed.
+
+       Note  the  Bundler  gem	cannot	be restored to its original state with
+       1mpristine22m.
+
+
+
+				   May 2017		    BUNDLE-PRISTINE(1)
diff --git a/man/bundle-pristine.ronn b/man/bundle-pristine.ronn
new file mode 100644
index 0000000..266177d
--- /dev/null
+++ b/man/bundle-pristine.ronn
@@ -0,0 +1,13 @@
+bundle-pristine(1) -- Restores installed gems to their pristine condition
+===========================================================================
+
+## SYNOPSIS
+
+`bundle pristine`
+
+## DESCRIPTION
+
+`pristine` restores the installed gems in the bundle to their pristine condition using the local gem
+cache from RubyGems. For git gems - a forced checkout will be performed.
+
+Note the Bundler gem cannot be restored to its original state with `pristine`.
diff --git a/man/bundle-show.1 b/man/bundle-show.1
new file mode 100644
index 0000000..b85fee4
--- /dev/null
+++ b/man/bundle-show.1
@@ -0,0 +1,23 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-SHOW" "1" "May 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
+.
+.SH "SYNOPSIS"
+\fBbundle show\fR [GEM] [\-\-paths]
+.
+.SH "DESCRIPTION"
+Without the [GEM] option, \fBshow\fR will print a list of the names and versions of all gems that are required by your \fBGemfile(5)\fR\.
+.
+.P
+Calling show with [GEM] will list the exact location of that gem on your machine\.
+.
+.SH "OPTIONS"
+.
+.TP
+\fB\-\-paths\fR
+List the paths of all gems that are required by your \fBGemfile(5)\fR\.
+
diff --git a/man/bundle-show.1.txt b/man/bundle-show.1.txt
new file mode 100644
index 0000000..e10195a
--- /dev/null
+++ b/man/bundle-show.1.txt
@@ -0,0 +1,25 @@
+BUNDLE-SHOW(1)							BUNDLE-SHOW(1)
+
+
+
+1mNAME0m
+       1mbundle-show 22m- Shows all the gems in your bundle, or the path to a gem
+
+1mSYNOPSIS0m
+       1mbundle show 22m[GEM] [--paths]
+
+1mDESCRIPTION0m
+       Without	the [GEM] option, 1mshow 22mwill print a list of the names and ver-
+       sions of all gems that are required by your 1mGemfile(5)22m.
+
+       Calling show with [GEM] will list the exact location  of  that  gem  on
+       your machine.
+
+1mOPTIONS0m
+       1m--paths0m
+	      List the paths of all gems that are required by your 1mGemfile(5)22m.
+
+
+
+
+				   May 2017			BUNDLE-SHOW(1)
diff --git a/man/bundle-show.ronn b/man/bundle-show.ronn
new file mode 100644
index 0000000..714b606
--- /dev/null
+++ b/man/bundle-show.ronn
@@ -0,0 +1,20 @@
+bundle-show(1) -- Shows all the gems in your bundle, or the path to a gem
+=========================================================================
+
+## SYNOPSIS
+
+`bundle show` [GEM]
+              [--paths]
+
+## DESCRIPTION
+
+Without the [GEM] option, `show` will print a list of the names and versions of
+all gems that are required by your `Gemfile(5)`.
+
+Calling show with [GEM] will list the exact location of that gem on your
+machine.
+
+## OPTIONS
+
+* `--paths`:
+  List the paths of all gems that are required by your `Gemfile(5)`.
diff --git a/man/bundle-update.1 b/man/bundle-update.1
new file mode 100644
index 0000000..1a60222
--- /dev/null
+++ b/man/bundle-update.1
@@ -0,0 +1,390 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-UPDATE" "1" "May 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-update\fR \- Update your gems to the latest available versions
+.
+.SH "SYNOPSIS"
+\fBbundle update\fR \fI*gems\fR [\-\-group=NAME] [\-\-source=NAME] [\-\-local] [\-\-ruby] [\-\-bundler[=VERSION]] [\-\-full\-index] [\-\-jobs=JOBS] [\-\-quiet] [\-\-force] [\-\-patch|\-\-minor|\-\-major] [\-\-strict] [\-\-conservative]
+.
+.SH "DESCRIPTION"
+Update the gems specified (all gems, if none are specified), ignoring the previously installed gems specified in the \fBGemfile\.lock\fR\. In general, you should use bundle install(1) \fIbundle\-install\.1\.html\fR to install the same exact gems and versions across machines\.
+.
+.P
+You would use \fBbundle update\fR to explicitly update the version of a gem\.
+.
+.SH "OPTIONS"
+.
+.TP
+\fB\-\-group=<name>\fR
+Only update the gems in the specified group\. For instance, you can update all gems in the development group with \fBbundle update \-\-group development\fR\. You can also call \fBbundle update rails \-\-group test\fR to update the rails gem and all gems in the test group, for example\.
+.
+.TP
+\fB\-\-source=<name>\fR
+The name of a \fB:git\fR or \fB:path\fR source used in the Gemfile(5)\. For instance, with a \fB:git\fR source of \fBhttp://github\.com/rails/rails\.git\fR, you would call \fBbundle update \-\-source rails\fR
+.
+.TP
+\fB\-\-local\fR
+Do not attempt to fetch gems remotely and use the gem cache instead\.
+.
+.TP
+\fB\-\-ruby\fR
+Update the locked version of Ruby to the current version of Ruby\.
+.
+.TP
+\fB\-\-bundler\fR
+Update the locked version of bundler to the invoked bundler version\.
+.
+.TP
+\fB\-\-full\-index\fR
+Fall back to using the single\-file index of all gems\.
+.
+.TP
+\fB\-\-jobs=[<number>]\fR
+Specify the number of jobs to run in parallel\. The default is \fB1\fR\.
+.
+.TP
+\fB\-\-retry=[<number>]\fR
+Retry failed network or git requests for \fInumber\fR times\.
+.
+.TP
+\fB\-\-quiet\fR
+Only output warnings and errors\.
+.
+.TP
+\fB\-\-force\fR
+Force downloading every gem\.
+.
+.TP
+\fB\-\-patch\fR
+Prefer updating only to next patch version\.
+.
+.TP
+\fB\-\-minor\fR
+Prefer updating only to next minor version\.
+.
+.TP
+\fB\-\-major\fR
+Prefer updating to next major version (default)\.
+.
+.TP
+\fB\-\-strict\fR
+Do not allow any gem to be updated past latest \fB\-\-patch\fR | \fB\-\-minor\fR | \fB\-\-major\fR\.
+.
+.TP
+\fB\-\-conservative\fR
+Use bundle install conservative update behavior and do not allow shared dependencies to be updated\.
+.
+.SH "UPDATING ALL GEMS"
+If you run \fBbundle update\fR with no parameters, bundler will ignore any previously installed gems and resolve all dependencies again based on the latest versions of all gems available in the sources\.
+.
+.P
+Consider the following Gemfile(5):
+.
+.IP "" 4
+.
+.nf
+
+source "https://rubygems\.org"
+
+gem "rails", "3\.0\.0\.rc"
+gem "nokogiri"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+When you run bundle install(1) \fIbundle\-install\.1\.html\fR the first time, bundler will resolve all of the dependencies, all the way down, and install what you need:
+.
+.IP "" 4
+.
+.nf
+
+Fetching gem metadata from https://rubygems\.org/\.\.\.\.\.\.\.\.\.
+Resolving dependencies\.\.\.
+Installing builder 2\.1\.2
+Installing abstract 1\.0\.0
+Installing rack 1\.2\.8
+Using bundler 1\.7\.6
+Installing rake 10\.4\.0
+Installing polyglot 0\.3\.5
+Installing mime\-types 1\.25\.1
+Installing i18n 0\.4\.2
+Installing mini_portile 0\.6\.1
+Installing tzinfo 0\.3\.42
+Installing rack\-mount 0\.6\.14
+Installing rack\-test 0\.5\.7
+Installing treetop 1\.4\.15
+Installing thor 0\.14\.6
+Installing activesupport 3\.0\.0\.rc
+Installing erubis 2\.6\.6
+Installing activemodel 3\.0\.0\.rc
+Installing arel 0\.4\.0
+Installing mail 2\.2\.20
+Installing activeresource 3\.0\.0\.rc
+Installing actionpack 3\.0\.0\.rc
+Installing activerecord 3\.0\.0\.rc
+Installing actionmailer 3\.0\.0\.rc
+Installing railties 3\.0\.0\.rc
+Installing rails 3\.0\.0\.rc
+Installing nokogiri 1\.6\.5
+
+Bundle complete! 2 Gemfile dependencies, 26 gems total\.
+Use `bundle show [gemname]` to see where a bundled gem is installed\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+As you can see, even though you have two gems in the Gemfile(5), your application needs 26 different gems in order to run\. Bundler remembers the exact versions it installed in \fBGemfile\.lock\fR\. The next time you run bundle install(1) \fIbundle\-install\.1\.html\fR, bundler skips the dependency resolution and installs the same gems as it installed last time\.
+.
+.P
+After checking in the \fBGemfile\.lock\fR into version control and cloning it on another machine, running bundle install(1) \fIbundle\-install\.1\.html\fR will \fIstill\fR install the gems that you installed last time\. You don\'t need to worry that a new release of \fBerubis\fR or \fBmail\fR changes the gems you use\.
+.
+.P
+However, from time to time, you might want to update the gems you are using to the newest versions that still match the gems in your Gemfile(5)\.
+.
+.P
+To do this, run \fBbundle update\fR, which will ignore the \fBGemfile\.lock\fR, and resolve all the dependencies again\. Keep in mind that this process can result in a significantly different set of the 25 gems, based on the requirements of new gems that the gem authors released since the last time you ran \fBbundle update\fR\.
+.
+.SH "UPDATING A LIST OF GEMS"
+Sometimes, you want to update a single gem in the Gemfile(5), and leave the rest of the gems that you specified locked to the versions in the \fBGemfile\.lock\fR\.
+.
+.P
+For instance, in the scenario above, imagine that \fBnokogiri\fR releases version \fB1\.4\.4\fR, and you want to update it \fIwithout\fR updating Rails and all of its dependencies\. To do this, run \fBbundle update nokogiri\fR\.
+.
+.P
+Bundler will update \fBnokogiri\fR and any of its dependencies, but leave alone Rails and its dependencies\.
+.
+.SH "OVERLAPPING DEPENDENCIES"
+Sometimes, multiple gems declared in your Gemfile(5) are satisfied by the same second\-level dependency\. For instance, consider the case of \fBthin\fR and \fBrack\-perftools\-profiler\fR\.
+.
+.IP "" 4
+.
+.nf
+
+source "https://rubygems\.org"
+
+gem "thin"
+gem "rack\-perftools\-profiler"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+The \fBthin\fR gem depends on \fBrack >= 1\.0\fR, while \fBrack\-perftools\-profiler\fR depends on \fBrack ~> 1\.0\fR\. If you run bundle install, you get:
+.
+.IP "" 4
+.
+.nf
+
+Fetching source index for https://rubygems\.org/
+Installing daemons (1\.1\.0)
+Installing eventmachine (0\.12\.10) with native extensions
+Installing open4 (1\.0\.1)
+Installing perftools\.rb (0\.4\.7) with native extensions
+Installing rack (1\.2\.1)
+Installing rack\-perftools_profiler (0\.0\.2)
+Installing thin (1\.2\.7) with native extensions
+Using bundler (1\.0\.0\.rc\.3)
+.
+.fi
+.
+.IP "" 0
+.
+.P
+In this case, the two gems have their own set of dependencies, but they share \fBrack\fR in common\. If you run \fBbundle update thin\fR, bundler will update \fBdaemons\fR, \fBeventmachine\fR and \fBrack\fR, which are dependencies of \fBthin\fR, but not \fBopen4\fR or \fBperftools\.rb\fR, which are dependencies of \fBrack\-perftools_profiler\fR\. Note that \fBbundle update thin\fR will update \fBrack\fR even though it\'s \fIalso\fR a dependency of \fBrack\-perftools_profiler\fR\.
+.
+.P
+In short, by default, when you update a gem using \fBbundle update\fR, bundler will update all dependencies of that gem, including those that are also dependencies of another gem\.
+.
+.P
+To prevent updating shared dependencies, prior to version 1\.14 the only option was the \fBCONSERVATIVE UPDATING\fR behavior in bundle install(1) \fIbundle\-install\.1\.html\fR:
+.
+.P
+In this scenario, updating the \fBthin\fR version manually in the Gemfile(5), and then running bundle install(1) \fIbundle\-install\.1\.html\fR will only update \fBdaemons\fR and \fBeventmachine\fR, but not \fBrack\fR\. For more information, see the \fBCONSERVATIVE UPDATING\fR section of bundle install(1) \fIbundle\-install\.1\.html\fR\.
+.
+.P
+Starting with 1\.14, specifying the \fB\-\-conservative\fR option will also prevent shared dependencies from being updated\.
+.
+.SH "PATCH LEVEL OPTIONS"
+Version 1\.14 introduced 4 patch\-level options that will influence how gem versions are resolved\. One of the following options can be used: \fB\-\-patch\fR, \fB\-\-minor\fR or \fB\-\-major\fR\. \fB\-\-strict\fR can be added to further influence resolution\.
+.
+.TP
+\fB\-\-patch\fR
+Prefer updating only to next patch version\.
+.
+.TP
+\fB\-\-minor\fR
+Prefer updating only to next minor version\.
+.
+.TP
+\fB\-\-major\fR
+Prefer updating to next major version (default)\.
+.
+.TP
+\fB\-\-strict\fR
+Do not allow any gem to be updated past latest \fB\-\-patch\fR | \fB\-\-minor\fR | \fB\-\-major\fR\.
+.
+.P
+When Bundler is resolving what versions to use to satisfy declared requirements in the Gemfile or in parent gems, it looks up all available versions, filters out any versions that don\'t satisfy the requirement, and then, by default, sorts them from newest to oldest, considering them in that order\.
+.
+.P
+Providing one of the patch level options (e\.g\. \fB\-\-patch\fR) changes the sort order of the satisfying versions, causing Bundler to consider the latest \fB\-\-patch\fR or \fB\-\-minor\fR version available before other versions\. Note that versions outside the stated patch level could still be resolved to if necessary to find a suitable dependency graph\.
+.
+.P
+For example, if gem \'foo\' is locked at 1\.0\.2, with no gem requirement defined in the Gemfile, and versions 1\.0\.3, 1\.0\.4, 1\.1\.0, 1\.1\.1, 2\.0\.0 all exist, the default order of preference by default (\fB\-\-major\fR) will be "2\.0\.0, 1\.1\.1, 1\.1\.0, 1\.0\.4, 1\.0\.3, 1\.0\.2"\.
+.
+.P
+If the \fB\-\-patch\fR option is used, the order of preference will change to "1\.0\.4, 1\.0\.3, 1\.0\.2, 1\.1\.1, 1\.1\.0, 2\.0\.0"\.
+.
+.P
+If the \fB\-\-minor\fR option is used, the order of preference will change to "1\.1\.1, 1\.1\.0, 1\.0\.4, 1\.0\.3, 1\.0\.2, 2\.0\.0"\.
+.
+.P
+Combining the \fB\-\-strict\fR option with any of the patch level options will remove any versions beyond the scope of the patch level option, to ensure that no gem is updated that far\.
+.
+.P
+To continue the previous example, if both \fB\-\-patch\fR and \fB\-\-strict\fR options are used, the available versions for resolution would be "1\.0\.4, 1\.0\.3, 1\.0\.2"\. If \fB\-\-minor\fR and \fB\-\-strict\fR are used, it would be "1\.1\.1, 1\.1\.0, 1\.0\.4, 1\.0\.3, 1\.0\.2"\.
+.
+.P
+Gem requirements as defined in the Gemfile will still be the first determining factor for what versions are available\. If the gem requirement for \fBfoo\fR in the Gemfile is \'~> 1\.0\', that will accomplish the same thing as providing the \fB\-\-minor\fR and \fB\-\-strict\fR options\.
+.
+.SH "PATCH LEVEL EXAMPLES"
+Given the following gem specifications:
+.
+.IP "" 4
+.
+.nf
+
+foo 1\.4\.3, requires: ~> bar 2\.0
+foo 1\.4\.4, requires: ~> bar 2\.0
+foo 1\.4\.5, requires: ~> bar 2\.1
+foo 1\.5\.0, requires: ~> bar 2\.1
+foo 1\.5\.1, requires: ~> bar 3\.0
+bar with versions 2\.0\.3, 2\.0\.4, 2\.1\.0, 2\.1\.1, 3\.0\.0
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Gemfile:
+.
+.IP "" 4
+.
+.nf
+
+gem \'foo\'
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Gemfile\.lock:
+.
+.IP "" 4
+.
+.nf
+
+foo (1\.4\.3)
+  bar (~> 2\.0)
+bar (2\.0\.3)
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Cases:
+.
+.IP "" 4
+.
+.nf
+
+#  Command Line                     Result
+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+1  bundle update \-\-patch            \'foo 1\.4\.5\', \'bar 2\.1\.1\'
+2  bundle update \-\-patch foo        \'foo 1\.4\.5\', \'bar 2\.1\.1\'
+3  bundle update \-\-minor            \'foo 1\.5\.1\', \'bar 3\.0\.0\'
+4  bundle update \-\-minor \-\-strict   \'foo 1\.5\.0\', \'bar 2\.1\.1\'
+5  bundle update \-\-patch \-\-strict   \'foo 1\.4\.4\', \'bar 2\.0\.4\'
+.
+.fi
+.
+.IP "" 0
+.
+.P
+In case 1, bar is upgraded to 2\.1\.1, a minor version increase, because the dependency from foo 1\.4\.5 required it\.
+.
+.P
+In case 2, only foo is requested to be unlocked, but bar is also allowed to move because it\'s not a declared dependency in the Gemfile\.
+.
+.P
+In case 3, bar goes up a whole major release, because a minor increase is preferred now for foo, and when it goes to 1\.5\.1, it requires 3\.0\.0 of bar\.
+.
+.P
+In case 4, foo is preferred up to a minor version, but 1\.5\.1 won\'t work because the \-\-strict flag removes bar 3\.0\.0 from consideration since it\'s a major increment\.
+.
+.P
+In case 5, both foo and bar have any minor or major increments removed from consideration because of the \-\-strict flag, so the most they can move is up to 1\.4\.4 and 2\.0\.4\.
+.
+.SH "RECOMMENDED WORKFLOW"
+In general, when working with an application managed with bundler, you should use the following workflow:
+.
+.IP "\(bu" 4
+After you create your Gemfile(5) for the first time, run
+.
+.IP
+$ bundle install
+.
+.IP "\(bu" 4
+Check the resulting \fBGemfile\.lock\fR into version control
+.
+.IP
+$ git add Gemfile\.lock
+.
+.IP "\(bu" 4
+When checking out this repository on another development machine, run
+.
+.IP
+$ bundle install
+.
+.IP "\(bu" 4
+When checking out this repository on a deployment machine, run
+.
+.IP
+$ bundle install \-\-deployment
+.
+.IP "\(bu" 4
+After changing the Gemfile(5) to reflect a new or update dependency, run
+.
+.IP
+$ bundle install
+.
+.IP "\(bu" 4
+Make sure to check the updated \fBGemfile\.lock\fR into version control
+.
+.IP
+$ git add Gemfile\.lock
+.
+.IP "\(bu" 4
+If bundle install(1) \fIbundle\-install\.1\.html\fR reports a conflict, manually update the specific gems that you changed in the Gemfile(5)
+.
+.IP
+$ bundle update rails thin
+.
+.IP "\(bu" 4
+If you want to update all the gems to the latest possible versions that still match the gems listed in the Gemfile(5), run
+.
+.IP
+$ bundle update
+.
+.IP "" 0
+
diff --git a/man/bundle-update.1.txt b/man/bundle-update.1.txt
new file mode 100644
index 0000000..1e18256
--- /dev/null
+++ b/man/bundle-update.1.txt
@@ -0,0 +1,388 @@
+BUNDLE-UPDATE(1)					      BUNDLE-UPDATE(1)
+
+
+
+1mNAME0m
+       1mbundle-update 22m- Update your gems to the latest available versions
+
+1mSYNOPSIS0m
+       1mbundle  update  4m22m*gems24m [--group=NAME] [--source=NAME] [--local] [--ruby]
+       [--bundler[=VERSION]] [--full-index] [--jobs=JOBS] [--quiet]  [--force]
+       [--patch|--minor|--major] [--strict] [--conservative]
+
+1mDESCRIPTION0m
+       Update  the  gems specified (all gems, if none are specified), ignoring
+       the previously installed gems specified in the  1mGemfile.lock22m.  In  gen-
+       eral, you should use bundle install(1) 4mbundle-install.1.html24m to install
+       the same exact gems and versions across machines.
+
+       You would use 1mbundle update 22mto explicitly update the version of a gem.
+
+1mOPTIONS0m
+       1m--group=<name>0m
+	      Only update the gems in the specified group. For	instance,  you
+	      can  update all gems in the development group with 1mbundle update0m
+	      1m--group development22m. You  can  also	call  1mbundle	update	rails0m
+	      1m--group  test  22mto  update the rails gem and all gems in the test
+	      group, for example.
+
+       1m--source=<name>0m
+	      The name of a 1m:git 22mor 1m:path 22msource used in the	Gemfile(5).  For
+	      instance,        with	   a	    1m:git	 22msource	 of
+	      1mhttp://github.com/rails/rails.git22m, you would call 1mbundle  update0m
+	      1m--source rails0m
+
+       1m--local0m
+	      Do  not  attempt	to  fetch  gems remotely and use the gem cache
+	      instead.
+
+       1m--ruby 22mUpdate the locked version of Ruby  to  the  current	version  of
+	      Ruby.
+
+       1m--bundler0m
+	      Update the locked version of bundler to the invoked bundler ver-
+	      sion.
+
+       1m--full-index0m
+	      Fall back to using the single-file index of all gems.
+
+       1m--jobs=[<number>]0m
+	      Specify the number of jobs to run in parallel. The default is 1m122m.
+
+       1m--retry=[<number>]0m
+	      Retry failed network or git requests for 4mnumber24m times.
+
+       1m--quiet0m
+	      Only output warnings and errors.
+
+       1m--force0m
+	      Force downloading every gem.
+
+       1m--patch0m
+	      Prefer updating only to next patch version.
+
+       1m--minor0m
+	      Prefer updating only to next minor version.
+
+       1m--major0m
+	      Prefer updating to next major version (default).
+
+       1m--strict0m
+	      Do not allow any gem to be updated past latest 1m--patch 22m| 1m--minor0m
+	      | 1m--major22m.
+
+       1m--conservative0m
+	      Use bundle install conservative update behavior and do not allow
+	      shared dependencies to be updated.
+
+1mUPDATING ALL GEMS0m
+       If you run 1mbundle update 22mwith no parameters, bundler  will	ignore	any
+       previously  installed  gems and resolve all dependencies again based on
+       the latest versions of all gems available in the sources.
+
+       Consider the following Gemfile(5):
+
+
+
+	   source "https://rubygems.org"
+
+	   gem "rails", "3.0.0.rc"
+	   gem "nokogiri"
+
+
+
+       When you run bundle install(1) 4mbundle-install.1.html24m  the  first  time,
+       bundler	will  resolve  all  of the dependencies, all the way down, and
+       install what you need:
+
+
+
+	   Fetching gem metadata from https://rubygems.org/.........
+	   Resolving dependencies...
+	   Installing builder 2.1.2
+	   Installing abstract 1.0.0
+	   Installing rack 1.2.8
+	   Using bundler 1.7.6
+	   Installing rake 10.4.0
+	   Installing polyglot 0.3.5
+	   Installing mime-types 1.25.1
+	   Installing i18n 0.4.2
+	   Installing mini_portile 0.6.1
+	   Installing tzinfo 0.3.42
+	   Installing rack-mount 0.6.14
+	   Installing rack-test 0.5.7
+	   Installing treetop 1.4.15
+	   Installing thor 0.14.6
+	   Installing activesupport 3.0.0.rc
+	   Installing erubis 2.6.6
+	   Installing activemodel 3.0.0.rc
+	   Installing arel 0.4.0
+	   Installing mail 2.2.20
+	   Installing activeresource 3.0.0.rc
+	   Installing actionpack 3.0.0.rc
+	   Installing activerecord 3.0.0.rc
+	   Installing actionmailer 3.0.0.rc
+	   Installing railties 3.0.0.rc
+	   Installing rails 3.0.0.rc
+	   Installing nokogiri 1.6.5
+
+	   Bundle complete! 2 Gemfile dependencies, 26 gems total.
+	   Use `bundle show [gemname]` to see where a bundled gem is installed.
+
+
+
+       As you can see, even though you have two gems in the  Gemfile(5),  your
+       application  needs 26 different gems in order to run. Bundler remembers
+       the exact versions it installed in 1mGemfile.lock22m. The next time you	run
+       bundle  install(1)  4mbundle-install.1.html24m, bundler skips the dependency
+       resolution and installs the same gems as it installed last time.
+
+       After checking in the 1mGemfile.lock 22minto version control and cloning  it
+       on  another  machine,  running  bundle install(1) 4mbundle-install.1.html0m
+       will 4mstill24m install the gems that you installed  last  time.  You  don't
+       need to worry that a new release of 1merubis 22mor 1mmail 22mchanges the gems you
+       use.
+
+       However, from time to time, you might want to update the gems  you  are
+       using  to  the  newest  versions that still match the gems in your Gem-
+       file(5).
+
+       To do this, run 1mbundle update22m, which will ignore the 1mGemfile.lock22m,  and
+       resolve	all the dependencies again. Keep in mind that this process can
+       result in a significantly different set of the 25 gems,	based  on  the
+       requirements  of  new gems that the gem authors released since the last
+       time you ran 1mbundle update22m.
+
+1mUPDATING A LIST OF GEMS0m
+       Sometimes, you want to update a single gem in the Gemfile(5), and leave
+       the  rest  of the gems that you specified locked to the versions in the
+       1mGemfile.lock22m.
+
+       For instance, in the scenario above,  imagine  that  1mnokogiri	22mreleases
+       version 1m1.4.422m, and you want to update it 4mwithout24m updating Rails and all
+       of its dependencies. To do this, run 1mbundle update nokogiri22m.
+
+       Bundler will update 1mnokogiri 22mand any of  its  dependencies,  but  leave
+       alone Rails and its dependencies.
+
+1mOVERLAPPING DEPENDENCIES0m
+       Sometimes,  multiple  gems declared in your Gemfile(5) are satisfied by
+       the same second-level dependency. For instance, consider  the  case  of
+       1mthin 22mand 1mrack-perftools-profiler22m.
+
+
+
+	   source "https://rubygems.org"
+
+	   gem "thin"
+	   gem "rack-perftools-profiler"
+
+
+
+       The  1mthin  22mgem  depends  on  1mrack >= 1.022m, while 1mrack-perftools-profiler0m
+       depends on 1mrack ~> 1.022m. If you run bundle install, you get:
+
+
+
+	   Fetching source index for https://rubygems.org/
+	   Installing daemons (1.1.0)
+	   Installing eventmachine (0.12.10) with native extensions
+	   Installing open4 (1.0.1)
+	   Installing perftools.rb (0.4.7) with native extensions
+	   Installing rack (1.2.1)
+	   Installing rack-perftools_profiler (0.0.2)
+	   Installing thin (1.2.7) with native extensions
+	   Using bundler (1.0.0.rc.3)
+
+
+
+       In this case, the two gems have their own set of dependencies, but they
+       share  1mrack  22min  common.  If  you  run 1mbundle update thin22m, bundler will
+       update 1mdaemons22m, 1meventmachine 22mand 1mrack22m, which are dependencies of	1mthin22m,
+       but   not   1mopen4   22mor   1mperftools.rb22m,   which   are	dependencies  of
+       1mrack-perftools_profiler22m. Note that 1mbundle update thin 22mwill update  1mrack0m
+       even though it's 4malso24m a dependency of 1mrack-perftools_profiler22m.
+
+       In  short,  by  default,  when  you  update  a gem using 1mbundle update22m,
+       bundler will update all dependencies of that gem, including those  that
+       are also dependencies of another gem.
+
+       To prevent updating shared dependencies, prior to version 1.14 the only
+       option was the 1mCONSERVATIVE UPDATING 22mbehavior in bundle install(1) 4mbun-0m
+       4mdle-install.1.html24m:
+
+       In this scenario, updating the 1mthin 22mversion manually in the Gemfile(5),
+       and then running  bundle  install(1)  4mbundle-install.1.html24m  will  only
+       update  1mdaemons  22mand  1meventmachine22m, but not 1mrack22m. For more information,
+       see  the  1mCONSERVATIVE  UPDATING  22msection  of  bundle  install(1)  4mbun-0m
+       4mdle-install.1.html24m.
+
+       Starting with 1.14, specifying the 1m--conservative 22moption will also pre-
+       vent shared dependencies from being updated.
+
+1mPATCH LEVEL OPTIONS0m
+       Version 1.14 introduced 4 patch-level options that will	influence  how
+       gem  versions  are  resolved. One of the following options can be used:
+       1m--patch22m, 1m--minor 22mor 1m--major22m. 1m--strict 22mcan be added to further influence
+       resolution.
+
+       1m--patch0m
+	      Prefer updating only to next patch version.
+
+       1m--minor0m
+	      Prefer updating only to next minor version.
+
+       1m--major0m
+	      Prefer updating to next major version (default).
+
+       1m--strict0m
+	      Do not allow any gem to be updated past latest 1m--patch 22m| 1m--minor0m
+	      | 1m--major22m.
+
+       When Bundler is resolving what versions	to  use  to  satisfy  declared
+       requirements  in  the Gemfile or in parent gems, it looks up all avail-
+       able versions, filters out any versions that don't satisfy the require-
+       ment, and then, by default, sorts them from newest to oldest, consider-
+       ing them in that order.
+
+       Providing one of the patch level options  (e.g.	1m--patch22m)  changes	the
+       sort  order of the satisfying versions, causing Bundler to consider the
+       latest 1m--patch 22mor 1m--minor 22mversion available before other versions. Note
+       that versions outside the stated patch level could still be resolved to
+       if necessary to find a suitable dependency graph.
+
+       For example, if gem 'foo' is locked at 1.0.2, with no  gem  requirement
+       defined	in the Gemfile, and versions 1.0.3, 1.0.4, 1.1.0, 1.1.1, 2.0.0
+       all exist, the default order of preference by default (1m--major22m) will be
+       "2.0.0, 1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2".
+
+       If  the	1m--patch 22moption is used, the order of preference will change to
+       "1.0.4, 1.0.3, 1.0.2, 1.1.1, 1.1.0, 2.0.0".
+
+       If the 1m--minor 22moption is used, the order of preference will  change  to
+       "1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2, 2.0.0".
+
+       Combining  the 1m--strict 22moption with any of the patch level options will
+       remove any versions beyond the scope of	the  patch  level  option,  to
+       ensure that no gem is updated that far.
+
+       To  continue the previous example, if both 1m--patch 22mand 1m--strict 22moptions
+       are used, the available versions for resolution would be "1.0.4, 1.0.3,
+       1.0.2".	If  1m--minor  22mand 1m--strict 22mare used, it would be "1.1.1, 1.1.0,
+       1.0.4, 1.0.3, 1.0.2".
+
+       Gem requirements as defined in the Gemfile  will  still	be  the  first
+       determining factor for what versions are available. If the gem require-
+       ment for 1mfoo 22min the Gemfile is '~> 1.0', that will accomplish the  same
+       thing as providing the 1m--minor 22mand 1m--strict 22moptions.
+
+1mPATCH LEVEL EXAMPLES0m
+       Given the following gem specifications:
+
+
+
+	   foo 1.4.3, requires: ~> bar 2.0
+	   foo 1.4.4, requires: ~> bar 2.0
+	   foo 1.4.5, requires: ~> bar 2.1
+	   foo 1.5.0, requires: ~> bar 2.1
+	   foo 1.5.1, requires: ~> bar 3.0
+	   bar with versions 2.0.3, 2.0.4, 2.1.0, 2.1.1, 3.0.0
+
+
+
+       Gemfile:
+
+
+
+	   gem 'foo'
+
+
+
+       Gemfile.lock:
+
+
+
+	   foo (1.4.3)
+	     bar (~> 2.0)
+	   bar (2.0.3)
+
+
+
+       Cases:
+
+
+
+	   #  Command Line		       Result
+	   ------------------------------------------------------------
+	   1  bundle update --patch	       'foo 1.4.5', 'bar 2.1.1'
+	   2  bundle update --patch foo        'foo 1.4.5', 'bar 2.1.1'
+	   3  bundle update --minor	       'foo 1.5.1', 'bar 3.0.0'
+	   4  bundle update --minor --strict   'foo 1.5.0', 'bar 2.1.1'
+	   5  bundle update --patch --strict   'foo 1.4.4', 'bar 2.0.4'
+
+
+
+       In  case 1, bar is upgraded to 2.1.1, a minor version increase, because
+       the dependency from foo 1.4.5 required it.
+
+       In case 2, only foo is requested  to  be  unlocked,  but  bar  is  also
+       allowed to move because it's not a declared dependency in the Gemfile.
+
+       In  case 3, bar goes up a whole major release, because a minor increase
+       is preferred now for foo, and when it goes to 1.5.1, it requires  3.0.0
+       of bar.
+
+       In case 4, foo is preferred up to a minor version, but 1.5.1 won't work
+       because the --strict flag removes bar 3.0.0  from  consideration  since
+       it's a major increment.
+
+       In  case 5, both foo and bar have any minor or major increments removed
+       from consideration because of the --strict flag, so the most  they  can
+       move is up to 1.4.4 and 2.0.4.
+
+1mRECOMMENDED WORKFLOW0m
+       In  general, when working with an application managed with bundler, you
+       should use the following workflow:
+
+       o   After you create your Gemfile(5) for the first time, run
+
+	   $ bundle install
+
+       o   Check the resulting 1mGemfile.lock 22minto version control
+
+	   $ git add Gemfile.lock
+
+       o   When checking out this repository on another  development  machine,
+	   run
+
+	   $ bundle install
+
+       o   When checking out this repository on a deployment machine, run
+
+	   $ bundle install --deployment
+
+       o   After  changing  the  Gemfile(5)  to reflect a new or update depen-
+	   dency, run
+
+	   $ bundle install
+
+       o   Make sure to check the updated 1mGemfile.lock 22minto version control
+
+	   $ git add Gemfile.lock
+
+       o   If bundle install(1) 4mbundle-install.1.html24m reports a conflict, man-
+	   ually update the specific gems that you changed in the Gemfile(5)
+
+	   $ bundle update rails thin
+
+       o   If  you want to update all the gems to the latest possible versions
+	   that still match the gems listed in the Gemfile(5), run
+
+	   $ bundle update
+
+
+
+
+
+
+				   May 2017		      BUNDLE-UPDATE(1)
diff --git a/man/bundle-update.ronn b/man/bundle-update.ronn
index 47d70f6..21ed1cd 100644
--- a/man/bundle-update.ronn
+++ b/man/bundle-update.ronn
@@ -3,7 +3,18 @@ bundle-update(1) -- Update your gems to the latest available versions
 
 ## SYNOPSIS
 
-`bundle update` <*gems> [--group=NAME] [--source=NAME] [--local] [--ruby]
+`bundle update` <*gems> [--group=NAME]
+                        [--source=NAME]
+                        [--local]
+                        [--ruby]
+                        [--bundler[=VERSION]]
+                        [--full-index]
+                        [--jobs=JOBS]
+                        [--quiet]
+                        [--force]
+                        [--patch|--minor|--major]
+                        [--strict]
+                        [--conservative]
 
 ## DESCRIPTION
 
@@ -37,6 +48,36 @@ gem.
 * `--bundler`:
   Update the locked version of bundler to the invoked bundler version.
 
+* `--full-index`:
+  Fall back to using the single-file index of all gems.
+
+* `--jobs=[<number>]`:
+  Specify the number of jobs to run in parallel. The default is `1`.
+
+* `--retry=[<number>]`:
+  Retry failed network or git requests for <number> times.
+
+* `--quiet`:
+  Only output warnings and errors.
+
+* `--force`:
+  Force downloading every gem.
+
+* `--patch`:
+  Prefer updating only to next patch version.
+
+* `--minor`:
+  Prefer updating only to next minor version.
+
+* `--major`:
+  Prefer updating to next major version (default).
+
+* `--strict`:
+  Do not allow any gem to be updated past latest `--patch` | `--minor` | `--major`.
+
+* `--conservative`:
+  Use bundle install conservative update behavior and do not allow shared dependencies to be updated.
+
 ## UPDATING ALL GEMS
 
 If you run `bundle update` with no parameters, bundler will ignore
@@ -146,14 +187,125 @@ In this case, the two gems have their own set of dependencies, but they share
 `bundle update thin` will update `rack` even though it's _also_ a dependency of
 `rack-perftools_profiler`.
 
-`In short`, when you update a gem using `bundle update`, bundler will update all
-dependencies of that gem, including those that are also dependencies of another gem.
+In short, by default, when you update a gem using `bundle update`, bundler will
+update all dependencies of that gem, including those that are also dependencies
+of another gem.
+
+To prevent updating shared dependencies, prior to version 1.14 the only option
+was the `CONSERVATIVE UPDATING` behavior in [bundle install(1)][bundle-install]:
 
 In this scenario, updating the `thin` version manually in the Gemfile(5),
 and then running [bundle install(1)][bundle-install] will only update `daemons` and `eventmachine`,
 but not `rack`. For more information, see the `CONSERVATIVE UPDATING` section
 of [bundle install(1)][bundle-install].
 
+Starting with 1.14, specifying the `--conservative` option will also prevent shared
+dependencies from being updated.
+
+## PATCH LEVEL OPTIONS
+
+Version 1.14 introduced 4 patch-level options that will influence how gem
+versions are resolved. One of the following options can be used: `--patch`,
+`--minor` or `--major`. `--strict` can be added to further influence resolution.
+
+* `--patch`:
+  Prefer updating only to next patch version.
+
+* `--minor`:
+  Prefer updating only to next minor version.
+
+* `--major`:
+  Prefer updating to next major version (default).
+
+* `--strict`:
+  Do not allow any gem to be updated past latest `--patch` | `--minor` | `--major`.
+
+When Bundler is resolving what versions to use to satisfy declared
+requirements in the Gemfile or in parent gems, it looks up all
+available versions, filters out any versions that don't satisfy
+the requirement, and then, by default, sorts them from newest to
+oldest, considering them in that order.
+
+Providing one of the patch level options (e.g. `--patch`) changes the
+sort order of the satisfying versions, causing Bundler to consider the
+latest `--patch` or `--minor` version available before other versions.
+Note that versions outside the stated patch level could still be
+resolved to if necessary to find a suitable dependency graph.
+
+For example, if gem 'foo' is locked at 1.0.2, with no gem requirement
+defined in the Gemfile, and versions 1.0.3, 1.0.4, 1.1.0, 1.1.1, 2.0.0
+all exist, the default order of preference by default (`--major`) will
+be "2.0.0, 1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2".
+
+If the `--patch` option is used, the order of preference will change to
+"1.0.4, 1.0.3, 1.0.2, 1.1.1, 1.1.0, 2.0.0".
+
+If the `--minor` option is used, the order of preference will change to
+"1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2, 2.0.0".
+
+Combining the `--strict` option with any of the patch level options
+will remove any versions beyond the scope of the patch level option,
+to ensure that no gem is updated that far.
+
+To continue the previous example, if both `--patch` and `--strict`
+options are used, the available versions for resolution would be
+"1.0.4, 1.0.3, 1.0.2". If `--minor` and `--strict` are used, it would
+be "1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2".
+
+Gem requirements as defined in the Gemfile will still be the first
+determining factor for what versions are available. If the gem
+requirement for `foo` in the Gemfile is '~> 1.0', that will accomplish
+the same thing as providing the `--minor` and `--strict` options.
+
+## PATCH LEVEL EXAMPLES
+
+Given the following gem specifications:
+
+    foo 1.4.3, requires: ~> bar 2.0
+    foo 1.4.4, requires: ~> bar 2.0
+    foo 1.4.5, requires: ~> bar 2.1
+    foo 1.5.0, requires: ~> bar 2.1
+    foo 1.5.1, requires: ~> bar 3.0
+    bar with versions 2.0.3, 2.0.4, 2.1.0, 2.1.1, 3.0.0
+
+Gemfile:
+
+    gem 'foo'
+
+Gemfile.lock:
+
+    foo (1.4.3)
+      bar (~> 2.0)
+    bar (2.0.3)
+
+Cases:
+
+    #  Command Line                     Result
+    ------------------------------------------------------------
+    1  bundle update --patch            'foo 1.4.5', 'bar 2.1.1'
+    2  bundle update --patch foo        'foo 1.4.5', 'bar 2.1.1'
+    3  bundle update --minor            'foo 1.5.1', 'bar 3.0.0'
+    4  bundle update --minor --strict   'foo 1.5.0', 'bar 2.1.1'
+    5  bundle update --patch --strict   'foo 1.4.4', 'bar 2.0.4'
+
+In case 1, bar is upgraded to 2.1.1, a minor version increase, because
+the dependency from foo 1.4.5 required it.
+
+In case 2, only foo is requested to be unlocked, but bar is also
+allowed to move because it's not a declared dependency in the Gemfile.
+
+In case 3, bar goes up a whole major release, because a minor increase
+is preferred now for foo, and when it goes to 1.5.1, it requires 3.0.0
+of bar.
+
+In case 4, foo is preferred up to a minor version, but 1.5.1 won't work
+because the --strict flag removes bar 3.0.0 from consideration since
+it's a major increment.
+
+In case 5, both foo and bar have any minor or major increments removed
+from consideration because of the --strict flag, so the most they can
+move is up to 1.4.4 and 2.0.4.
+
 ## RECOMMENDED WORKFLOW
 
 In general, when working with an application managed with bundler, you should
diff --git a/man/bundle-viz.1 b/man/bundle-viz.1
new file mode 100644
index 0000000..e02722f
--- /dev/null
+++ b/man/bundle-viz.1
@@ -0,0 +1,39 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE\-VIZ" "1" "May 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
+.
+.SH "SYNOPSIS"
+\fBbundle viz\fR [\-\-file=FILE] [\-\-format=FORMAT] [\-\-requirements] [\-\-version] [\-\-without=GROUP GROUP]
+.
+.SH "DESCRIPTION"
+\fBviz\fR generates a PNG file of the current \fBGemfile(5)\fR as a dependency graph\. \fBviz\fR requires the ruby\-graphviz gem (and its dependencies)\.
+.
+.P
+The associated gems must also be installed via \fBbundle install(1)\fR\.
+.
+.SH "OPTIONS"
+.
+.TP
+\fB\-\-file\fR
+The name to use for the generated file\. See \fB\-\-format\fR option
+.
+.TP
+\fB\-\-format\fR
+This is output format option\. Supported format is png, jpg, svg, dot \.\.\.
+.
+.TP
+\fB\-\-requirements\fR
+Set to show the version of each required dependency\.
+.
+.TP
+\fB\-\-version\fR
+Set to show each gem version\.
+.
+.TP
+\fB\-\-without\fR
+Exclude gems that are part of the specified named group\.
+
diff --git a/man/bundle-viz.1.txt b/man/bundle-viz.1.txt
new file mode 100644
index 0000000..f12988c
--- /dev/null
+++ b/man/bundle-viz.1.txt
@@ -0,0 +1,37 @@
+BUNDLE-VIZ(1)							 BUNDLE-VIZ(1)
+
+
+
+1mNAME0m
+       1mbundle-viz 22m- Generates a visual dependency graph for your Gemfile
+
+1mSYNOPSIS0m
+       1mbundle viz 22m[--file=FILE] [--format=FORMAT] [--requirements] [--version]
+       [--without=GROUP GROUP]
+
+1mDESCRIPTION0m
+       1mviz 22mgenerates a PNG file of the  current  1mGemfile(5)  22mas  a  dependency
+       graph. 1mviz 22mrequires the ruby-graphviz gem (and its dependencies).
+
+       The associated gems must also be installed via 1mbundle install(1)22m.
+
+1mOPTIONS0m
+       1m--file 22mThe name to use for the generated file. See 1m--format 22moption
+
+       1m--format0m
+	      This is output format option. Supported format is png, jpg, svg,
+	      dot ...
+
+       1m--requirements0m
+	      Set to show the version of each required dependency.
+
+       1m--version0m
+	      Set to show each gem version.
+
+       1m--without0m
+	      Exclude gems that are part of the specified named group.
+
+
+
+
+				   May 2017			 BUNDLE-VIZ(1)
diff --git a/man/bundle-viz.ronn b/man/bundle-viz.ronn
new file mode 100644
index 0000000..865bbf6
--- /dev/null
+++ b/man/bundle-viz.ronn
@@ -0,0 +1,30 @@
+bundle-viz(1) -- Generates a visual dependency graph for your Gemfile
+=====================================================================
+
+## SYNOPSIS
+
+`bundle viz` [--file=FILE]
+             [--format=FORMAT]
+             [--requirements]
+             [--version]
+             [--without=GROUP GROUP]
+
+## DESCRIPTION
+
+`viz` generates a PNG file of the current `Gemfile(5)` as a dependency graph.
+`viz` requires the ruby-graphviz gem (and its dependencies).
+
+The associated gems must also be installed via `bundle install(1)`.
+
+## OPTIONS
+
+* `--file`:
+  The name to use for the generated file. See `--format` option
+* `--format`:
+  This is output format option. Supported format is png, jpg, svg, dot ...
+* `--requirements`:
+  Set to show the version of each required dependency.
+* `--version`:
+  Set to show each gem version.
+* `--without`:
+  Exclude gems that are part of the specified named group.
diff --git a/man/bundle.1 b/man/bundle.1
new file mode 100644
index 0000000..48a7692
--- /dev/null
+++ b/man/bundle.1
@@ -0,0 +1,137 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "BUNDLE" "1" "June 2017" "" ""
+.
+.SH "NAME"
+\fBbundle\fR \- Ruby Dependency Management
+.
+.SH "SYNOPSIS"
+\fBbundle\fR COMMAND [\-\-no\-color] [\-\-verbose] [ARGS]
+.
+.SH "DESCRIPTION"
+Bundler manages an \fBapplication\'s dependencies\fR through its entire life across many machines systematically and repeatably\.
+.
+.P
+See the bundler website \fIhttp://bundler\.io\fR for information on getting started, and Gemfile(5) for more information on the \fBGemfile\fR format\.
+.
+.SH "OPTIONS"
+.
+.TP
+\fB\-\-no\-color\fR
+Print all output without color
+.
+.TP
+\fB\-\-verbose\fR
+Print out additional logging information
+.
+.SH "BUNDLE COMMANDS"
+We divide \fBbundle\fR subcommands into primary commands and utilities\.
+.
+.SH "PRIMARY COMMANDS"
+.
+.TP
+\fBbundle install(1)\fR \fIbundle\-install\.1\.html\fR
+Install the gems specified by the \fBGemfile\fR or \fBGemfile\.lock\fR
+.
+.TP
+\fBbundle update(1)\fR \fIbundle\-update\.1\.html\fR
+Update dependencies to their latest versions
+.
+.TP
+\fBbundle package(1)\fR \fIbundle\-package\.1\.html\fR
+Package the \.gem files required by your application into the \fBvendor/cache\fR directory
+.
+.TP
+\fBbundle exec(1)\fR \fIbundle\-exec\.1\.html\fR
+Execute a script in the context of the current bundle
+.
+.TP
+\fBbundle config(1)\fR \fIbundle\-config\.1\.html\fR
+Specify and read configuration options for bundler
+.
+.TP
+\fBbundle help(1)\fR
+Display detailed help for each subcommand
+.
+.SH "UTILITIES"
+.
+.TP
+\fBbundle add(1)\fR
+Add the named gem to the Gemfile and run \fBbundle install\fR
+.
+.TP
+\fBbundle binstubs(1)\fR
+Generate binstubs for executables in a gem
+.
+.TP
+\fBbundle check(1)\fR
+Determine whether the requirements for your application are installed and available to bundler
+.
+.TP
+\fBbundle show(1)\fR
+Show the source location of a particular gem in the bundle
+.
+.TP
+[\fBbundle outdated(1)\fR][bundle\-outdated]
+Show all of the outdated gems in the current bundle
+.
+.TP
+\fBbundle console(1)\fR
+Start an IRB session in the context of the current bundle
+.
+.TP
+\fBbundle open(1)\fR
+Open an installed gem in the editor
+.
+.TP
+[\fBbundle lock(1)\fR][bundle\-lock]
+Generate a lockfile for your dependencies
+.
+.TP
+\fBbundle viz(1)\fR
+Generate a visual representation of your dependencies
+.
+.TP
+\fBbundle init(1)\fR
+Generate a simple \fBGemfile\fR, placed in the current directory
+.
+.TP
+\fBbundle gem(1)\fR \fIbundle\-gem\.1\.html\fR
+Create a simple gem, suitable for development with bundler
+.
+.TP
+\fBbundle platform(1)\fR \fIbundle\-platform\.1\.html\fR
+Display platform compatibility information
+.
+.TP
+\fBbundle clean(1)\fR
+Clean up unused gems in your bundler directory
+.
+.TP
+\fBbundle doctor(1)\fR
+Display warnings about common potential problems
+.
+.SH "PLUGINS"
+When running a command that isn\'t listed in PRIMARY COMMANDS or UTILITIES, Bundler will try to find an executable on your path named \fBbundler\-<command>\fR and execute it, passing down any extra arguments to it\.
+.
+.SH "BUNDLER TRAMPOLINING"
+Bundler includes a feature called trampolining, designed to allow a single developer to work on multiple projects, each on different Bundler versions\. The trampoline will infer the correct version of Bundler to use for each project and load that version instead of the version directly invoked (which is almost always the newest version installed locally)\.
+.
+.P
+Bundler by default will use the Bundler version in the current directory to determine the version to trampoline to, reading from the \fBBUNDLED WITH\fR section\. However, if the \fBBUNDLER_VERSION\fR environment variable is set, that version will override the lockfile inference and can be used in directories without a lockfile\.
+.
+.P
+Until the target version is Bundler 2 or later, \fBBUNDLE_TRAMPOLINE_FORCE\fR must be set for the trampoline to be used\. Additionally, \fBBUNDLE_TRAMPOLINE_DISABLE\fR can be set to completely disable the trampoline\.
+.
+.SH "OBSOLETE"
+These commands are obsolete and should no longer be used
+.
+.IP "\(bu" 4
+\fBbundle cache(1)\fR
+.
+.IP "\(bu" 4
+\fBbundle list(1)\fR
+.
+.IP "" 0
+
diff --git a/man/bundle.1.txt b/man/bundle.1.txt
new file mode 100644
index 0000000..119878c
--- /dev/null
+++ b/man/bundle.1.txt
@@ -0,0 +1,128 @@
+BUNDLE(1)							     BUNDLE(1)
+
+
+
+1mNAME0m
+       1mbundle 22m- Ruby Dependency Management
+
+1mSYNOPSIS0m
+       1mbundle 22mCOMMAND [--no-color] [--verbose] [ARGS]
+
+1mDESCRIPTION0m
+       Bundler	manages  an 1mapplication's dependencies 22mthrough its entire life
+       across many machines systematically and repeatably.
+
+       See the bundler website 4mhttp://bundler.io24m for  information	on  getting
+       started, and Gemfile(5) for more information on the 1mGemfile 22mformat.
+
+1mOPTIONS0m
+       1m--no-color0m
+	      Print all output without color
+
+       1m--verbose0m
+	      Print out additional logging information
+
+1mBUNDLE COMMANDS0m
+       We divide 1mbundle 22msubcommands into primary commands and utilities.
+
+1mPRIMARY COMMANDS0m
+       1mbundle install(1) 4m22mbundle-install.1.html0m
+	      Install the gems specified by the 1mGemfile 22mor 1mGemfile.lock0m
+
+       1mbundle update(1) 4m22mbundle-update.1.html0m
+	      Update dependencies to their latest versions
+
+       1mbundle package(1) 4m22mbundle-package.1.html0m
+	      Package  the  .gem  files  required by your application into the
+	      1mvendor/cache 22mdirectory
+
+       1mbundle exec(1) 4m22mbundle-exec.1.html0m
+	      Execute a script in the context of the current bundle
+
+       1mbundle config(1) 4m22mbundle-config.1.html0m
+	      Specify and read configuration options for bundler
+
+       1mbundle help(1)0m
+	      Display detailed help for each subcommand
+
+1mUTILITIES0m
+       1mbundle add(1)0m
+	      Add the named gem to the Gemfile and run 1mbundle install0m
+
+       1mbundle binstubs(1)0m
+	      Generate binstubs for executables in a gem
+
+       1mbundle check(1)0m
+	      Determine whether the  requirements  for	your  application  are
+	      installed and available to bundler
+
+       1mbundle show(1)0m
+	      Show the source location of a particular gem in the bundle
+
+       [1mbundle outdated(1)22m][bundle-outdated]
+	      Show all of the outdated gems in the current bundle
+
+       1mbundle console(1)0m
+	      Start an IRB session in the context of the current bundle
+
+       1mbundle open(1)0m
+	      Open an installed gem in the editor
+
+       [1mbundle lock(1)22m][bundle-lock]
+	      Generate a lockfile for your dependencies
+
+       1mbundle viz(1)0m
+	      Generate a visual representation of your dependencies
+
+       1mbundle init(1)0m
+	      Generate a simple 1mGemfile22m, placed in the current directory
+
+       1mbundle gem(1) 4m22mbundle-gem.1.html0m
+	      Create a simple gem, suitable for development with bundler
+
+       1mbundle platform(1) 4m22mbundle-platform.1.html0m
+	      Display platform compatibility information
+
+       1mbundle clean(1)0m
+	      Clean up unused gems in your bundler directory
+
+       1mbundle doctor(1)0m
+	      Display warnings about common potential problems
+
+1mPLUGINS0m
+       When  running a command that isn't listed in PRIMARY COMMANDS or UTILI-
+       TIES, Bundler will try  to  find  an  executable  on  your  path  named
+       1mbundler-<command>  22mand  execute it, passing down any extra arguments to
+       it.
+
+1mBUNDLER TRAMPOLINING0m
+       Bundler includes a feature called trampolining,	designed  to  allow  a
+       single  developer  to  work  on	multiple  projects,  each on different
+       Bundler versions. The trampoline will  infer  the  correct  version  of
+       Bundler	to  use  for each project and load that version instead of the
+       version directly invoked (which is almost  always  the  newest  version
+       installed locally).
+
+       Bundler	by  default will use the Bundler version in the current direc-
+       tory to determine the version to trampoline to, reading from  the  1mBUN-0m
+       1mDLED WITH 22msection. However, if the 1mBUNDLER_VERSION 22menvironment variable
+       is set, that version will override the lockfile inference  and  can  be
+       used in directories without a lockfile.
+
+       Until the target version is Bundler 2 or later, 1mBUNDLE_TRAMPOLINE_FORCE0m
+       must be set for the trampoline to be used. Additionally, 1mBUNDLE_TRAMPO-0m
+       1mLINE_DISABLE 22mcan be set to completely disable the trampoline.
+
+1mOBSOLETE0m
+       These commands are obsolete and should no longer be used
+
+       o   1mbundle cache(1)0m
+
+       o   1mbundle list(1)0m
+
+
+
+
+
+
+				   June 2017			     BUNDLE(1)
diff --git a/man/bundle.ronn b/man/bundle.ronn
index 72faac0..9e42e04 100644
--- a/man/bundle.ronn
+++ b/man/bundle.ronn
@@ -27,20 +27,20 @@ We divide `bundle` subcommands into primary commands and utilities.
 
 ## PRIMARY COMMANDS
 
-* [bundle install(1)][bundle-install]:
+* [`bundle install(1)`][bundle-install]:
   Install the gems specified by the `Gemfile` or `Gemfile.lock`
 
-* [bundle update(1)][bundle-update]:
+* [`bundle update(1)`][bundle-update]:
   Update dependencies to their latest versions
 
-* [bundle package(1)][bundle-package]:
+* [`bundle package(1)`][bundle-package]:
   Package the .gem files required by your application into the
   `vendor/cache` directory
 
-* [bundle exec(1)][bundle-exec]:
+* [`bundle exec(1)`][bundle-exec]:
   Execute a script in the context of the current bundle
 
-* [bundle config(1)][bundle-config]:
+* [`bundle config(1)`][bundle-config]:
   Specify and read configuration options for bundler
 
 * `bundle help(1)`:
@@ -48,6 +48,12 @@ We divide `bundle` subcommands into primary commands and utilities.
 
 ## UTILITIES
 
+* `bundle add(1)`:
+  Add the named gem to the Gemfile and run `bundle install`
+
+* `bundle binstubs(1)`:
+  Generate binstubs for executables in a gem
+
 * `bundle check(1)`:
   Determine whether the requirements for your application are installed
   and available to bundler
@@ -55,7 +61,7 @@ We divide `bundle` subcommands into primary commands and utilities.
 * `bundle show(1)`:
   Show the source location of a particular gem in the bundle
 
-* `bundle outdated(1)`:
+* [`bundle outdated(1)`][bundle-outdated]:
   Show all of the outdated gems in the current bundle
 
 * `bundle console(1)`:
@@ -64,7 +70,7 @@ We divide `bundle` subcommands into primary commands and utilities.
 * `bundle open(1)`:
   Open an installed gem in the editor
 
-* `bundle lock(1)`:
+* [`bundle lock(1)`][bundle-lock]:
   Generate a lockfile for your dependencies
 
 * `bundle viz(1)`:
@@ -73,10 +79,10 @@ We divide `bundle` subcommands into primary commands and utilities.
 * `bundle init(1)`:
   Generate a simple `Gemfile`, placed in the current directory
 
-* [bundle gem(1)][bundle-gem]:
+* [`bundle gem(1)`][bundle-gem]:
   Create a simple gem, suitable for development with bundler
 
-* [bundle platform(1)][bundle-platform]:
+* [`bundle platform(1)`][bundle-platform]:
   Display platform compatibility information
 
 * `bundle clean(1)`:
@@ -91,6 +97,24 @@ When running a command that isn't listed in PRIMARY COMMANDS or UTILITIES,
 Bundler will try to find an executable on your path named `bundler-<command>`
 and execute it, passing down any extra arguments to it.
 
+## BUNDLER TRAMPOLINING
+
+Bundler includes a feature called trampolining, designed to allow a single
+developer to work on multiple projects, each on different Bundler versions.
+The trampoline will infer the correct version of Bundler to use for each project
+and load that version instead of the version directly invoked (which is almost
+always the newest version installed locally).
+
+Bundler by default will use the Bundler version in the current directory to
+determine the version to trampoline to, reading from the `BUNDLED WITH` section.
+However, if the `BUNDLER_VERSION` environment variable is set, that version will
+override the lockfile inference and can be used in directories without a
+lockfile.
+
+Until the target version is Bundler 2 or later, `BUNDLE_TRAMPOLINE_FORCE` must
+be set for the trampoline to be used. Additionally, `BUNDLE_TRAMPOLINE_DISABLE` can
+be set to completely disable the trampoline.
+
 ## OBSOLETE
 
 These commands are obsolete and should no longer be used
diff --git a/man/gemfile.5 b/man/gemfile.5
new file mode 100644
index 0000000..3c2cbe6
--- /dev/null
+++ b/man/gemfile.5
@@ -0,0 +1,653 @@
+.\" generated with Ronn/v0.7.3
+.\" http://github.com/rtomayko/ronn/tree/0.7.3
+.
+.TH "GEMFILE" "5" "May 2017" "" ""
+.
+.SH "NAME"
+\fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
+.
+.SH "SYNOPSIS"
+A \fBGemfile\fR describes the gem dependencies required to execute associated Ruby code\.
+.
+.P
+Place the \fBGemfile\fR in the root of the directory containing the associated code\. For instance, in a Rails application, place the \fBGemfile\fR in the same directory as the \fBRakefile\fR\.
+.
+.SH "SYNTAX"
+A \fBGemfile\fR is evaluated as Ruby code, in a context which makes available a number of methods used to describe the gem requirements\.
+.
+.SH "GLOBAL SOURCES"
+At the top of the \fBGemfile\fR, add a line for the \fBRubygems\fR source that contains the gems listed in the \fBGemfile\fR\.
+.
+.IP "" 4
+.
+.nf
+
+source "https://rubygems\.org"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+It is possible, but not recommended as of Bundler 1\.7, to add multiple global \fBsource\fR lines\. Each of these \fBsource\fRs \fBMUST\fR be a valid Rubygems repository\.
+.
+.P
+Sources are checked for gems following the heuristics described in \fISOURCE PRIORITY\fR\. If a gem is found in more than one global source, Bundler will print a warning after installing the gem indicating which source was used, and listing the other sources where the gem is available\. A specific source can be selected for gems that need to use a non\-standard repository, suppressing this warning, by using the \fI\fB:source\fR option\fR or a \fI\fBsource\fR block\fR\.
+.
+.SS "CREDENTIALS"
+Some gem sources require a username and password\. Use bundle config(1) \fIbundle\-config\.1\.html\fR to set the username and password for any of the sources that need it\. The command must be run once on each computer that will install the Gemfile, but this keeps the credentials from being stored in plain text in version control\.
+.
+.IP "" 4
+.
+.nf
+
+bundle config gems\.example\.com user:password
+.
+.fi
+.
+.IP "" 0
+.
+.P
+For some sources, like a company Gemfury account, it may be easier to include the credentials in the Gemfile as part of the source URL\.
+.
+.IP "" 4
+.
+.nf
+
+source "https://user:password@gems\.example\.com"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Credentials in the source URL will take precedence over credentials set using \fBconfig\fR\.
+.
+.SH "RUBY"
+If your application requires a specific Ruby version or engine, specify your requirements using the \fBruby\fR method, with the following arguments\. All parameters are \fBOPTIONAL\fR unless otherwise specified\.
+.
+.SS "VERSION (required)"
+The version of Ruby that your application requires\. If your application requires an alternate Ruby engine, such as JRuby or Rubinius, this should be the Ruby version that the engine is compatible with\.
+.
+.IP "" 4
+.
+.nf
+
+ruby "1\.9\.3"
+.
+.fi
+.
+.IP "" 0
+.
+.SS "ENGINE"
+Each application \fImay\fR specify a Ruby engine\. If an engine is specified, an engine version \fImust\fR also be specified\.
+.
+.SS "ENGINE VERSION"
+Each application \fImay\fR specify a Ruby engine version\. If an engine version is specified, an engine \fImust\fR also be specified\. If the engine is "ruby" the engine version specified \fImust\fR match the Ruby version\.
+.
+.IP "" 4
+.
+.nf
+
+ruby "1\.8\.7", :engine => "jruby", :engine_version => "1\.6\.7"
+.
+.fi
+.
+.IP "" 0
+.
+.SS "PATCHLEVEL"
+Each application \fImay\fR specify a Ruby patchlevel\.
+.
+.IP "" 4
+.
+.nf
+
+ruby "2\.0\.0", :patchlevel => "247"
+.
+.fi
+.
+.IP "" 0
+.
+.SH "GEMS"
+Specify gem requirements using the \fBgem\fR method, with the following arguments\. All parameters are \fBOPTIONAL\fR unless otherwise specified\.
+.
+.SS "NAME (required)"
+For each gem requirement, list a single \fIgem\fR line\.
+.
+.IP "" 4
+.
+.nf
+
+gem "nokogiri"
+.
+.fi
+.
+.IP "" 0
+.
+.SS "VERSION"
+Each \fIgem\fR \fBMAY\fR have one or more version specifiers\.
+.
+.IP "" 4
+.
+.nf
+
+gem "nokogiri", ">= 1\.4\.2"
+gem "RedCloth", ">= 4\.1\.0", "< 4\.2\.0"
+.
+.fi
+.
+.IP "" 0
+.
+.SS "REQUIRE AS"
+Each \fIgem\fR \fBMAY\fR specify files that should be used when autorequiring via \fBBundler\.require\fR\. You may pass an array with multiple files or \fBtrue\fR if file you want \fBrequired\fR has same name as \fIgem\fR or \fBfalse\fR to prevent any file from being autorequired\.
+.
+.IP "" 4
+.
+.nf
+
+gem "redis", :require => ["redis/connection/hiredis", "redis"]
+gem "webmock", :require => false
+gem "debugger", :require => true
+.
+.fi
+.
+.IP "" 0
+.
+.P
+The argument defaults to the name of the gem\. For example, these are identical:
+.
+.IP "" 4
+.
+.nf
+
+gem "nokogiri"
+gem "nokogiri", :require => "nokogiri"
+gem "nokogiri", :require => true
+.
+.fi
+.
+.IP "" 0
+.
+.SS "GROUPS"
+Each \fIgem\fR \fBMAY\fR specify membership in one or more groups\. Any \fIgem\fR that does not specify membership in any group is placed in the \fBdefault\fR group\.
+.
+.IP "" 4
+.
+.nf
+
+gem "rspec", :group => :test
+gem "wirble", :groups => [:development, :test]
+.
+.fi
+.
+.IP "" 0
+.
+.P
+The Bundler runtime allows its two main methods, \fBBundler\.setup\fR and \fBBundler\.require\fR, to limit their impact to particular groups\.
+.
+.IP "" 4
+.
+.nf
+
+# setup adds gems to Ruby\'s load path
+Bundler\.setup                    # defaults to all groups
+require "bundler/setup"          # same as Bundler\.setup
+Bundler\.setup(:default)          # only set up the _default_ group
+Bundler\.setup(:test)             # only set up the _test_ group (but `not` _default_)
+Bundler\.setup(:default, :test)   # set up the _default_ and _test_ groups, but no others
+
+# require requires all of the gems in the specified groups
+Bundler\.require                  # defaults to the _default_ group
+Bundler\.require(:default)        # identical
+Bundler\.require(:default, :test) # requires the _default_ and _test_ groups
+Bundler\.require(:test)           # requires the _test_ group
+.
+.fi
+.
+.IP "" 0
+.
+.P
+The Bundler CLI allows you to specify a list of groups whose gems \fBbundle install\fR should not install with the \fB\-\-without\fR option\. To specify multiple groups to ignore, specify a list of groups separated by spaces\.
+.
+.IP "" 4
+.
+.nf
+
+bundle install \-\-without test
+bundle install \-\-without development test
+.
+.fi
+.
+.IP "" 0
+.
+.P
+After running \fBbundle install \-\-without test\fR, bundler will remember that you excluded the test group in the last installation\. The next time you run \fBbundle install\fR, without any \fB\-\-without option\fR, bundler will recall it\.
+.
+.P
+Also, calling \fBBundler\.setup\fR with no parameters, or calling \fBrequire "bundler/setup"\fR will setup all groups except for the ones you excluded via \fB\-\-without\fR (since they are not available)\.
+.
+.P
+Note that on \fBbundle install\fR, bundler downloads and evaluates all gems, in order to create a single canonical list of all of the required gems and their dependencies\. This means that you cannot list different versions of the same gems in different groups\. For more details, see Understanding Bundler \fIhttp://bundler\.io/rationale\.html\fR\.
+.
+.SS "PLATFORMS"
+If a gem should only be used in a particular platform or set of platforms, you can specify them\. Platforms are essentially identical to groups, except that you do not need to use the \fB\-\-without\fR install\-time flag to exclude groups of gems for other platforms\.
+.
+.P
+There are a number of \fBGemfile\fR platforms:
+.
+.TP
+\fBruby\fR
+C Ruby (MRI) or Rubinius, but \fBNOT\fR Windows
+.
+.TP
+\fBmri\fR
+Same as \fIruby\fR, but not Rubinius
+.
+.TP
+\fBmingw\fR
+Windows 32 bit \'mingw32\' platform (aka RubyInstaller)
+.
+.TP
+\fBx64_mingw\fR
+Windows 64 bit \'mingw32\' platform (aka RubyInstaller x64)
+.
+.TP
+\fBrbx\fR
+Same as \fIruby\fR, but only Rubinius (not MRI)
+.
+.TP
+\fBjruby\fR
+JRuby
+.
+.TP
+\fBmswin\fR
+Windows
+.
+.P
+You can restrict further by platform and version for all platforms \fIexcept\fR for \fBrbx\fR, \fBjruby\fR, and \fBmswin\fR\.
+.
+.P
+To specify a version in addition to a platform, append the version number without the delimiter to the platform\. For example, to specify that a gem should only be used on platforms with Ruby 2\.3, use:
+.
+.IP "" 4
+.
+.nf
+
+ruby_23
+.
+.fi
+.
+.IP "" 0
+.
+.P
+The full list of platforms and supported versions includes:
+.
+.TP
+\fBruby\fR
+1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5
+.
+.TP
+\fBmri\fR
+1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5
+.
+.TP
+\fBmingw\fR
+1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5
+.
+.TP
+\fBx64_mingw\fR
+2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5
+.
+.P
+As with groups, you can specify one or more platforms:
+.
+.IP "" 4
+.
+.nf
+
+gem "weakling",   :platforms => :jruby
+gem "ruby\-debug", :platforms => :mri_18
+gem "nokogiri",   :platforms => [:mri_18, :jruby]
+.
+.fi
+.
+.IP "" 0
+.
+.P
+All operations involving groups (\fBbundle install\fR, \fBBundler\.setup\fR, \fBBundler\.require\fR) behave exactly the same as if any groups not matching the current platform were explicitly excluded\.
+.
+.SS "SOURCE"
+You can select an alternate Rubygems repository for a gem using the \':source\' option\.
+.
+.IP "" 4
+.
+.nf
+
+gem "some_internal_gem", :source => "https://gems\.example\.com"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+This forces the gem to be loaded from this source and ignores any global sources declared at the top level of the file\. If the gem does not exist in this source, it will not be installed\.
+.
+.P
+Bundler will search for child dependencies of this gem by first looking in the source selected for the parent, but if they are not found there, it will fall back on global sources using the ordering described in \fISOURCE PRIORITY\fR\.
+.
+.P
+Selecting a specific source repository this way also suppresses the ambiguous gem warning described above in \fIGLOBAL SOURCES (#source)\fR\.
+.
+.SS "GIT"
+If necessary, you can specify that a gem is located at a particular git repository using the \fB:git\fR parameter\. The repository can be accessed via several protocols:
+.
+.TP
+\fBHTTP(S)\fR
+gem "rails", :git => "https://github\.com/rails/rails\.git"
+.
+.TP
+\fBSSH\fR
+gem "rails", :git => "git at github\.com:rails/rails\.git"
+.
+.TP
+\fBgit\fR
+gem "rails", :git => "git://github\.com/rails/rails\.git"
+.
+.P
+If using SSH, the user that you use to run \fBbundle install\fR \fBMUST\fR have the appropriate keys available in their \fB$HOME/\.ssh\fR\.
+.
+.P
+\fBNOTE\fR: \fBhttp://\fR and \fBgit://\fR URLs should be avoided if at all possible\. These protocols are unauthenticated, so a man\-in\-the\-middle attacker can deliver malicious code and compromise your system\. HTTPS and SSH are strongly preferred\.
+.
+.P
+The \fBgroup\fR, \fBplatforms\fR, and \fBrequire\fR options are available and behave exactly the same as they would for a normal gem\.
+.
+.P
+A git repository \fBSHOULD\fR have at least one file, at the root of the directory containing the gem, with the extension \fB\.gemspec\fR\. This file \fBMUST\fR contain a valid gem specification, as expected by the \fBgem build\fR command\.
+.
+.P
+If a git repository does not have a \fB\.gemspec\fR, bundler will attempt to create one, but it will not contain any dependencies, executables, or C extension compilation instructions\. As a result, it may fail to properly integrate into your application\.
+.
+.P
+If a git repository does have a \fB\.gemspec\fR for the gem you attached it to, a version specifier, if provided, means that the git repository is only valid if the \fB\.gemspec\fR specifies a version matching the version specifier\. If not, bundler will print a warning\.
+.
+.IP "" 4
+.
+.nf
+
+gem "rails", "2\.3\.8", :git => "https://github\.com/rails/rails\.git"
+# bundle install will fail, because the \.gemspec in the rails
+# repository\'s master branch specifies version 3\.0\.0
+.
+.fi
+.
+.IP "" 0
+.
+.P
+If a git repository does \fBnot\fR have a \fB\.gemspec\fR for the gem you attached it to, a version specifier \fBMUST\fR be provided\. Bundler will use this version in the simple \fB\.gemspec\fR it creates\.
+.
+.P
+Git repositories support a number of additional options\.
+.
+.TP
+\fBbranch\fR, \fBtag\fR, and \fBref\fR
+You \fBMUST\fR only specify at most one of these options\. The default is \fB:branch => "master"\fR
+.
+.TP
+\fBsubmodules\fR
+Specify \fB:submodules => true\fR to cause bundler to expand any submodules included in the git repository
+.
+.P
+If a git repository contains multiple \fB\.gemspecs\fR, each \fB\.gemspec\fR represents a gem located at the same place in the file system as the \fB\.gemspec\fR\.
+.
+.IP "" 4
+.
+.nf
+
+|~rails                   [git root]
+| |\-rails\.gemspec         [rails gem located here]
+|~actionpack
+| |\-actionpack\.gemspec    [actionpack gem located here]
+|~activesupport
+| |\-activesupport\.gemspec [activesupport gem located here]
+|\.\.\.
+.
+.fi
+.
+.IP "" 0
+.
+.P
+To install a gem located in a git repository, bundler changes to the directory containing the gemspec, runs \fBgem build name\.gemspec\fR and then installs the resulting gem\. The \fBgem build\fR command, which comes standard with Rubygems, evaluates the \fB\.gemspec\fR in the context of the directory in which it is located\.
+.
+.SS "GIT SOURCE"
+A custom git source can be defined via the \fBgit_source\fR method\. Provide the source\'s name as an argument, and a block which receives a single argument and interpolates it into a string to return the full repo address:
+.
+.IP "" 4
+.
+.nf
+
+git_source(:stash){ |repo_name| "https://stash\.corp\.acme\.pl/#{repo_name}\.git" }
+gem \'rails\', :stash => \'forks/rails\'
+.
+.fi
+.
+.IP "" 0
+.
+.P
+In addition, if you wish to choose a specific branch:
+.
+.IP "" 4
+.
+.nf
+
+gem "rails", :stash => "forks/rails", :branch => "branch_name"
+.
+.fi
+.
+.IP "" 0
+.
+.SS "GITHUB"
+\fBNOTE\fR: This shorthand should be avoided until Bundler 2\.0, since it currently expands to an insecure \fBgit://\fR URL\. This allows a man\-in\-the\-middle attacker to compromise your system\.
+.
+.P
+If the git repository you want to use is hosted on GitHub and is public, you can use the :github shorthand to specify the github username and repository name (without the trailing "\.git"), separated by a slash\. If both the username and repository name are the same, you can omit one\.
+.
+.IP "" 4
+.
+.nf
+
+gem "rails", :github => "rails/rails"
+gem "rails", :github => "rails"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Are both equivalent to
+.
+.IP "" 4
+.
+.nf
+
+gem "rails", :git => "git://github\.com/rails/rails\.git"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Since the \fBgithub\fR method is a specialization of \fBgit_source\fR, it accepts a \fB:branch\fR named argument\.
+.
+.SS "GIST"
+If the git repository you want to use is hosted as a Github Gist and is public, you can use the :gist shorthand to specify the gist identifier (without the trailing "\.git")\.
+.
+.IP "" 4
+.
+.nf
+
+gem "the_hatch", :gist => "4815162342"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Is equivalent to:
+.
+.IP "" 4
+.
+.nf
+
+gem "the_hatch", :git => "https://gist\.github\.com/4815162342\.git"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Since the \fBgist\fR method is a specialization of \fBgit_source\fR, it accepts a \fB:branch\fR named argument\.
+.
+.SS "BITBUCKET"
+If the git repository you want to use is hosted on Bitbucket and is public, you can use the :bitbucket shorthand to specify the bitbucket username and repository name (without the trailing "\.git"), separated by a slash\. If both the username and repository name are the same, you can omit one\.
+.
+.IP "" 4
+.
+.nf
+
+gem "rails", :bitbucket => "rails/rails"
+gem "rails", :bitbucket => "rails"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Are both equivalent to
+.
+.IP "" 4
+.
+.nf
+
+gem "rails", :git => "https://rails@bitbucket\.org/rails/rails\.git"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Since the \fBbitbucket\fR method is a specialization of \fBgit_source\fR, it accepts a \fB:branch\fR named argument\.
+.
+.SS "PATH"
+You can specify that a gem is located in a particular location on the file system\. Relative paths are resolved relative to the directory containing the \fBGemfile\fR\.
+.
+.P
+Similar to the semantics of the \fB:git\fR option, the \fB:path\fR option requires that the directory in question either contains a \fB\.gemspec\fR for the gem, or that you specify an explicit version that bundler should use\.
+.
+.P
+Unlike \fB:git\fR, bundler does not compile C extensions for gems specified as paths\.
+.
+.IP "" 4
+.
+.nf
+
+gem "rails", :path => "vendor/rails"
+.
+.fi
+.
+.IP "" 0
+.
+.P
+If you would like to use multiple local gems directly from the filesystem, you can set a global \fBpath\fR option to the path containing the gem\'s files\. This will automatically load gemspec files from subdirectories\.
+.
+.IP "" 4
+.
+.nf
+
+path \'components\' do
+  gem \'admin_ui\'
+  gem \'public_ui\'
+end
+.
+.fi
+.
+.IP "" 0
+.
+.SH "BLOCK FORM OF SOURCE, GIT, PATH, GROUP and PLATFORMS"
+The \fB:source\fR, \fB:git\fR, \fB:path\fR, \fB:group\fR, and \fB:platforms\fR options may be applied to a group of gems by using block form\.
+.
+.IP "" 4
+.
+.nf
+
+source "https://gems\.example\.com" do
+  gem "some_internal_gem"
+  gem "another_internal_gem"
+end
+
+git "https://github\.com/rails/rails\.git" do
+  gem "activesupport"
+  gem "actionpack"
+end
+
+platforms :ruby do
+  gem "ruby\-debug"
+  gem "sqlite3"
+end
+
+group :development, :optional => true do
+  gem "wirble"
+  gem "faker"
+end
+.
+.fi
+.
+.IP "" 0
+.
+.P
+In the case of the group block form the :optional option can be given to prevent a group from being installed unless listed in the \fB\-\-with\fR option given to the \fBbundle install\fR command\.
+.
+.P
+In the case of the \fBgit\fR block form, the \fB:ref\fR, \fB:branch\fR, \fB:tag\fR, and \fB:submodules\fR options may be passed to the \fBgit\fR method, and all gems in the block will inherit those options\.
+.
+.SH "INSTALL_IF"
+The \fBinstall_if\fR method allows gems to be installed based on a proc or lambda\. This is especially useful for optional gems that can only be used if certain software is installed or some other conditions are met\.
+.
+.IP "" 4
+.
+.nf
+
+install_if \-> { RUBY_PLATFORM =~ /darwin/ } do
+  gem "pasteboard"
+end
+.
+.fi
+.
+.IP "" 0
+.
+.SH "GEMSPEC"
+If you wish to use Bundler to help install dependencies for a gem while it is being developed, use the \fBgemspec\fR method to pull in the dependencies listed in the \fB\.gemspec\fR file\.
+.
+.P
+The \fBgemspec\fR method adds any runtime dependencies as gem requirements in the default group\. It also adds development dependencies as gem requirements in the \fBdevelopment\fR group\. Finally, it adds a gem requirement on your project (\fB:path => \'\.\'\fR)\. In conjunction with \fBBundler\.setup\fR, this allows you to require project files in your test code as you would if the project were installed as a gem; you need not manipulate the load path manually or require project files  [...]
+.
+.P
+The \fBgemspec\fR method supports optional \fB:path\fR, \fB:glob\fR, \fB:name\fR, and \fB:development_group\fR options, which control where bundler looks for the \fB\.gemspec\fR, the glob it uses to look for the gemspec (defaults to: "{,\fI,\fR/*}\.gemspec"), what named \fB\.gemspec\fR it uses (if more than one is present), and which group development dependencies are included in\.
+.
+.P
+When a \fBgemspec\fR dependency encounters version conflicts during resolution, the local version under development will always be selected \-\- even if there are remote versions that better match other requirements for the \fBgemspec\fR gem\.
+.
+.SH "SOURCE PRIORITY"
+When attempting to locate a gem to satisfy a gem requirement, bundler uses the following priority order:
+.
+.IP "1." 4
+The source explicitly attached to the gem (using \fB:source\fR, \fB:path\fR, or \fB:git\fR)
+.
+.IP "2." 4
+For implicit gems (dependencies of explicit gems), any source, git, or path repository declared on the parent\. This results in bundler prioritizing the ActiveSupport gem from the Rails git repository over ones from \fBrubygems\.org\fR
+.
+.IP "3." 4
+The sources specified via global \fBsource\fR lines, searching each source in your \fBGemfile\fR from last added to first added\.
+.
+.IP "" 0
+
diff --git a/man/gemfile.5.ronn b/man/gemfile.5.ronn
index da2157e..dead032 100644
--- a/man/gemfile.5.ronn
+++ b/man/gemfile.5.ronn
@@ -30,7 +30,7 @@ Sources are checked for gems following the heuristics described in
 will print a warning after installing the gem indicating which source was used,
 and listing the other sources where the gem is available. A specific source can
 be selected for gems that need to use a non-standard repository, suppressing
-this warning, by using the [`:source` option](#SOURCE-source-) or a
+this warning, by using the [`:source` option](#SOURCE) or a
 [`source` block](#BLOCK-FORM-OF-SOURCE-GIT-PATH-GROUP-and-PLATFORMS).
 
 ### CREDENTIALS
@@ -173,62 +173,38 @@ There are a number of `Gemfile` platforms:
 
   * `ruby`:
     C Ruby (MRI) or Rubinius, but `NOT` Windows
-  * `ruby_18`:
-    _ruby_ `AND` version 1.8
-  * `ruby_19`:
-    _ruby_ `AND` version 1.9
-  * `ruby_20`:
-    _ruby_ `AND` version 2.0
-  * `ruby_21`:
-    _ruby_ `AND` version 2.1
-  * `ruby_22`:
-    _ruby_ `AND` version 2.2
-  * `ruby_23`:
-    _ruby_ `AND` version 2.3
   * `mri`:
     Same as _ruby_, but not Rubinius
-  * `mri_18`:
-    _mri_ `AND` version 1.8
-  * `mri_19`:
-    _mri_ `AND` version 1.9
-  * `mri_20`:
-    _mri_ `AND` version 2.0
-  * `mri_21`:
-    _mri_ `AND` version 2.1
-  * `mri_22`:
-    _mri_ `AND` version 2.2
-  * `mri_23`:
-    _mri_ `AND` version 2.3
+  * `mingw`:
+    Windows 32 bit 'mingw32' platform (aka RubyInstaller)
+  * `x64_mingw`:
+    Windows 64 bit 'mingw32' platform (aka RubyInstaller x64)
   * `rbx`:
     Same as _ruby_, but only Rubinius (not MRI)
   * `jruby`:
     JRuby
   * `mswin`:
     Windows
+
+You can restrict further by platform and version for all platforms *except* for
+`rbx`, `jruby`, and `mswin`.
+
+To specify a version in addition to a platform, append the version number without
+the delimiter to the platform. For example, to specify that a gem should only be
+used on platforms with Ruby 2.3, use:
+
+    ruby_23
+
+The full list of platforms and supported versions includes:
+
+  * `ruby`:
+    1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5
+  * `mri`:
+    1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5
   * `mingw`:
-    Windows 32 bit 'mingw32' platform (aka RubyInstaller)
-  * `mingw_18`:
-    _mingw_ `AND` version 1.8
-  * `mingw_19`:
-    _mingw_ `AND` version 1.9
-  * `mingw_20`:
-    _mingw_ `AND` version 2.0
-  * `mingw_21`:
-    _mingw_ `AND` version 2.1
-  * `mingw_22`:
-    _mingw_ `AND` version 2.2
-  * `mingw_23`:
-    _mingw_ `AND` version 2.3
+    1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5
   * `x64_mingw`:
-    Windows 64 bit 'mingw32' platform (aka RubyInstaller x64)
-  * `x64_mingw_20`:
-    _x64_mingw_ `AND` version 2.0
-  * `x64_mingw_21`:
-    _x64_mingw_ `AND` version 2.1
-  * `x64_mingw_22`:
-    _x64_mingw_ `AND` version 2.2
-  * `x64_mingw_23`:
-    _x64_mingw_ `AND` version 2.3
+    2.0, 2.1, 2.2, 2.3, 2.4, 2.5
 
 As with groups, you can specify one or more platforms:
 
@@ -257,7 +233,7 @@ back on global sources using the ordering described in [SOURCE PRIORITY][].
 
 Selecting a specific source repository this way also suppresses the ambiguous
 gem warning described above in
-[GLOBAL SOURCES (#source)](#GLOBAL-SOURCES-source-).
+[GLOBAL SOURCES (#source)](#GLOBAL-SOURCES).
 
 ### GIT
 
diff --git a/man/gemfile.5.txt b/man/gemfile.5.txt
new file mode 100644
index 0000000..0af0eb3
--- /dev/null
+++ b/man/gemfile.5.txt
@@ -0,0 +1,600 @@
+GEMFILE(5)							    GEMFILE(5)
+
+
+
+1mNAME0m
+       1mGemfile 22m- A format for describing gem dependencies for Ruby programs
+
+1mSYNOPSIS0m
+       A 1mGemfile 22mdescribes the gem dependencies required to execute associated
+       Ruby code.
+
+       Place the 1mGemfile 22min the root of the directory containing  the  associ-
+       ated  code.  For instance, in a Rails application, place the 1mGemfile 22min
+       the same directory as the 1mRakefile22m.
+
+1mSYNTAX0m
+       A 1mGemfile 22mis evaluated as Ruby code, in a context which makes available
+       a number of methods used to describe the gem requirements.
+
+1mGLOBAL SOURCES0m
+       At the top of the 1mGemfile22m, add a line for the 1mRubygems 22msource that con-
+       tains the gems listed in the 1mGemfile22m.
+
+
+
+	   source "https://rubygems.org"
+
+
+
+       It is possible, but not recommended as of Bundler 1.7, to add  multiple
+       global  1msource  22mlines.  Each  of these 1msource22ms 1mMUST 22mbe a valid Rubygems
+       repository.
+
+       Sources are checked for gems  following	the  heuristics  described  in
+       4mSOURCE24m  4mPRIORITY24m.  If	a  gem	is found in more than one global source,
+       Bundler will print a warning after installing the gem indicating  which
+       source  was used, and listing the other sources where the gem is avail-
+       able. A specific source can be selected for gems that  need  to	use  a
+       non-standard repository, suppressing this warning, by using the 1m:source0m
+       option or a 1msource 22mblock.
+
+   1mCREDENTIALS0m
+       Some gem sources require a username and password. Use bundle  config(1)
+       4mbundle-config.1.html24m  to  set  the username and password for any of the
+       sources that need it. The command must be run  once  on	each  computer
+       that  will  install  the  Gemfile,  but this keeps the credentials from
+       being stored in plain text in version control.
+
+
+
+	   bundle config gems.example.com user:password
+
+
+
+       For some sources, like a company Gemfury account, it may be  easier  to
+       include the credentials in the Gemfile as part of the source URL.
+
+
+
+	   source "https://user:password@gems.example.com"
+
+
+
+       Credentials in the source URL will take precedence over credentials set
+       using 1mconfig22m.
+
+1mRUBY0m
+       If your application requires a specific Ruby version or engine, specify
+       your  requirements using the 1mruby 22mmethod, with the following arguments.
+       All parameters are 1mOPTIONAL 22munless otherwise specified.
+
+   1mVERSION (required)0m
+       The version of Ruby that your application requires. If your application
+       requires  an  alternate	Ruby  engine,  such as JRuby or Rubinius, this
+       should be the Ruby version that the engine is compatible with.
+
+
+
+	   ruby "1.9.3"
+
+
+
+   1mENGINE0m
+       Each application 4mmay24m specify a Ruby engine. If an engine is  specified,
+       an engine version 4mmust24m also be specified.
+
+   1mENGINE VERSION0m
+       Each  application  4mmay24m specify a Ruby engine version. If an engine ver-
+       sion is specified, an engine 4mmust24m also be specified. If the  engine  is
+       "ruby" the engine version specified 4mmust24m match the Ruby version.
+
+
+
+	   ruby "1.8.7", :engine => "jruby", :engine_version => "1.6.7"
+
+
+
+   1mPATCHLEVEL0m
+       Each application 4mmay24m specify a Ruby patchlevel.
+
+
+
+	   ruby "2.0.0", :patchlevel => "247"
+
+
+
+1mGEMS0m
+       Specify gem requirements using the 1mgem 22mmethod, with the following argu-
+       ments. All parameters are 1mOPTIONAL 22munless otherwise specified.
+
+   1mNAME (required)0m
+       For each gem requirement, list a single 4mgem24m line.
+
+
+
+	   gem "nokogiri"
+
+
+
+   1mVERSION0m
+       Each 4mgem24m 1mMAY 22mhave one or more version specifiers.
+
+
+
+	   gem "nokogiri", ">= 1.4.2"
+	   gem "RedCloth", ">= 4.1.0", "< 4.2.0"
+
+
+
+   1mREQUIRE AS0m
+       Each 4mgem24m 1mMAY 22mspecify files that should be used when  autorequiring  via
+       1mBundler.require22m.  You  may pass an array with multiple files or 1mtrue 22mif
+       file you want 1mrequired 22mhas same name as 4mgem24m or  1mfalse  22mto  prevent  any
+       file from being autorequired.
+
+
+
+	   gem "redis", :require => ["redis/connection/hiredis", "redis"]
+	   gem "webmock", :require => false
+	   gem "debugger", :require => true
+
+
+
+       The  argument  defaults	to the name of the gem. For example, these are
+       identical:
+
+
+
+	   gem "nokogiri"
+	   gem "nokogiri", :require => "nokogiri"
+	   gem "nokogiri", :require => true
+
+
+
+   1mGROUPS0m
+       Each 4mgem24m 1mMAY 22mspecify membership in one or more  groups.  Any  4mgem24m  that
+       does  not  specify  membership  in  any	group is placed in the 1mdefault0m
+       group.
+
+
+
+	   gem "rspec", :group => :test
+	   gem "wirble", :groups => [:development, :test]
+
+
+
+       The Bundler runtime allows its  two  main  methods,  1mBundler.setup  22mand
+       1mBundler.require22m, to limit their impact to particular groups.
+
+
+
+	   # setup adds gems to Ruby's load path
+	   Bundler.setup		    # defaults to all groups
+	   require "bundler/setup"	    # same as Bundler.setup
+	   Bundler.setup(:default)	    # only set up the _default_ group
+	   Bundler.setup(:test) 	    # only set up the _test_ group (but `not` _default_)
+	   Bundler.setup(:default, :test)   # set up the _default_ and _test_ groups, but no others
+
+	   # require requires all of the gems in the specified groups
+	   Bundler.require		    # defaults to the _default_ group
+	   Bundler.require(:default)	    # identical
+	   Bundler.require(:default, :test) # requires the _default_ and _test_ groups
+	   Bundler.require(:test)	    # requires the _test_ group
+
+
+
+       The  Bundler CLI allows you to specify a list of groups whose gems 1mbun-0m
+       1mdle install 22mshould not install with the 1m--without  22moption.  To  specify
+       multiple  groups  to ignore, specify a list of groups separated by spa-
+       ces.
+
+
+
+	   bundle install --without test
+	   bundle install --without development test
+
+
+
+       After running 1mbundle install --without test22m, bundler will remember that
+       you excluded the test group in the last installation. The next time you
+       run 1mbundle install22m, without any 1m--without option22m, bundler  will  recall
+       it.
+
+       Also,  calling  1mBundler.setup	22mwith  no  parameters, or calling 1mrequire0m
+       1m"bundler/setup" 22mwill setup all groups except for the ones you  excluded
+       via 1m--without 22m(since they are not available).
+
+       Note  that on 1mbundle install22m, bundler downloads and evaluates all gems,
+       in order to create a single canonical list of all of the required  gems
+       and  their dependencies. This means that you cannot list different ver-
+       sions of the same gems in  different  groups.  For  more  details,  see
+       Understanding Bundler 4mhttp://bundler.io/rationale.html24m.
+
+   1mPLATFORMS0m
+       If  a  gem should only be used in a particular platform or set of plat-
+       forms, you can specify them. Platforms  are  essentially  identical  to
+       groups,	except	that you do not need to use the 1m--without 22minstall-time
+       flag to exclude groups of gems for other platforms.
+
+       There are a number of 1mGemfile 22mplatforms:
+
+       1mruby	22mC Ruby (MRI) or Rubinius, but 1mNOT 22mWindows
+
+       1mmri	22mSame as 4mruby24m, but not Rubinius
+
+       1mmingw	22mWindows 32 bit 'mingw32' platform (aka RubyInstaller)
+
+       1mx64_mingw0m
+	      Windows 64 bit 'mingw32' platform (aka RubyInstaller x64)
+
+       1mrbx	22mSame as 4mruby24m, but only Rubinius (not MRI)
+
+       1mjruby	22mJRuby
+
+       1mmswin	22mWindows
+
+       You can restrict further by platform  and  version  for	all  platforms
+       4mexcept24m for 1mrbx22m, 1mjruby22m, and 1mmswin22m.
+
+       To specify a version in addition to a platform, append the version num-
+       ber without the delimiter to the platform. For example, to specify that
+       a gem should only be used on platforms with Ruby 2.3, use:
+
+
+
+	   ruby_23
+
+
+
+       The full list of platforms and supported versions includes:
+
+       1mruby	22m1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5
+
+       1mmri	22m1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5
+
+       1mmingw	22m1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5
+
+       1mx64_mingw0m
+	      2.0, 2.1, 2.2, 2.3, 2.4, 2.5
+
+       As with groups, you can specify one or more platforms:
+
+
+
+	   gem "weakling",   :platforms => :jruby
+	   gem "ruby-debug", :platforms => :mri_18
+	   gem "nokogiri",   :platforms => [:mri_18, :jruby]
+
+
+
+       All   operations   involving  groups  (1mbundle	install22m,  1mBundler.setup22m,
+       1mBundler.require22m) behave exactly the same as if any groups not  matching
+       the current platform were explicitly excluded.
+
+   1mSOURCE0m
+       You  can  select  an  alternate Rubygems repository for a gem using the
+       ':source' option.
+
+
+
+	   gem "some_internal_gem", :source => "https://gems.example.com"
+
+
+
+       This forces the gem to be loaded  from  this  source  and  ignores  any
+       global  sources	declared at the top level of the file. If the gem does
+       not exist in this source, it will not be installed.
+
+       Bundler will search for child dependencies of this gem by first looking
+       in the source selected for the parent, but if they are not found there,
+       it will fall back on global sources using  the  ordering  described  in
+       4mSOURCE24m 4mPRIORITY24m.
+
+       Selecting  a  specific  source  repository this way also suppresses the
+       ambiguous gem warning described above in 4mGLOBAL24m 4mSOURCES24m 4m(#source)24m.
+
+   1mGIT0m
+       If necessary, you can specify that a gem is located at a particular git
+       repository using the 1m:git 22mparameter. The repository can be accessed via
+       several protocols:
+
+       1mHTTP(S)0m
+	      gem "rails", :git => "https://github.com/rails/rails.git"
+
+       1mSSH	22mgem "rails", :git => "git at github.com:rails/rails.git"
+
+       1mgit	22mgem "rails", :git => "git://github.com/rails/rails.git"
+
+       If using SSH, the user that you use to run 1mbundle install MUST 22mhave the
+       appropriate keys available in their 1m$HOME/.ssh22m.
+
+       1mNOTE22m:  1mhttp://  22mand  1mgit://	22mURLs should be avoided if at all possible.
+       These protocols are unauthenticated, so	a  man-in-the-middle  attacker
+       can  deliver  malicious	code and compromise your system. HTTPS and SSH
+       are strongly preferred.
+
+       The 1mgroup22m, 1mplatforms22m, and 1mrequire  22moptions  are  available  and  behave
+       exactly the same as they would for a normal gem.
+
+       A  git  repository  1mSHOULD  22mhave  at least one file, at the root of the
+       directory containing the gem, with the extension  1m.gemspec22m.  This  file
+       1mMUST  22mcontain  a  valid gem specification, as expected by the 1mgem build0m
+       command.
+
+       If a git repository does not have a 1m.gemspec22m, bundler will	attempt  to
+       create one, but it will not contain any dependencies, executables, or C
+       extension compilation instructions. As a result, it may fail  to  prop-
+       erly integrate into your application.
+
+       If  a  git  repository does have a 1m.gemspec 22mfor the gem you attached it
+       to, a version specifier, if provided, means that the git repository  is
+       only  valid  if	the  1m.gemspec 22mspecifies a version matching the version
+       specifier. If not, bundler will print a warning.
+
+
+
+	   gem "rails", "2.3.8", :git => "https://github.com/rails/rails.git"
+	   # bundle install will fail, because the .gemspec in the rails
+	   # repository's master branch specifies version 3.0.0
+
+
+
+       If a git repository does 1mnot 22mhave a 1m.gemspec 22mfor the gem  you	attached
+       it to, a version specifier 1mMUST 22mbe provided. Bundler will use this ver-
+       sion in the simple 1m.gemspec 22mit creates.
+
+       Git repositories support a number of additional options.
+
+       1mbranch22m, 1mtag22m, and 1mref0m
+	      You 1mMUST 22monly specify at most one of these options. The  default
+	      is 1m:branch => "master"0m
+
+       1msubmodules0m
+	      Specify  1m:submodules => true 22mto cause bundler to expand any sub-
+	      modules included in the git repository
+
+       If a git repository contains multiple 1m.gemspecs22m, each  1m.gemspec  22mrepre-
+       sents  a  gem located at the same place in the file system as the 1m.gem-0m
+       1mspec22m.
+
+
+
+	   |~rails		     [git root]
+	   | |-rails.gemspec	     [rails gem located here]
+	   |~actionpack
+	   | |-actionpack.gemspec    [actionpack gem located here]
+	   |~activesupport
+	   | |-activesupport.gemspec [activesupport gem located here]
+	   |...
+
+
+
+       To install a gem located in a git repository, bundler  changes  to  the
+       directory  containing the gemspec, runs 1mgem build name.gemspec 22mand then
+       installs the resulting gem. The 1mgem build 22mcommand, which comes standard
+       with  Rubygems,	evaluates the 1m.gemspec 22min the context of the directory
+       in which it is located.
+
+   1mGIT SOURCE0m
+       A custom git source can be defined via the 1mgit_source	22mmethod.  Provide
+       the  source's  name as an argument, and a block which receives a single
+       argument and interpolates it into a string  to  return  the  full  repo
+       address:
+
+
+
+	   git_source(:stash){ |repo_name| "https://stash.corp.acme.pl/#{repo_name}.git" }
+	   gem 'rails', :stash => 'forks/rails'
+
+
+
+       In addition, if you wish to choose a specific branch:
+
+
+
+	   gem "rails", :stash => "forks/rails", :branch => "branch_name"
+
+
+
+   1mGITHUB0m
+       1mNOTE22m: This shorthand should be avoided until Bundler 2.0, since it cur-
+       rently expands to an insecure 1mgit:// 22mURL. This allows a man-in-the-mid-
+       dle attacker to compromise your system.
+
+       If  the	git repository you want to use is hosted on GitHub and is pub-
+       lic, you can use the :github shorthand to specify the  github  username
+       and  repository	name  (without	the  trailing  ".git"), separated by a
+       slash. If both the username and repository name are the same,  you  can
+       omit one.
+
+
+
+	   gem "rails", :github => "rails/rails"
+	   gem "rails", :github => "rails"
+
+
+
+       Are both equivalent to
+
+
+
+	   gem "rails", :git => "git://github.com/rails/rails.git"
+
+
+
+       Since the 1mgithub 22mmethod is a specialization of 1mgit_source22m, it accepts a
+       1m:branch 22mnamed argument.
+
+   1mGIST0m
+       If the git repository you want to use is hosted as a Github Gist and is
+       public,	you can use the :gist shorthand to specify the gist identifier
+       (without the trailing ".git").
+
+
+
+	   gem "the_hatch", :gist => "4815162342"
+
+
+
+       Is equivalent to:
+
+
+
+	   gem "the_hatch", :git => "https://gist.github.com/4815162342.git"
+
+
+
+       Since the 1mgist 22mmethod is a specialization of 1mgit_source22m, it  accepts  a
+       1m:branch 22mnamed argument.
+
+   1mBITBUCKET0m
+       If  the	git  repository  you want to use is hosted on Bitbucket and is
+       public, you can use the :bitbucket shorthand to specify	the  bitbucket
+       username  and  repository name (without the trailing ".git"), separated
+       by a slash. If both the username and repository name are the same,  you
+       can omit one.
+
+
+
+	   gem "rails", :bitbucket => "rails/rails"
+	   gem "rails", :bitbucket => "rails"
+
+
+
+       Are both equivalent to
+
+
+
+	   gem "rails", :git => "https://rails@bitbucket.org/rails/rails.git"
+
+
+
+       Since  the  1mbitbucket	22mmethod  is  a  specialization  of 1mgit_source22m, it
+       accepts a 1m:branch 22mnamed argument.
+
+   1mPATH0m
+       You can specify that a gem is located in a particular location  on  the
+       file system. Relative paths are resolved relative to the directory con-
+       taining the 1mGemfile22m.
+
+       Similar to the semantics of the 1m:git 22moption, the 1m:path 22moption	requires
+       that  the directory in question either contains a 1m.gemspec 22mfor the gem,
+       or that you specify an explicit version that bundler should use.
+
+       Unlike 1m:git22m, bundler does not compile C extensions for  gems  specified
+       as paths.
+
+
+
+	   gem "rails", :path => "vendor/rails"
+
+
+
+       If you would like to use multiple local gems directly from the filesys-
+       tem, you can set a global 1mpath 22moption to the path containing the  gem's
+       files. This will automatically load gemspec files from subdirectories.
+
+
+
+	   path 'components' do
+	     gem 'admin_ui'
+	     gem 'public_ui'
+	   end
+
+
+
+1mBLOCK FORM OF SOURCE, GIT, PATH, GROUP and PLATFORMS0m
+       The 1m:source22m, 1m:git22m, 1m:path22m, 1m:group22m, and 1m:platforms 22moptions may be applied
+       to a group of gems by using block form.
+
+
+
+	   source "https://gems.example.com" do
+	     gem "some_internal_gem"
+	     gem "another_internal_gem"
+	   end
+
+	   git "https://github.com/rails/rails.git" do
+	     gem "activesupport"
+	     gem "actionpack"
+	   end
+
+	   platforms :ruby do
+	     gem "ruby-debug"
+	     gem "sqlite3"
+	   end
+
+	   group :development, :optional => true do
+	     gem "wirble"
+	     gem "faker"
+	   end
+
+
+
+       In the case of the group block form the :optional option can  be  given
+       to  prevent  a  group  from being installed unless listed in the 1m--with0m
+       option given to the 1mbundle install 22mcommand.
+
+       In the case of the 1mgit 22mblock form, the 1m:ref22m, 1m:branch22m, 1m:tag22m,	and  1m:sub-0m
+       1mmodules  22moptions  may  be passed to the 1mgit 22mmethod, and all gems in the
+       block will inherit those options.
+
+1mINSTALL_IF0m
+       The 1minstall_if 22mmethod allows gems to be installed based on	a  proc  or
+       lambda.	This  is  especially useful for optional gems that can only be
+       used if certain software is installed or some other conditions are met.
+
+
+
+	   install_if -> { RUBY_PLATFORM =~ /darwin/ } do
+	     gem "pasteboard"
+	   end
+
+
+
+1mGEMSPEC0m
+       If you wish to use Bundler to help install dependencies for a gem while
+       it  is being developed, use the 1mgemspec 22mmethod to pull in the dependen-
+       cies listed in the 1m.gemspec 22mfile.
+
+       The 1mgemspec 22mmethod adds any runtime dependencies as gem requirements in
+       the  default  group.  It  also  adds  development  dependencies	as gem
+       requirements in the 1mdevelopment 22mgroup. Finally, it adds a gem  require-
+       ment on your project (1m:path => '.'22m). In conjunction with 1mBundler.setup22m,
+       this allows you to require project files in your test code as you would
+       if  the	project  were  installed as a gem; you need not manipulate the
+       load path manually or require project files via relative paths.
+
+       The 1mgemspec 22mmethod supports optional 1m:path22m, 1m:glob22m, 1m:name22m, and 1m:develop-0m
+       1mment_group 22moptions, which control where bundler looks for the 1m.gemspec22m,
+       the glob it uses to look for the  gemspec  (defaults  to:  "{,4m,24m/*}.gem-
+       spec"),	what named 1m.gemspec 22mit uses (if more than one is present), and
+       which group development dependencies are included in.
+
+       When a 1mgemspec 22mdependency encounters version conflicts  during  resolu-
+       tion,  the  local  version under development will always be selected --
+       even if there are remote versions that better match other  requirements
+       for the 1mgemspec 22mgem.
+
+1mSOURCE PRIORITY0m
+       When  attempting  to locate a gem to satisfy a gem requirement, bundler
+       uses the following priority order:
+
+       1.  The source explicitly attached to the gem (using 1m:source22m, 1m:path22m, or
+	   1m:git22m)
+
+       2.  For implicit gems (dependencies of explicit gems), any source, git,
+	   or path repository declared on the parent. This results in  bundler
+	   prioritizing  the  ActiveSupport  gem from the Rails git repository
+	   over ones from 1mrubygems.org0m
+
+       3.  The sources specified  via  global  1msource  22mlines,  searching  each
+	   source in your 1mGemfile 22mfrom last added to first added.
+
+
+
+
+
+
+				   May 2017			    GEMFILE(5)
diff --git a/man/index.txt b/man/index.txt
index 9e46ceb..e3b38c4 100644
--- a/man/index.txt
+++ b/man/index.txt
@@ -6,3 +6,10 @@ bundle-exec        bundle-exec.1
 bundle-config      bundle-config.1
 bundle-platform    bundle-platform.1
 bundle-gem         bundle-gem.1
+bundle-clean       bundle-clean.1
+bundle-check       bundle-check.1
+bundle-init        bundle-init.1
+bundle-inject      bundle-inject.1
+bundle-open        bundle-open.1
+bundle-show        bundle-show.1
+bundle-viz         bundle-viz.1
diff --git a/task/release.rake b/task/release.rake
new file mode 100644
index 0000000..e030ef8
--- /dev/null
+++ b/task/release.rake
@@ -0,0 +1,116 @@
+# frozen_string_literal: true
+namespace :release do
+  def confirm(prompt = "")
+    loop do
+      print(prompt)
+      print(": ") unless prompt.empty?
+      break if $stdin.gets.strip == "y"
+    end
+  rescue Interrupt
+    abort
+  end
+
+  def gh_api_request(opts)
+    require "net/http"
+    require "json"
+    host = opts.fetch(:host) { "https://api.github.com/" }
+    path = opts.fetch(:path)
+    response = Net::HTTP.get_response(URI.join(host, path))
+
+    links = Hash[*(response["Link"] || "").split(", ").map do |link|
+      href, name = link.match(/<(.*?)>; rel="(\w+)"/).captures
+
+      [name.to_sym, href]
+    end.flatten]
+
+    parsed_response = JSON.parse(response.body)
+
+    if n = links[:next]
+      parsed_response.concat gh_api_request(:host => host, :path => n)
+    end
+
+    parsed_response
+  end
+
+  desc "Make a patch release with the PRs from master in the patch milestone"
+  task :patch, :version do |_t, args|
+    version = args.version
+
+    version ||= begin
+      version = BUNDLER_SPEC.version
+      segments = version.segments
+      if segments.last.is_a?(String)
+        segments << "1"
+      else
+        segments[-1] += 1
+      end
+      segments.join(".")
+    end
+
+    confirm "You are about to release #{version}, currently #{BUNDLER_SPEC.version}"
+
+    milestones = gh_api_request(:path => "repos/bundler/bundler/milestones?state=open")
+    unless patch_milestone = milestones.find {|m| m["title"] == version }
+      abort "failed to find #{version} milestone on GitHub"
+    end
+    prs = gh_api_request(:path => "repos/bundler/bundler/issues?milestone=#{patch_milestone["number"]}&state=all")
+    prs.map! do |pr|
+      abort "#{pr["html_url"]} hasn't been closed yet!" unless pr["state"] == "closed"
+      next unless pr["pull_request"]
+      pr["number"].to_s
+    end
+    prs.compact!
+
+    version_file = "lib/bundler/version.rb"
+    version_contents = File.read(version_file)
+    unless version_contents.sub!(/^(\s*VERSION = )"#{Gem::Version::VERSION_PATTERN}"/, "\\1#{version.to_s.dump}")
+      abort "failed to update #{version_file}, is it in the expected format?"
+    end
+    File.open(version_file, "w") {|f| f.write(version_contents) }
+
+    BUNDLER_SPEC.version = version
+
+    branch = version.split(".", 3)[0, 2].push("stable").join("-")
+    sh("git", "checkout", branch)
+
+    commits = `git log --oneline origin/master --`.split("\n").map {|l| l.split(/\s/, 2) }.reverse
+    commits.select! {|_sha, message| message =~ /(Auto merge of|Merge pull request) ##{Regexp.union(*prs)}/ }
+
+    abort "Could not find commits for all PRs" unless commits.size == prs.size
+
+    unless system("git", "cherry-pick", "-x", "-m", "1", *commits.map(&:first))
+      abort unless system("zsh")
+    end
+
+    prs.each do |pr|
+      system("open", "https://github.com/bundler/bundler/pull/#{pr}")
+      confirm "Add to the changelog"
+    end
+
+    confirm "Update changelog"
+    sh("git", "commit", "-am", "Version #{version} with changelog")
+    sh("rake", "release")
+    sh("git", "checkout", "master")
+    sh("git", "pull")
+    sh("git", "merge", "v#{version}", "--no-edit")
+    sh("git", "push")
+  end
+
+  desc "Open all PRs that have not been included in a stable release"
+  task :open_unreleased_prs do
+    def prs(on = "master")
+      commits = `git log --oneline origin/#{on} --`.split("\n")
+      commits.reverse_each.map {|c| c =~ /(Auto merge of|Merge pull request) #(\d+)/ && $2 }.compact
+    end
+
+    last_stable = `git ls-remote origin`.split("\n").map {|r| r =~ %r{refs/tags/v([\d.]+)$} && $1 }.compact.map {|v| Gem::Version.create(v) }.max
+    last_stable = last_stable.segments[0, 2].<<("stable").join("-")
+
+    in_release = prs("HEAD") - prs(last_stable)
+
+    in_release.each do |pr|
+      system("open", "https://github.com/bundler/bundler/pull/#{pr}")
+      confirm
+    end
+  end
+end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/bundler.git



More information about the Pkg-ruby-extras-commits mailing list