Class: AppInfo::Shell

Inherits:
Object show all
Defined in:
lib/app_info/shell.rb

Constant Summary collapse

PREFIX =
"app-info (#{AppInfo::VERSION})"
PROMPT =
{
  PROMPT_I: "#{PREFIX}> ",
  PROMPT_S: "#{PREFIX}> ",
  PROMPT_C: "#{PREFIX}> ",
  PROMPT_N: "#{PREFIX}> ",
  RETURN: "=> %s\n"
}.freeze

Class Method Summary collapse

Class Method Details

.runObject



18
19
20
21
22
23
# File 'lib/app_info/shell.rb', line 18

def run
  setup

  irb = IRB::Irb.new
  irb.run
end

.setupObject



25
26
27
28
29
30
31
# File 'lib/app_info/shell.rb', line 25

def setup
  IRB.setup nil

  IRB.conf[:PROMPT][:APPINFO] = PROMPT
  IRB.conf[:PROMPT_MODE] = :APPINFO
  IRB.conf[:AUTO_INDENT] = true
end