PageRenderTime 91ms CodeModel.GetById 85ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/Ruby/lib/ruby/1.8/irb/cmd/pushws.rb

http://github.com/agross/netopenspace
Ruby | 39 lines | 23 code | 5 blank | 11 comment | 0 complexity | 8aade9489a7574c6d7fcbe8feddb0798 MD5 | raw file
 1#
 2#   change-ws.rb - 
 3#   	$Release Version: 0.9.5$
 4#   	$Revision: 11708 $
 5#   	$Date: 2007-02-13 08:01:19 +0900 (Tue, 13 Feb 2007) $
 6#   	by Keiju ISHITSUKA(keiju@ruby-lang.org)
 7#
 8# --
 9#
10#   
11#
12
13require "irb/cmd/nop.rb"
14require "irb/ext/workspaces.rb"
15
16module IRB
17  module ExtendCommand
18    class Workspaces<Nop
19      def execute(*obj)
20	irb_context.workspaces.collect{|ws| ws.main}
21      end
22    end
23
24    class PushWorkspace<Workspaces
25      def execute(*obj)
26	irb_context.push_workspace(*obj)
27	super
28      end
29    end
30
31    class PopWorkspace<Workspaces
32      def execute(*obj)
33	irb_context.pop_workspace(*obj)
34	super
35      end
36    end
37  end
38end
39