class Pry::Command::Wtf - pry-0.10.1 Documentation

# class Pry::Command::Wtf

### Public Instance Methods

options(opt) click to toggle source

    # File lib/pry/commands/wtf.rb, line 22
    def options(opt)
      opt.on :v, :verbose, "Show the full backtrace"
    end

process() click to toggle source

    # File lib/pry/commands/wtf.rb, line 26
    def process
      raise Pry::CommandError, "No most-recent exception" unless exception

      output.puts "#{text.bold('Exception:')} #{exception.class}: #{exception}\n--"
      if opts.verbose?
        output.puts with_line_numbers(backtrace)
      else
        output.puts with_line_numbers(backtrace.first(size_of_backtrace))
      end
    end