forked from alloy/interactive-macruby
-
Notifications
You must be signed in to change notification settings - Fork 1
/
application_delegate.rb
37 lines (26 loc) · 775 Bytes
/
application_delegate.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'sweet/imrb_tool'
# require 'defaults'
TOPLEVEL_OBJECT = self
class ApplicationDelegate
#include DefaultsAccess
# TODO if app not customised yet, create a new session on app load.
def newTopLevelObjectSession(sender)
# TODO refactor into a more variation-friendly place, like IRBWindowController.rc
# global var for handy access when interactive.
$tool ||= IRBTool.new
@@irb_global_inited ||= false
unless @@irb_global_inited
# load irb files.
$tool.load_all
@@irb_global_inited = true
# watch for hotloading.
begin
$tool.watch_src
rescue Exception => e
qb_report e
puts "not watching folder due to last exception."
end
end
irb(TOPLEVEL_OBJECT, TOPLEVEL_BINDING.dup)
end
end