Permalink
Browse files

Allow a single file to hold multiple queries

  • Loading branch information...
1 parent efe8477 commit d0140c80a015f3ec0727b56888652525c5aa266c @billdueber committed Mar 19, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 ruby/browse.rb
View
@@ -55,14 +55,16 @@ def browse args={}, forcetype = nil
if __FILE__ == $0
unless ARGV.size > 0
puts "\nusage: ruby browse.rb jsonfile OR"
- puts " ruby browse.rb jsonfile [json|csv|standard|xml]"
+ puts " ruby browse.rb jsonfile [json|csv|standard|xml] OR"
exit
end
- require 'json'
b = Browse.new('http://localhost:8983/solr/select/?')
args = eval(File.open(ARGV[0]).read)
ARGV[1] = 'standard' if ARGV[1] == 'xml'
- b.browse args, ARGV[1]
+ unless args.kind_of? Array
+ args = [args]
+ end
+ args.each {|a| b.browse a, ARGV[1]}
end

0 comments on commit d0140c8

Please sign in to comment.