1#!/usr/local/bin/ruby
2#
3#   irbtk.rb - irb with Ruby/Tk
4#
5#   If you want to use 'multi-tk.rb', give option '--multi-tk'.
6#   And if you want to use 'remote-tk.rb', give option '--remote-tk'.
7#   If you want both, you don't need to give both options, because
8#   'remote-tk.rb' includes 'multi-tk.rb'.
9#   ( There is no trouble even if you give both options. )
10#
11require 'remote-tk' if ARGV.delete('--remote-tk')
12require 'multi-tk'  if ARGV.delete('--multi-tk')
13
14require "tk"
15module Tk
16  MAINLOOP = Thread.new{ mainloop }
17end
18
19require "irb"
20
21if __FILE__ == $0
22  IRB.start(__FILE__)
23else
24  # check -e option
25  if /^-e$/ =~ $0
26    IRB.start(__FILE__)
27  else
28    IRB.setup(__FILE__)
29  end
30end
31