class Bundler::Installer

def run(options)

Finally: TODO add documentation for how the standalone process works.

that a user runs `bundle install` they will receive any updates from this process.
Sixthly, a new Gemfile.lock is created from the installed gems to ensure that the next time

earlier.
but only if the --binstubs option has been passed or Bundler.options[:bin] has been set
This then leads into the gems being installed, along with stubs for their executables,
Fifthly, Bundler resolves the dependencies either through a cache of gems or by remote.

to that which is specified in Gemfile.lock, or if there are any missing specs for the gems.
default lock file (Gemfile.lock). However, this is not the case if the platform is different
then proceeds to set up a defintion based on the default gemfile (Gemfile) and the
Fourthly, Bundler checks if the default lockfile (Gemfile.lock) exists, and if so

Bundler returns a warning message stating so and this method returns.
Bundler::Environment#dependencies. If there are no dependencies specified then
Thirdly, Bundler checks if there are any dependencies specified in the Gemfile using

`bundle install` will potentially not install the correct gems.
If this file is not correctly updated then any other developer running
`bundle install`, which leads to the Gemfile.lock file not being correctly updated.
This stops a situation where a developer may update the Gemfile but may not run
Frozen ensures that the Gemfile and the Gemfile.lock file are matching.
Secondly, it checks if Bundler has been configured to be "frozen"

on the system, be it RVM or at a system path.
and if not then will create it. This is usually the location of gems
Firstly, this method will check to see if Bundler.bundle_path exists

Runs the install procedures for a specific Gemfile.
def run(options)
  create_bundle_path
  if Bundler.settings[:frozen]
    @definition.ensure_equivalent_gemfile_and_lockfile(options[:deployment])
  end
  if dependencies.empty?
    Bundler.ui.warn "The Gemfile specifies no dependencies"
    lock
    return
  end
  if Bundler.default_lockfile.exist? && !options["update"]
    local = Bundler.ui.silence do
      begin
        tmpdef = Definition.build(Bundler.default_gemfile, Bundler.default_lockfile, nil)
        true unless tmpdef.new_platform? || tmpdef.missing_specs.any?
      rescue BundlerError
      end
    end
  end
  # Since we are installing, we can resolve the definition
  # using remote specs
  unless local
    options["local"] ? @definition.resolve_with_cache! : @definition.resolve_remotely!
  end
  # Must install gems in the order that the resolver provides
  # as dependencies might actually affect the installation of
  # the gem.
  Installer.post_install_messages = {}
  # the order that the resolver provides is significant, since
  # dependencies might actually affect the installation of a gem.
  # that said, it's a rare situation (other than rake), and parallel
  # installation is just SO MUCH FASTER. so we let people opt in.
  jobs = [Bundler.settings[:jobs].to_i-1, 1].max
  if jobs > 1 && can_install_parallely?
    install_in_parallel jobs, options[:standalone]
  else
    install_sequentially options[:standalone]
  end
  lock unless Bundler.settings[:frozen]
  generate_standalone(options[:standalone]) if options[:standalone]
end