From 1d2c192d35dcaa0483eebd891fddef0e972c8a59 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> Date: Thu, 24 May 2001 07:13:56 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'v1_6_4_preview3'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_6_4_preview3@1446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/irb/workspace.rb | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 lib/irb/workspace.rb (limited to 'lib/irb/workspace.rb') diff --git a/lib/irb/workspace.rb b/lib/irb/workspace.rb new file mode 100644 index 0000000000..68559a1173 --- /dev/null +++ b/lib/irb/workspace.rb @@ -0,0 +1,106 @@ +# +# irb/workspace-binding.rb - +# $Release Version: 0.7.3$ +# $Revision$ +# $Date$ +# by Keiju ISHITSUKA(keiju@ishitsuka.com) +# +# -- +# +# +# +module IRB + class WorkSpace + # create new workspace. + # set self to main if specified, otherwise inherit main + # from TOPLEVEL_BINDING. + def initialize(*main) + if IRB.conf[:SINGLE_IRB] + @binding = TOPLEVEL_BINDING + else + case IRB.conf[:CONTEXT_MODE] + when 0 # binding in proc on TOPLEVEL_BINDING + @binding = eval("proc{binding}.call", + TOPLEVEL_BINDING, + __FILE__, + __LINE__) + when 1 # binding in loaded file + require "tempfile" + f = Tempfile.open("irb-binding") + f.print <