Skip to content

Commit

Permalink
Remove debuggery
Browse files Browse the repository at this point in the history
  • Loading branch information
ConradIrwin committed Aug 11, 2012
1 parent 2be8740 commit 272dc1e
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions lib/raise_awareness.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ class << self
self.listeners = []

def self.listen(for_block=nil, &listen_block)

puts "FOOO"
raise "no block given" unless listen_block || for_block
listeners << listen_block || for_block
start
mutex.synchronize{
listeners << listen_block || for_block
start
}

if listen_block && for_block
begin
Expand All @@ -29,8 +29,10 @@ def self.listen(for_block=nil, &listen_block)
end

def self.unlisten(listen_block)
listeners.delete listen_block
stop if listeners.empty?
mutex.synchronize{
listeners.delete listen_block
stop if listeners.empty?
}
end

def self.rescue(e, binding)
Expand Down Expand Up @@ -59,18 +61,18 @@ def raise_exception(exc)
end

def self.stop
alias raise_exception raise_with_no_awareness
class << Rubinius
alias raise_exception raise_with_no_awareness
end
end
end
elsif defined?(JRuby)
puts "HIHIIH"
$CLASSPATH << './org/pryrepl'
java_import org.pryrepl.RaiseAwarenessEventHook

module RaiseAwareness
private
def self.start
puts "START"
JRuby.runtime.add_event_hook(hook)
end

Expand All @@ -92,7 +94,6 @@ def self.hook
def pryly(&block)
raised = []

puts "listening"
RaiseAwareness.listen(block) do |exception, binding|
raised << [exception, binding.callers]
end
Expand Down

0 comments on commit 272dc1e

Please sign in to comment.