diff options
author | Casey Dahlin <cdahlin@redhat.com> | 2008-10-10 16:38:26 -0400 |
---|---|---|
committer | Casey Dahlin <cdahlin@redhat.com> | 2008-10-10 16:38:26 -0400 |
commit | cccfc879a4e45f3dccecd99533d6dbeb9b2a53b2 (patch) | |
tree | dcfd8e3580bf173e67844b83af381e92b022d95e /state.rb | |
parent | eab22be32d53d8a82571a48124f78c745299ae9c (diff) | |
download | upstate-cccfc879a4e45f3dccecd99533d6dbeb9b2a53b2.tar.gz upstate-cccfc879a4e45f3dccecd99533d6dbeb9b2a53b2.tar.xz upstate-cccfc879a4e45f3dccecd99533d6dbeb9b2a53b2.zip |
Better release comparison
State#release will now release all holds which match (should be rare) and
matches holds more correctly.
Diffstat (limited to 'state.rb')
-rw-r--r-- | state.rb | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -155,11 +155,12 @@ class State # Release a hold on this state. Arguments are the same as for +hold+. def release(hold, params = {}) + return if @holds.size == 0 hold = Hold::Dep.new(hold) if hold.is_a? State hold = Hold::User.new(params) if hold == :user hold = Hold::System.new(params) if hold == :system raise TypeError unless hold.is_a? Hold - @holds.delete hold + @holds.reject!{ |x| hold == x } drop if @holds.size == 0 self end |