Class: Isomorfeus::Console

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

Instance Method Summary collapse

Constructor Details

#initializeConsole

Returns a new instance of Console.



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/isomorfeus/console.rb', line 9

def initialize
  config_ru = File.read('config.ru')
  config_ru.each_line do |line|
    if line.start_with?('require_relative')
      file = line[17..-1].rstrip.tr('"','').tr("'",'')
      file = file + '.rb' unless file.end_with?('.rb')
      require File.join(Dir.pwd, file)
    end
  end
  Isomorfeus.zeitwerk.enable_reloading
  Isomorfeus.zeitwerk.setup
  Isomorfeus.zeitwerk.eager_load
end

Instance Method Details

#runObject



23
24
25
26
# File 'lib/isomorfeus/console.rb', line 23

def run
  $ARGV.shift
  IRB.start(Isomorfeus.root)
end