File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -36,21 +36,33 @@ def urlify args={}
36
36
return @root + args . map { |k , v | "#{ k } =#{ CGI ::escape ( v ) } " } . join ( '&' )
37
37
end
38
38
39
- def jruby_browse args = { }
39
+ def jruby_browse args = { } , forcetype = nil
40
+ if forcetype
41
+ args [ 'wt' ] = forcetype
42
+ end
40
43
@@desktop . browse ( Java ::java . net . URI . new ( urlify args ) )
41
44
end
42
45
43
- def browse args = { }
46
+ def browse args = { } , forcetype = nil
47
+ if forcetype
48
+ args [ 'wt' ] = forcetype
49
+ end
44
50
Launchy . open urlify ( args )
45
51
end
46
52
end
47
53
48
54
49
55
if __FILE__ == $0
56
+ unless ARGV . size > 0
57
+ puts "\n usage: ruby browse.rb jsonfile OR"
58
+ puts " ruby browse.rb jsonfile [json|csv|standard|xml]"
59
+ exit
60
+ end
50
61
require 'json'
51
62
b = Browse . new ( 'http://localhost:8983/solr/select/?' )
52
63
args = eval ( File . open ( ARGV [ 0 ] ) . read )
53
- b . browse args
64
+ ARGV [ 1 ] = 'standard' if ARGV [ 1 ] == 'xml'
65
+ b . browse args , ARGV [ 1 ]
54
66
end
55
67
56
68
You can’t perform that action at this time.
0 commit comments