Sha256: 649f0dc9f01e2dc8c21dc902c9c4fc9b06faa0f688b5f98c82a0c9b77436fe21

Contents?: true

Size: 1.3 KB

Versions: 30

Compression:

Stored size: 1.3 KB

Contents

require 'bundler/cli/common'

module Bundler
  class CLI::Show
    attr_reader :options, :gem_name
    def initialize(options, gem_name)
      @options = options
      @gem_name = gem_name
    end

    def run
      Bundler.ui.silence do
        Bundler.definition.validate_ruby!
        Bundler.load.lock
      end

      if gem_name
        if gem_name == "bundler"
          path = File.expand_path("../../../..", __FILE__)
        else
          spec = Bundler::CLI::Common.select_spec(gem_name, :regex_match)
          return unless spec
          path = spec.full_gem_path
          if !File.directory?(path)
            Bundler.ui.warn "The gem #{gem_name} has been deleted. It was installed at:"
          end
        end
        return Bundler.ui.info(path)
      end

      if options[:paths]
        Bundler.load.specs.sort_by { |s| s.name }.map do |s|
          Bundler.ui.info s.full_gem_path
        end
      else
        Bundler.ui.info "Gems included by the bundle:"
        Bundler.load.specs.sort_by { |s| s.name }.each do |s|
          desc = "  * #{s.name} (#{s.version}#{s.git_version})"
          if @options[:verbose]
            Bundler.ui.info "#{desc} - #{s.summary || 'No description available.'}"
          else
            Bundler.ui.info desc
          end
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
bundler-1.7.15 lib/bundler/cli/show.rb
bundler-1.7.14 lib/bundler/cli/show.rb
bundler-1.7.13 lib/bundler/cli/show.rb
bundler-1.7.12 lib/bundler/cli/show.rb
bundler-1.7.11 lib/bundler/cli/show.rb
bundler-1.7.10 lib/bundler/cli/show.rb
bundler-1.7.9 lib/bundler/cli/show.rb
bundler-1.7.8 lib/bundler/cli/show.rb
bundler-1.7.7 lib/bundler/cli/show.rb
bundler-1.7.6 lib/bundler/cli/show.rb
bundler-1.6.9 lib/bundler/cli/show.rb
bundler-1.7.5 lib/bundler/cli/show.rb
bundler-1.6.8 lib/bundler/cli/show.rb
bundler-1.7.4 lib/bundler/cli/show.rb
bundler-1.6.7 lib/bundler/cli/show.rb
bundler-1.7.3 lib/bundler/cli/show.rb
bundler-1.6.6 lib/bundler/cli/show.rb
bundler-1.7.2 lib/bundler/cli/show.rb
bundler-1.7.1 lib/bundler/cli/show.rb
bundler-1.7.1.pre.3 lib/bundler/cli/show.rb