Sha256: bf91b3f5d8bf4a2d7b94779424fc3fd674c88bfcc2c2a07ae18cead9f02c5465

Contents?: true

Size: 1.04 KB

Versions: 16

Compression:

Stored size: 1.04 KB

Contents

module Bundler
  class CLI::Package
    attr_reader :options

    def initialize(options)
      @options = options
    end

    def run
      Bundler.ui.level = "warn" 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.sources.any? { |s| !s.is_a?(Source::Rubygems) } && !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

16 entries across 16 versions & 2 rubygems

Version Path
bundler-1.6.9 lib/bundler/cli/package.rb
bundler-1.6.8 lib/bundler/cli/package.rb
bundler-1.6.7 lib/bundler/cli/package.rb
bundler-1.6.6 lib/bundler/cli/package.rb
bundler-1.6.5 lib/bundler/cli/package.rb
bundler-1.6.4 lib/bundler/cli/package.rb
bundler-prehistoric-1.6.2.2 lib/bundler/cli/package.rb
bundler-1.6.3 lib/bundler/cli/package.rb
bundler-prehistoric-1.6.2.1 lib/bundler/cli/package.rb
bundler-prehistoric-1.6.2 lib/bundler/cli/package.rb
bundler-1.6.2 lib/bundler/cli/package.rb
bundler-1.6.1 lib/bundler/cli/package.rb
bundler-1.6.0 lib/bundler/cli/package.rb
bundler-1.6.0.rc2 lib/bundler/cli/package.rb
bundler-1.6.0.rc lib/bundler/cli/package.rb
bundler-1.6.0.pre.2 lib/bundler/cli/package.rb