Class: ExceptionsBase

Inherits:
Base
  • Object
show all
Includes:
Setup::Store
Defined in:
lib/pry-byetypo/exceptions/exceptions_base.rb

Constant Summary

Constants included from Setup::Store

Setup::Store::DEFAULT_STORE_PATH, Setup::Store::SEVEN_DAYS

Instance Method Summary collapse

Methods included from Setup::Store

#staled_store?, #store, #store_path

Methods inherited from Base

call, check

Instance Method Details

#callObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/pry-byetypo/exceptions/exceptions_base.rb', line 10

def call
  if can_correct?
    logger.error("\e[1;31m#{exception}\e[0m")
    logger.info("\e[1;32mRunning: #{corrected_cmd}\e[0m")

    pry.eval(corrected_cmd)
  else
    Pry::ExceptionHandler.handle_exception(output, exception, pry)
  end
end