summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-30 07:23:14 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-30 07:23:14 +0000
commit8b97353bf26e29070ff53464278d4733ca47beb1 (patch)
tree59ccd1a8b0ce51824c608eebd9b1c0e4f466d875 /ext
parent4e0bb56f210c245e5208ae4ca12e8597b1ff64af (diff)
* MultiTkIp.new_* accept a block to eval under the new interpreter
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/tk/lib/multi-tk.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb
index 06d21d2..438c3c0 100644
--- a/ext/tk/lib/multi-tk.rb
+++ b/ext/tk/lib/multi-tk.rb
@@ -501,19 +501,25 @@ class << MultiTkIp
alias __new new
private :__new
- def new_master(keys={})
- __new(__getip, nil, keys)
+ def new_master(keys={}, &b)
+ ip = __new(__getip, nil, keys)
+ ip.eval_proc(&b) if b
+ ip
end
alias new new_master
- def new_slave(keys={})
- __new(__getip, false, keys)
+ def new_slave(keys={}, &b)
+ ip = __new(__getip, false, keys)
+ ip.eval_proc(&b) if b
+ ip
end
alias new_trusted_slave new_master
- def new_safe_slave(keys={})
- __new(__getip, true, keys)
+ def new_safe_slave(keys={},&b)
+ ip = __new(__getip, true, keys)
+ ip.eval_proc(&b) if b
+ ip
end
alias new_safeTk new_safe_slave
end