commit f357999ec46b14482ec566b8ba65047812cfabaa
parent cfe271237eefdd6b5800ed39527850c74e7b87fe
Author: Rich Lane <rlane@club.cc.cmu.edu>
Date: Wed, 24 Mar 2010 23:45:04 -0700
add prefix arg to each_source_info
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/sup/index.rb b/lib/sup/index.rb
@@ -276,9 +276,10 @@ EOS
nil
end
- ## Yields (in lexicographical order) the source infos of all locations from the given source
- def each_source_info source_id, &b
- prefix = mkterm :location, source_id, ''
+ ## Yields (in lexicographical order) the source infos of all locations from
+ ## the given source with the given source_info prefix
+ def each_source_info source_id, prefix='', &b
+ prefix = mkterm :location, source_id, prefix
each_prefixed_term prefix do |x|
yield x[prefix.length..-1]
end