Class: Bundler::CLI

### Home Classes Methods

### In Files

- lib/bundler/cli.rb

### Parent

Thor

### Namespace

- MODULE Bundler::CLI::Common
- CLASS Bundler::CLI::Binstubs
- CLASS Bundler::CLI::Cache
- CLASS Bundler::CLI::Check
- CLASS Bundler::CLI::Clean
- CLASS Bundler::CLI::Config
- CLASS Bundler::CLI::Console
- CLASS Bundler::CLI::Exec
- CLASS Bundler::CLI::Gem
- CLASS Bundler::CLI::Init
- CLASS Bundler::CLI::Inject
- CLASS Bundler::CLI::Install
- CLASS Bundler::CLI::Lock
- CLASS Bundler::CLI::Open
- CLASS Bundler::CLI::Outdated
- CLASS Bundler::CLI::Package
- CLASS Bundler::CLI::Platform
- CLASS Bundler::CLI::Show
- CLASS Bundler::CLI::Update
- CLASS Bundler::CLI::Viz

### Methods

- ::handle_no_command_error
- ::new
- ::source_root
- ::start
- #binstubs
- #cache
- #check
- #clean
- #config
- #console
- #env
- #exec
- #gem
- #help
- #init
- #inject
- #install
- #licenses
- #lock
- #open
- #outdated
- #package
- #platform
- #show
- #update
- #version
- #viz

### Included Modules

- Bundler::Thor::Actions

### Files

- bundle
- bundle-config
- bundle-config.txt
- bundle-exec
- bundle-exec.txt
- bundle-install
- bundle-install.txt
- bundle-package
- bundle-package.txt
- bundle-platform
- bundle-platform.txt
- bundle-update
- bundle-update.txt
- bundle.txt
- gemfile.5.txt
- Executable
- Gemfile

### Class/Module Index

Quicksearch

- Bundler
- Bundler::BundlerError
- Bundler::CLI
- Bundler::CLI::Binstubs
- Bundler::CLI::Cache
- Bundler::CLI::Check
- Bundler::CLI::Clean
- Bundler::CLI::Common
- Bundler::CLI::Config
- Bundler::CLI::Console
- Bundler::CLI::Exec
- Bundler::CLI::Gem
- Bundler::CLI::Init
- Bundler::CLI::Inject
- Bundler::CLI::Install
- Bundler::CLI::Lock
- Bundler::CLI::Open
- Bundler::CLI::Outdated
- Bundler::CLI::Package
- Bundler::CLI::Platform
- Bundler::CLI::Show
- Bundler::CLI::Update
- Bundler::CLI::Viz
- Bundler::CurrentRuby
- Bundler::CyclicDependencyError
- Bundler::Definition
- Bundler::DepProxy
- Bundler::Dependency
- Bundler::Deployment
- Bundler::Deprecate
- Bundler::DeprecatedError
- Bundler::Dsl
- Bundler::Dsl::DSLError
- Bundler::EndpointSpecification
- Bundler::Env
- Bundler::Environment
- Bundler::Fetcher
- Bundler::Fetcher::AuthenticationRequiredError
- Bundler::Fetcher::BadAuthenticationError
- Bundler::Fetcher::Base
- Bundler::Fetcher::CertificateFailureError
- Bundler::Fetcher::Dependency
- Bundler::Fetcher::Downloader
- Bundler::Fetcher::FallbackError
- Bundler::Fetcher::Index
- Bundler::Fetcher::NetworkDownError
- Bundler::Fetcher::SSLError
- Bundler::GemHelper
- Bundler::GemHelpers
- Bundler::GemInstaller
- Bundler::GemNotFound
- Bundler::GemfileError
- Bundler::GemfileLockNotFound
- Bundler::GemfileNotFound
- Bundler::GemspecError
- Bundler::GitError
- Bundler::Graph
- Bundler::Graph::GraphVizClient
- Bundler::HTTPError
- Bundler::Index
- Bundler::Injector
- Bundler::InstallError
- Bundler::InstallHookError
- Bundler::Installer
- Bundler::InvalidOption
- Bundler::LazySpecification
- Bundler::LockfileError
- Bundler::LockfileParser
- Bundler::MarshalError
- Bundler::MatchPlatform
- Bundler::Molinillo
- Bundler::Molinillo::CircularDependencyError
- Bundler::Molinillo::DependencyGraph
- Bundler::Molinillo::DependencyGraph::Vertex
- Bundler::Molinillo::DependencyState
- Bundler::Molinillo::NoSuchDependencyError
- Bundler::Molinillo::PossibilityState
- Bundler::Molinillo::Resolver
- Bundler::Molinillo::Resolver::Resolution
- Bundler::Molinillo::ResolverError
- Bundler::Molinillo::SpecificationProvider
- Bundler::Molinillo::UI
- Bundler::Molinillo::VersionConflict
- Bundler::PathError
- Bundler::ProductionError
- Bundler::RemoteSpecification
- Bundler::Resolver
- Bundler::Resolver::Molinillo
- Bundler::Resolver::Molinillo::VersionConflict
- Bundler::Resolver::SpecGroup
- Bundler::Retry
- Bundler::RubyDsl
- Bundler::RubyVersion
- Bundler::RubyVersionMismatch
- Bundler::RubygemsIntegration
- Bundler::RubygemsIntegration::AlmostModern
- Bundler::RubygemsIntegration::Ancient
- Bundler::RubygemsIntegration::Future
- Bundler::RubygemsIntegration::Gem
- Bundler::RubygemsIntegration::Legacy
- Bundler::RubygemsIntegration::Legacy::Gem::SourceIndex
- Bundler::RubygemsIntegration::Modern
- Bundler::RubygemsIntegration::MoreFuture
- Bundler::RubygemsIntegration::MoreModern
- Bundler::RubygemsIntegration::Transitional
- Bundler::Runtime
- Bundler::SecurityError
- Bundler::Settings
- Bundler::SharedHelpers
- Bundler::SimilarityDetector
- Bundler::Source
- Bundler::Source::Git
- Bundler::Source::Git::GitCommandError
- Bundler::Source::Git::GitNotAllowedError
- Bundler::Source::Git::GitNotInstalledError
- Bundler::Source::Git::GitProxy
- Bundler::Source::Path
- Bundler::Source::Path::Installer
- Bundler::Source::Rubygems
- Bundler::Source::Rubygems::Remote
- Bundler::SourceList
- Bundler::SpecSet
- Bundler::StubSpecification
- Bundler::SystemRubyVersion
- Bundler::Thor
- Bundler::Thor::Actions
- Bundler::Thor::Actions::ClassMethods
- Bundler::Thor::AmbiguousCommandError
- Bundler::Thor::Base
- Bundler::Thor::Base::ClassMethods
- Bundler::Thor::Command
- Bundler::Thor::DynamicCommand
- Bundler::Thor::Error
- Bundler::Thor::Group
- Bundler::Thor::HiddenCommand
- Bundler::Thor::Invocation
- Bundler::Thor::Invocation::ClassMethods
- Bundler::Thor::InvocationError
- Bundler::Thor::LineEditor
- Bundler::Thor::LineEditor::Basic
- Bundler::Thor::LineEditor::Readline
- Bundler::Thor::LineEditor::Readline::PathCompletion
- Bundler::Thor::MalformattedArgumentError
- Bundler::Thor::RakeCompat
- Bundler::Thor::RequiredArgumentMissingError
- Bundler::Thor::Shell
- Bundler::Thor::Shell::Basic
- Bundler::Thor::Shell::Color
- Bundler::Thor::Shell::HTML
- Bundler::Thor::UndefinedCommandError
- Bundler::Thor::UnknownArgumentError
- Bundler::Thor::Util
- Bundler::UI
- Bundler::UI::RGProxy
- Bundler::UI::Shell
- Bundler::UI::Silent
- Bundler::VersionConflict
- Bundler::Worker
- Bundler::Worker::WrappedException
- Gem
- Gem::Dependency
- Gem::Platform
- Gem::Requirement
- Gem::Specification
- Net
- Net::HTTP
- Net::HTTP::Persistent
- Net::HTTP::Persistent::Error
- Net::HTTP::Persistent::SSLReuse
- ParallelInstaller
- ParallelInstaller::SpecInstallation
- Object

No matching classes.

# Bundler::CLI

### Constants

AUTO_INSTALL_CMDS

### Public Class Methods

handle_no_command_error(command, has_namespace = $thor_runner) click to toggle source

    # File lib/bundler/cli.rb, line 70
    def self.handle_no_command_error(command, has_namespace = $thor_runner)
      return super unless command_path = Bundler.which("bundler-#{command}")

      Kernel.exec(command_path, *ARGV[1..-1])
    end

new(*args) click to toggle source

    # File lib/bundler/cli.rb, line 16
    def initialize(*args)
      super
      current_cmd = args.last[:current_command].name
      custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
      ENV['BUNDLE_GEMFILE']   = File.expand_path(custom_gemfile) if custom_gemfile
      Bundler.settings[:retry] = options[:retry] if options[:retry]
      auto_install if AUTO_INSTALL_CMDS.include?(current_cmd)
    rescue UnknownArgumentError => e
      raise InvalidOption, e.message
    ensure
      self.options ||= {}
      Bundler.ui = UI::Shell.new(options)
      Bundler.ui.level = "debug" if options["verbose"]
    end

source_root() click to toggle source

    # File lib/bundler/cli.rb, line 357
    def self.source_root
      File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
    end

start(*) click to toggle source

    # File lib/bundler/cli.rb, line 9
    def self.start(*)
      super
    rescue Exception => e
      Bundler.ui = UI::Shell.new
      raise e
    end

### Public Instance Methods

binstubs(*gems) click to toggle source

    # File lib/bundler/cli.rb, line 210
    def binstubs(*gems)
      require 'bundler/cli/binstubs'
      Binstubs.new(options, gems).run
    end

cache() click to toggle source

    # File lib/bundler/cli.rb, line 237
    def cache
      require 'bundler/cli/cache'
      Cache.new(options).run
    end

check() click to toggle source

    # File lib/bundler/cli.rb, line 100
    def check
      require 'bundler/cli/check'
      Check.new(options).run
    end

clean() click to toggle source

    # File lib/bundler/cli.rb, line 366
    def clean
      require 'bundler/cli/clean'
      Clean.new(options.dup).run
    end

config(*args) click to toggle source

    # File lib/bundler/cli.rb, line 289
    def config(*args)
      require 'bundler/cli/config'
      Config.new(options, args, self).run
    end

console(group = nil) click to toggle source

    # File lib/bundler/cli.rb, line 301
    def console(group = nil)
      require 'bundler/cli/console'
      Console.new(options, group).run
    end

env() click to toggle source

    # File lib/bundler/cli.rb, line 400
    def env
      Env.new.write($stdout)
    end

exec(*args) click to toggle source

    # File lib/bundler/cli.rb, line 272
    def exec(*args)
      require 'bundler/cli/exec'
      Exec.new(options, args).run
    end

gem(name) click to toggle source

    # File lib/bundler/cli.rb, line 352
    def gem(name)
      require 'bundler/cli/gem'
      Gem.new(options, name, self).run
    end

help(cli = nil) click to toggle source

    # File lib/bundler/cli.rb, line 40
    def help(cli = nil)
      case cli
      when "gemfile" then command = "gemfile.5"
      when nil       then command = "bundle"
      else command = "bundle-#{cli}"
      end

      manpages = %(
          bundle
          bundle-config
          bundle-exec
          bundle-install
          bundle-package
          bundle-update
          bundle-platform
          gemfile.5)

      if manpages.include?(command)
        root = File.expand_path("../man", __FILE__)

        if Bundler.which("man") && root !~ %{^file:/.+!/META-INF/jruby.home/.+}
          Kernel.exec "man #{root}/#{command}"
        else
          puts File.read("#{root}/#{command}.txt")
        end
      else
        super
      end
    end

init() click to toggle source

    # File lib/bundler/cli.rb, line 83
    def init
      require 'bundler/cli/init'
      Init.new(options.dup).run
    end

inject(name, version, *gems) click to toggle source

    # File lib/bundler/cli.rb, line 380
    def inject(name, version, *gems)
      require 'bundler/cli/inject'
      Inject.new(options, name, version, gems).run
    end

install() click to toggle source

    # File lib/bundler/cli.rb, line 156
    def install
      require 'bundler/cli/install'
      Install.new(options.dup).run
    end

licenses() click to toggle source

    # File lib/bundler/cli.rb, line 313
    def licenses
      Bundler.load.specs.sort_by { |s| s.license.to_s }.reverse.each do |s|
        gem_name = s.name
        license  = s.license || s.licenses

        if license.empty?
          Bundler.ui.warn "#{gem_name}: Unknown"
        else
          Bundler.ui.info "#{gem_name}: #{license}"
        end
      end
    end

lock() click to toggle source

    # File lib/bundler/cli.rb, line 394
    def lock
      require 'bundler/cli/lock'
      Lock.new(options).run
    end

open(name) click to toggle source

    # File lib/bundler/cli.rb, line 295
    def open(name)
      require 'bundler/cli/open'
      Open.new(options, name).run
    end

outdated(*gems) click to toggle source

    # File lib/bundler/cli.rb, line 228
    def outdated(*gems)
      require 'bundler/cli/outdated'
      Outdated.new(options, gems).run
    end

package() click to toggle source

    # File lib/bundler/cli.rb, line 259
    def package
      require 'bundler/cli/package'
      Package.new(options).run
    end

platform() click to toggle source

    # File lib/bundler/cli.rb, line 374
    def platform
      require 'bundler/cli/platform'
      Platform.new(options).run
    end

show(gem_name = nil) click to toggle source

    # File lib/bundler/cli.rb, line 195
    def show(gem_name = nil)
      require 'bundler/cli/show'
      Show.new(options, gem_name).run
    end

update(*gems) click to toggle source

    # File lib/bundler/cli.rb, line 181
    def update(*gems)
      require 'bundler/cli/update'
      Update.new(options, gems).run
    end

version() click to toggle source

    # File lib/bundler/cli.rb, line 307
    def version
      Bundler.ui.info "Bundler version #{Bundler::VERSION}"
    end

viz() click to toggle source

    # File lib/bundler/cli.rb, line 337
    def viz
      require 'bundler/cli/viz'
      Viz.new(options).run
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.