Class: Bundler::UI::Shell

### Home Classes Methods

### In Files

- lib/bundler/ui.rb

### Parent

Bundler::UI

### Methods

- ::new
- #ask
- #confirm
- #debug
- #debug?
- #error
- #info
- #level
- #level=
- #quiet?
- #silence
- #trace
- #warn

### 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::Definition
- Bundler::DepProxy
- Bundler::Dependency
- Bundler::Deployment
- Bundler::Deprecate
- Bundler::DeprecatedError
- Bundler::Dsl
- Bundler::EndpointSpecification
- Bundler::Env
- Bundler::Environment
- Bundler::Fetcher
- Bundler::Fetcher::CertificateFailureError
- Bundler::Fetcher::FallbackError
- Bundler::Fetcher::SSLError
- Bundler::GemHelper
- Bundler::GemHelpers
- Bundler::GemInstaller
- Bundler::GemNotFound
- Bundler::GemfileError
- 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::InvalidSpecSet
- Bundler::LazySpecification
- Bundler::LockfileError
- Bundler::LockfileParser
- Bundler::MarshalError
- Bundler::MatchPlatform
- Bundler::PathError
- Bundler::ProductionError
- Bundler::RemoteSpecification
- Bundler::Resolver
- Bundler::Resolver::SpecGroup
- Bundler::RubyDsl
- Bundler::RubyVersion
- Bundler::RubyVersionMismatch
- Bundler::RubygemsIntegration
- Bundler::RubygemsIntegration::AlmostModern
- Bundler::RubygemsIntegration::Ancient
- Bundler::RubygemsIntegration::Future
- Bundler::RubygemsIntegration::Gem
- Bundler::RubygemsIntegration::Gem::SourceIndex
- Bundler::RubygemsIntegration::Legacy
- Bundler::RubygemsIntegration::Modern
- Bundler::RubygemsIntegration::Transitional
- Bundler::Runtime
- Bundler::SecurityError
- Bundler::Settings
- Bundler::SharedHelpers
- Bundler::SimilarityDetector
- Bundler::Source
- Bundler::Source::Git
- Bundler::Source::Git::GitProxy
- Bundler::Source::Path
- Bundler::Source::Path::Installer
- Bundler::Source::Rubygems
- Bundler::SpecSet
- Bundler::SystemRubyVersion
- Bundler::UI
- Bundler::UI::RGProxy
- Bundler::UI::Shell
- Bundler::VersionConflict
- Gem
- Gem::Dependency
- Gem::Platform
- Gem::Requirement
- Gem::Specification
- Object

No matching classes.

# Bundler::UI::Shell

### Constants

LEVELS

### Attributes

shell[W]

### Public Class Methods

new(options = {}) click to toggle source

    # File lib/bundler/ui.rb, line 35
    def initialize(options = {})
      if options["no-color"] || !STDOUT.tty?
        Thor::Base.shell = Thor::Shell::Basic
      end
      @shell = Thor::Base.shell.new
      @level = ENV['DEBUG'] ? "debug" : "info"
    end

### Public Instance Methods

ask(msg) click to toggle source

    # File lib/bundler/ui.rb, line 72
    def ask(msg)
      @shell.ask(msg)
    end

confirm(msg, newline = nil) click to toggle source

    # File lib/bundler/ui.rb, line 47
    def confirm(msg, newline = nil)
      tell_me(msg, :green, newline) if level("confirm")
    end

debug(msg, newline = nil) click to toggle source

    # File lib/bundler/ui.rb, line 59
    def debug(msg, newline = nil)
      tell_me(msg, nil, newline) if level("debug")
    end

debug?() click to toggle source

    # File lib/bundler/ui.rb, line 63
    def debug?
      # needs to be false instead of nil to be newline param to other methods
      level("debug")
    end

error(msg, newline = nil) click to toggle source

    # File lib/bundler/ui.rb, line 55
    def error(msg, newline = nil)
      tell_me(msg, :red, newline) if level("error")
    end

info(msg, newline = nil) click to toggle source

    # File lib/bundler/ui.rb, line 43
    def info(msg, newline = nil)
      tell_me(msg, nil, newline) if level("info")
    end

level(name = nil) click to toggle source

    # File lib/bundler/ui.rb, line 81
    def level(name = nil)
      name ? LEVELS.index(name) <= LEVELS.index(@level) : @level
    end

level=(level) click to toggle source

    # File lib/bundler/ui.rb, line 76
    def level=(level)
      raise ArgumentError unless LEVELS.include?(level.to_s)
      @level = level
    end

quiet?() click to toggle source

    # File lib/bundler/ui.rb, line 68
    def quiet?
      LEVELS.index(@level) <= LEVELS.index("warn")
    end

silence() click to toggle source

    # File lib/bundler/ui.rb, line 94
    def silence
      old_level, @level = @level, "silent"
      yield
    ensure
      @level = old_level
    end

trace(e, newline = nil) click to toggle source

    # File lib/bundler/ui.rb, line 85
    def trace(e, newline = nil)
      msg = ["#{e.class}: #{e.message}", *e.backtrace].join("\n")
      if debug?
        tell_me(msg, nil, newline)
      elsif @trace
        STDERR.puts "#{msg}#{newline}"
      end
    end

warn(msg, newline = nil) click to toggle source

    # File lib/bundler/ui.rb, line 51
    def warn(msg, newline = nil)
      tell_me(msg, :yellow, newline) if level("warn")
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.