Sha256: a72ae1336cd5e118770876d7e94d544bb1b15dc4416db46d3b789348bf30fb41

Contents?: true

Size: 1.02 KB

Versions: 12

Compression:

Stored size: 1.02 KB

Contents

module Bundler
  class CLI::Package
    attr_reader :options

    def initialize(options)
      @options = options
    end

    def run
      Bundler.ui.level = "error" if options[:quiet]
      Bundler.settings[:path] = File.expand_path(options[:path]) if options[:path]

      setup_cache_all
      install

      # TODO: move cache contents here now that all bundles are locked
      custom_path = Pathname.new(options[:path]) if options[:path]
      Bundler.load.cache(custom_path)
    end

  private

    def install
      require 'bundler/cli/install'
      Bundler::CLI::Install.new(options.dup).run
    end

    def setup_cache_all
      Bundler.settings[:cache_all] = options[:all] if options.key?("all")

      if Bundler.definition.has_local_dependencies? && !Bundler.settings[:cache_all]
        Bundler.ui.warn "Your Gemfile contains path and git dependencies. If you want "    \
          "to package them as well, please pass the --all flag. This will be the default " \
          "on Bundler 2.0."
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
bundler-1.7.15 lib/bundler/cli/package.rb
bundler-1.7.14 lib/bundler/cli/package.rb
bundler-1.7.13 lib/bundler/cli/package.rb
bundler-1.7.12 lib/bundler/cli/package.rb
bundler-1.7.11 lib/bundler/cli/package.rb
bundler-1.7.10 lib/bundler/cli/package.rb
bundler-1.7.9 lib/bundler/cli/package.rb
bundler-1.7.8 lib/bundler/cli/package.rb
bundler-1.7.7 lib/bundler/cli/package.rb
bundler-1.7.6 lib/bundler/cli/package.rb
bundler-1.7.5 lib/bundler/cli/package.rb
bundler-1.7.4 lib/bundler/cli/package.rb