From cbb7f144560c05073914c77e26c8c5fdb8d8c990 Mon Sep 17 00:00:00 2001 From: Casey Dahlin Date: Mon, 15 Dec 2008 11:52:49 -0500 Subject: Add or groups to hold provides You can now specify hold provisions which read "One of (a,b,c)" --- state.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/state.rb b/state.rb index a15f6b8..94fca64 100644 --- a/state.rb +++ b/state.rb @@ -152,6 +152,17 @@ class State @holds = Set.new [hold] @hold_params = {} self.class.hold_provides.each do |x| + if x.is_a? Array + worked = false + x.each do |y| + hold.params[y] or next + @hold_params[y] = hold.params[y] + worked = true + end + worked or raise AmbiguousRequest, "None of #{x.join(', ')} defined" + next + end + hold.params[x] or raise AmbiguousRequest, "#{x} undefined" @hold_params[x] = hold.params[x] end -- cgit