Sha256: a4d4446649ff801b7abc006105fd6534c0613ee6b6d342f1efc565810c3c961f

Contents?: true

Size: 1.25 KB

Versions: 82

Compression:

Stored size: 1.25 KB

Contents

# frozen_string_literal: true

module Bundler
  class CLI::Check
    attr_reader :options

    def initialize(options)
      @options = options
    end

    def run
      Bundler.settings.set_command_option_if_given :path, options[:path]

      definition = Bundler.definition
      definition.validate_runtime!

      begin
        definition.resolve_only_locally!
        not_installed = definition.missing_specs
      rescue GemNotFound, SolveFailure
        Bundler.ui.error "Bundler can't satisfy your Gemfile's dependencies."
        Bundler.ui.warn "Install missing gems with `bundle install`."
        exit 1
      end

      if not_installed.any?
        Bundler.ui.error "The following gems are missing"
        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.file? && Bundler.frozen_bundle?
        Bundler.ui.error "This bundle has been frozen, but there is no #{SharedHelpers.relative_lockfile_path} present"
        exit 1
      else
        Bundler.load.lock(:preserve_unknown_sections => true) unless options[:"dry-run"]
        Bundler.ui.info "The Gemfile's dependencies are satisfied"
      end
    end
  end
end

Version data entries

82 entries across 82 versions & 4 rubygems

Version Path
direct7-0.0.18 vendor/bundle/ruby/2.7.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
direct7-0.0.17 vendor/bundle/ruby/2.7.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
direct7-0.0.16 vendor/bundle/ruby/2.7.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
harbr-2.8.1 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
direct7-0.0.13 vendor/bundle/ruby/2.7.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
direct7-0.0.12 vendor/bundle/ruby/2.7.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
harbr-0.2.10 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
harbr-0.2.9 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
harbr-0.2.8 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
harbr-0.2.7 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
harbr-0.2.6 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
harbr-0.2.5 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
harbr-0.2.4 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
harbr-0.2.3 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
harbr-0.2.2 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
harbr-0.2.1 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
harbr-0.2.0 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
harbr-0.1.99 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
harbr-0.1.98 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb
harbr-0.1.97 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/check.rb