/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. require "irb/cmd/nop.rb"
  13. require "irb/ext/workspaces.rb"
  14. module IRB
  15. module ExtendCommand
  16. class Workspaces<Nop
  17. def execute(*obj)
  18. irb_context.workspaces.collect{|ws| ws.main}
  19. end
  20. end
  21. class PushWorkspace<Workspaces
  22. def execute(*obj)
  23. irb_context.push_workspace(*obj)
  24. super
  25. end
  26. end
  27. class PopWorkspace<Workspaces
  28. def execute(*obj)
  29. irb_context.pop_workspace(*obj)
  30. super
  31. end
  32. end
  33. end
  34. end