~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to lib/irb/ext/multi-irb.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#
2
2
#   irb/multi-irb.rb - multiple irb module
3
3
#       $Release Version: 0.9.6$
4
 
#       $Revision: 27444 $
 
4
#       $Revision: 29726 $
5
5
#       by Keiju ISHITSUKA(keiju@ruby-lang.org)
6
6
#
7
7
# --
14
14
module IRB
15
15
  # job management class
16
16
  class JobManager
17
 
    @RCS_ID='-$Id: multi-irb.rb 27444 2010-04-22 12:54:18Z keiju $-'
 
17
    @RCS_ID='-$Id: multi-irb.rb 29726 2010-11-08 20:59:01Z marcandre $-'
18
18
 
19
19
    def initialize
20
20
      # @jobs = [[thread, irb],...]
29
29
    end
30
30
 
31
31
    def thread(key)
32
 
      th, irb = search(key)
 
32
      th, = search(key)
33
33
      th
34
34
    end
35
35
 
36
36
    def irb(key)
37
 
      th, irb = search(key)
 
37
      _, irb = search(key)
38
38
      irb
39
39
    end
40
40
 
62
62
 
63
63
    def kill(*keys)
64
64
      for key in keys
65
 
        th, irb = search(key)
 
65
        th, _ = search(key)
66
66
        IRB.fail IrbAlreadyDead unless th.alive?
67
67
        th.exit
68
68
      end