Sha256: 1102e111ea46eb4bba5b10e9cfd7b1fccf1c72c324fb68c457a0031f35386ec2

Contents?: true

Size: 1.1 KB

Versions: 201

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

module Bundler
  class CLI::Cache
    attr_reader :options

    def initialize(options)
      @options = options
    end

    def run
      Bundler.ui.level = "warn" if options[:quiet]
      Bundler.settings.set_command_option_if_given :path, options[:path]
      Bundler.settings.set_command_option_if_given :cache_path, options["cache-path"]

      setup_cache_all
      install

      # TODO: move cache contents here now that all bundles are locked
      custom_path = Bundler.settings[:path] if options[:path]

      Bundler.settings.temporary(:cache_all_platforms => options["all-platforms"]) do
        Bundler.load.cache(custom_path)
      end
    end

    private

    def install
      require_relative "install"
      options = self.options.dup
      options["local"] = false if Bundler.settings[:cache_all_platforms]
      options["no-cache"] = true
      Bundler::CLI::Install.new(options).run
    end

    def setup_cache_all
      all = options.fetch(:all, Bundler.feature_flag.cache_all? || nil)

      Bundler.settings.set_command_option_if_given :cache_all, all
    end
  end
end

Version data entries

201 entries across 201 versions & 6 rubygems

Version Path
harbr-0.1.55 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
harbr-0.1.54 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
harbr-0.1.53 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
harbr-0.1.52 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
harbr-0.1.50 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
harbr-0.1.49 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
harbr-0.1.48 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
harbr-0.1.47 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
harbr-0.1.46 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
harbr-0.1.45 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
harbr-0.1.44 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
harbr-0.1.43 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
harbr-0.1.42 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
harbr-0.1.41 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
harbr-0.1.39 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
harbr-0.1.38 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
harbr-0.1.37 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
direct7-0.0.11 vendor/bundle/ruby/2.7.0/gems/bundler-2.4.21/lib/bundler/cli/cache.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/bundler-2.3.5/lib/bundler/cli/cache.rb
bundler-2.3.27 lib/bundler/cli/cache.rb