Skip to content

Commit d0140c8

Browse files
committed
Allow a single file to hold multiple queries
1 parent efe8477 commit d0140c8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ruby/browse.rb

+5-3
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ def browse args={}, forcetype = nil
5555
if __FILE__ == $0
5656
unless ARGV.size > 0
5757
puts "\nusage: ruby browse.rb jsonfile OR"
58-
puts " ruby browse.rb jsonfile [json|csv|standard|xml]"
58+
puts " ruby browse.rb jsonfile [json|csv|standard|xml] OR"
5959
exit
6060
end
61-
require 'json'
6261
b = Browse.new('http://localhost:8983/solr/select/?')
6362
args = eval(File.open(ARGV[0]).read)
6463
ARGV[1] = 'standard' if ARGV[1] == 'xml'
65-
b.browse args, ARGV[1]
64+
unless args.kind_of? Array
65+
args = [args]
66+
end
67+
args.each {|a| b.browse a, ARGV[1]}
6668
end
6769

6870

0 commit comments

Comments
 (0)