Module: IRB

Defined in:
debrew/irb.rb

Class Method Summary collapse

Class Method Details

.start_within(binding) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'debrew/irb.rb', line 7

def self.start_within(binding)
  old_stdout_sync = $stdout.sync
  $stdout.sync = true

  unless @setup_done
    setup(nil, argv: [])
    @setup_done = true
  end

  workspace = WorkSpace.new(binding)
  irb = Irb.new(workspace)
  irb.run(conf)
ensure
  $stdout.sync = old_stdout_sync
end