-
-
Save halorgium/3c81334a8f98e1c4d935 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jruby 1.7.0.dev (ruby-1.8.7-p357) (2012-01-10 6886cc0) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java] | |
No default handler | |
["CLD", "EXIT", "IOT"] | |
Proc defined at #<Proc:0x10c10de0@(internal):0> | |
["HUP"] | |
Proc defined at #<Proc:0x5ae8a0cd@(internal):0> | |
["ALRM", "CONT", "EMT", "ILL", "INT", "STOP", "TTOU", "URG", "USR2", "WINCH", "XFSZ"] | |
The signal QUIT is in use by the JVM and will not work correctly on this platform | |
No default handler | |
["QUIT"] | |
Proc defined at #<Proc:0x5e95215b@(internal):0> | |
["ABRT", "BUS", "CHLD", "FPE", "INFO", "IO", "KILL", "PIPE", "PROF", "SEGV", "SYS", "TERM", "TRAP", "TSTP", "TTIN", "USR1", "VTALRM", "XCPU"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jruby 1.7.0.dev (ruby-1.9.3-p6) (2012-01-10 6886cc0) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java] | |
No default handler | |
["CLD", "EXIT", "IOT"] | |
Proc defined at #<Proc:0x5e95215b@(internal):0> | |
["CHLD", "EMT", "HUP", "ILL", "INFO", "INT", "PIPE", "STOP", "TERM", "USR1", "VTALRM", "XCPU", "XFSZ"] | |
The signal QUIT is in use by the JVM and will not work correctly on this platform | |
No default handler | |
["QUIT"] | |
Proc defined at #<Proc:0x5ae8a0cd@(internal):0> | |
["ABRT", "ALRM", "BUS", "CONT", "FPE", "IO", "KILL", "PROF", "SEGV", "TRAP", "TSTP", "TTIN", "TTOU", "URG"] | |
Proc defined at #<Proc:0x10c10de0@(internal):0> | |
["SYS", "USR2"] | |
Proc defined at #<Proc:0x749abce9@(internal):0> | |
["WINCH"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin11.0.1] | |
test.rb:4:in `trap': SIGVTALRM reserved for Thread; can't set handler (ArgumentError) | |
from test.rb:4 | |
["VTALRM"] | |
Using the default handler | |
["ALRM", "HUP", "INT", "QUIT", "TERM", "USR1", "USR2"] | |
No default handler | |
["ABRT", "BUS", "CHLD", "CLD", "CONT", "EMT", "EXIT", "FPE", "ILL", "INFO", "IO", "IOT", "KILL", "PIPE", "PROF", "SEGV", "STOP", "SYS", "TRAP", "TSTP", "TTIN", "TTOU", "URG", "WINCH", "XCPU", "XFSZ"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.1] | |
No default handler | |
["ABRT", "BUS", "CHLD", "CLD", "CONT", "EMT", "EXIT", "FPE", "ILL", "INFO", "IO", "IOT", "KILL", "PIPE", "PROF", "SEGV", "STOP", "SYS", "TRAP", "TSTP", "TTIN", "TTOU", "URG", "VTALRM", "WINCH", "XCPU", "XFSZ"] | |
Using the default handler | |
["ALRM", "HUP", "INT", "QUIT", "TERM", "USR1", "USR2"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rubinius 2.0.0dev (1.8.7 9fb8893b yyyy-mm-dd JI) [x86_64-apple-darwin11.2.0] | |
Proc defined at #<Proc:0xc@kernel/loader.rb:142> | |
["INT"] | |
Using the default handler | |
["ABRT", "ALRM", "BUS", "CHLD", "CLD", "CONT", "DANGER", "EMT", "EXIT", "FPE", "GRANT", "HUP", "ILL", "INFO", "IO", "IOT", "KILL", "LOST", "MIGRATE", "MSG", "PIPE", "POLL", "PRE", "PROF", "PWR", "QUIT", "RETRACT", "SEGV", "SOUND", "STOP", "SYS", "TERM", "TRAP", "TSTP", "TTIN", "TTOU", "URG", "USR1", "USR2", "VTALRM", "WINCH", "XCPU", "XFSZ"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rubinius 2.0.0dev (1.9.3 9fb8893b yyyy-mm-dd JI) [x86_64-apple-darwin11.2.0] | |
Using the default handler | |
["ABRT", "ALRM", "BUS", "CHLD", "CLD", "CONT", "DANGER", "EMT", "EXIT", "FPE", "GRANT", "HUP", "ILL", "INFO", "IO", "IOT", "KILL", "LOST", "MIGRATE", "MSG", "PIPE", "POLL", "PRE", "PROF", "PWR", "QUIT", "RETRACT", "SEGV", "SOUND", "STOP", "SYS", "TERM", "TRAP", "TSTP", "TTIN", "TTOU", "URG", "USR1", "USR2", "VTALRM", "WINCH", "XCPU", "XFSZ"] | |
Proc defined at ["kernel/loader.rb", 143] | |
["INT"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rbenv set-local 1.8.7-p352 | |
ruby test.rb |tee mri-1.8.7-p352 | |
rbenv set-local 1.9.2-p290 | |
ruby test.rb |tee mri-1.9.2-p290 | |
rbenv set-local rbx-2.0.0-dev | |
RBXOPT=-X18 ruby test.rb |tee rbx-2.0.0-dev-1.8 | |
RBXOPT=-X19 ruby test.rb |tee rbx-2.0.0-dev-1.9 | |
rbenv set-local jruby-1.7.0-dev | |
ruby --1.8 test.rb |tee jruby-1.7.0-dev-1.8 | |
ruby --1.9 test.rb |tee jruby-1.7.0-dev-1.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$stderr.reopen($stdout) | |
if sig = ARGV.shift | |
default = Signal.trap(sig) {} | |
case default | |
when "DEFAULT" | |
puts "Using the default handler" | |
when nil | |
puts "No default handler" | |
when Proc | |
location = if default.respond_to?(:source_location) | |
default.source_location | |
else | |
default.inspect | |
end | |
puts "Proc defined at #{location}" | |
else | |
raise "Unknown handler: #{default.inspect}" | |
end | |
exit | |
end | |
puts RUBY_DESCRIPTION | |
defaults = Hash.new do |h,k| | |
h[k] = [] | |
end | |
Signal.list.keys.map do |sig| | |
default = `ruby #{$0} #{sig}`.chomp | |
defaults[default] << sig | |
end | |
defaults.each do |type,signals| | |
puts | |
puts type | |
p signals.sort | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment