From 7817ba3ef0c29be88893bacfb863f48b097e031a Mon Sep 17 00:00:00 2001 From: Casey Dahlin Date: Tue, 7 Oct 2008 10:49:50 -0400 Subject: Fix some behaviors of State#check_deps State#check_deps now returns as soon as it has found a missing dep. The raised ConsistencyFault now has a message, and the self-stripping of methods that dead states perform no longer throws exceptions. --- state.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/state.rb b/state.rb index 6f232c9..ea3ace5 100644 --- a/state.rb +++ b/state.rb @@ -76,12 +76,15 @@ class State # Make sure our deps are satisfied, and remove ourselves from the list of # states if they aren't def check_deps + trace "Dep check on #{self}" @deps.each do |dep| next if dep.active - raise ConsistencyFault if self.active + raise ConsistencyFault, "Lost dep on #{dep} without notify for #{self}" if self.active + trace " Purging..." @@states.delete self - self.methods.each{ |x| undef x } + self.methods.each{ |x| undef x rescue nil } self.freeze + return end end -- cgit