summaryrefslogtreecommitdiff
path: root/trunk/lib/irb/cmd/pushws.rb
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/lib/irb/cmd/pushws.rb')
-rw-r--r--trunk/lib/irb/cmd/pushws.rb38
1 files changed, 38 insertions, 0 deletions
diff --git a/trunk/lib/irb/cmd/pushws.rb b/trunk/lib/irb/cmd/pushws.rb
new file mode 100644
index 0000000000..b5b41501af
--- /dev/null
+++ b/trunk/lib/irb/cmd/pushws.rb
@@ -0,0 +1,38 @@
+#
+# change-ws.rb -
+# $Release Version: 0.9.5$
+# $Revision$
+# by Keiju ISHITSUKA(keiju@ruby-lang.org)
+#
+# --
+#
+#
+#
+
+require "irb/cmd/nop.rb"
+require "irb/ext/workspaces.rb"
+
+module IRB
+ module ExtendCommand
+ class Workspaces<Nop
+ def execute(*obj)
+ irb_context.workspaces.collect{|ws| ws.main}
+ end
+ end
+
+ class PushWorkspace<Workspaces
+ def execute(*obj)
+ irb_context.push_workspace(*obj)
+ super
+ end
+ end
+
+ class PopWorkspace<Workspaces
+ def execute(*obj)
+ irb_context.pop_workspace(*obj)
+ super
+ end
+ end
+ end
+end
+