-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathq
More file actions
127 lines (88 loc) · 3.79 KB
/
q
File metadata and controls
127 lines (88 loc) · 3.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
= ..eexxiitt
(from ruby core)
=== IImmpplleemmeennttaattiioonn ffrroomm CCoonntteexxtt
------------------------------------------------------------------------------
exit(ret = 0)
------------------------------------------------------------------------------
Exits the current session, see IRB.irb_exit
(from ruby core)
=== IImmpplleemmeennttaattiioonn ffrroomm KKeerrnneell
------------------------------------------------------------------------------
exit(status=true)
Kernel::exit(status=true)
Process::exit(status=true)
------------------------------------------------------------------------------
Initiates the termination of the Ruby script by raising the SystemExit
exception. This exception may be caught. The optional parameter is used to
return a status code to the invoking environment. true and FALSE of
_s_t_a_t_u_s means success and failure respectively. The interpretation
of other integer values are system dependent.
begin
exit
puts "never get here"
rescue SystemExit
puts "rescued a SystemExit exception"
end
puts "after begin block"
_p_r_o_d_u_c_e_s_:
rescued a SystemExit exception
after begin block
Just prior to termination, Ruby executes any at_exit functions (see
Kernel::at_exit) and runs any object finalizers (see
ObjectSpace::define_finalizer).
at_exit { puts "at_exit function" }
ObjectSpace.define_finalizer("string", proc { puts "in finalizer" })
exit
_p_r_o_d_u_c_e_s_:
at_exit function
in finalizer
(from ruby core)
=== IImmpplleemmeennttaattiioonn ffrroomm PPrroocceessss
------------------------------------------------------------------------------
exit(status=true)
Kernel::exit(status=true)
Process::exit(status=true)
------------------------------------------------------------------------------
Initiates the termination of the Ruby script by raising the SystemExit
exception. This exception may be caught. The optional parameter is used to
return a status code to the invoking environment. true and FALSE of
_s_t_a_t_u_s means success and failure respectively. The interpretation
of other integer values are system dependent.
begin
exit
puts "never get here"
rescue SystemExit
puts "rescued a SystemExit exception"
end
puts "after begin block"
_p_r_o_d_u_c_e_s_:
rescued a SystemExit exception
after begin block
Just prior to termination, Ruby executes any at_exit functions (see
Kernel::at_exit) and runs any object finalizers (see
ObjectSpace::define_finalizer).
at_exit { puts "at_exit function" }
ObjectSpace.define_finalizer("string", proc { puts "in finalizer" })
exit
_p_r_o_d_u_c_e_s_:
at_exit function
in finalizer
(from ruby core)
=== IImmpplleemmeennttaattiioonn ffrroomm TThhrreeaadd
------------------------------------------------------------------------------
Thread.exit -> thread
------------------------------------------------------------------------------
Terminates the currently running thread and schedules another thread to be
run.
If this thread is already marked to be killed, ::exit returns the Thread.
If this is the main thread, or the last thread, exit the process.
(from ruby core)
=== IImmpplleemmeennttaattiioonn ffrroomm TThhrreeaadd
------------------------------------------------------------------------------
thr.exit -> thr or nil
thr.kill -> thr or nil
thr.terminate -> thr or nil
------------------------------------------------------------------------------
Terminates thr and schedules another thread to be run.
If this thread is already marked to be killed, #exit returns the Thread.
If this is the main thread, or the last thread, exits the process.