-
-
Save liluo/1f443c9c33f43dacdecf86828e54b4e0 to your computer and use it in GitHub Desktop.
Revisions
-
jarmo revised this gist
Nov 8, 2012 . 2 changed files with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ trap 'INT' do if RUBY_VERSION =~ /^1\.8\./ STDERR.puts "Current thread: #{Thread.inspect}" STDERR.puts caller.join("\n \\_ ") else This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ trap 'INT' do exit Signal.list["INT"] if interrupted interrupted = true if RUBY_VERSION =~ /^1\.8\./ STDERR.puts "Current thread: #{Thread.inspect}" STDERR.puts caller.join("\n \\_ ") else -
jarmo revised this gist
Jul 14, 2012 . 1 changed file with 17 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ interrupted = false trap 'INT' do exit Signal.list["INT"] if interrupted interrupted = true if RUBY_VERSION =~ /^1.8/ STDERR.puts "Current thread: #{Thread.inspect}" STDERR.puts caller.join("\n \\_ ") else Thread.list.each do |thread| STDERR.puts "Thread-#{thread.object_id.to_s(36)}" STDERR.puts thread.backtrace.join("\n \\_ ") end end puts "Press Ctrl+C again to exit..." sleep 1 interrupted = false end -
jarmo revised this gist
Jul 14, 2012 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ trap 'INT' do if RUBY_VERSION =~ /^1.8/ STDERR.puts "Current thread: #{Thread.inspect}" STDERR.puts caller.join("\n \\_ ") else Thread.list.each do |thread| STDERR.puts "Thread-#{thread.object_id.to_s(36)}" STDERR.puts thread.backtrace.join("\n \\_ ") end end end -
jarmo revised this gist
Jul 14, 2012 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ trap 'INT' do STDERR.puts "Current thread: #{Thread.inspect}" STDERR.puts caller.join("\n \\_ ") end -
jarmo revised this gist
Jul 14, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ trap 'INT' do Thread.list.each do |thread| STDERR.puts "Thread-#{thread.object_id.to_s(36)}" STDERR.puts thread.backtrace.join("\n \\_ ") end end -
jarmo revised this gist
Jul 14, 2012 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ Thread-9jnxc looping.rb:17:in `block (2 levels) in <main>' \_ looping.rb:15:in `each' \_ looping.rb:15:in `block in <main>' \_ looping.rb:22:in `call' \_ looping.rb:22:in `condition' \_ looping.rb:26:in `looping' \_ looping.rb:31:in `<main>' -
jarmo revised this gist
Jul 14, 2012 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ trap 'INT' do Thread.list.each do |thread| puts "Thread-#{thread.object_id.to_s(36)}" puts thread.backtrace.join("\n \\_ ") end end -
jarmo created this gist
Jul 14, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ def condition true end def looping while condition # do something end end looping