Class: Akephalos::Console

Inherits:
Object
  • Object
show all
Defined in:
lib/akephalos/console.rb

Overview

Simple class for starting an IRB session.

Class Method Summary collapse

Class Method Details

.startObject

Start an IRB session. Tries to load irb/completion, and also loads a .irbrc file if it exists.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/akephalos/console.rb', line 15

def self.start
  require 'irb'

  begin
    require 'irb/completion'
  rescue Exception
    # No readline available, proceed anyway.
  end

  if ::File.exists? ".irbrc"
    ENV['IRBRC'] = ".irbrc"
  end

  IRB.start
end