lib/portatext/command/base.rb in portatext-1.5.2 vs lib/portatext/command/base.rb in portatext-1.5.3
- old
+ new
@@ -39,10 +39,11 @@
return 'text/csv' unless @args[:file].nil?
'application/json'
end
def accept_content_type(_method)
+ return '*/*' unless @args[:accept_any_file].nil?
return 'text/csv' unless @args[:accept_file].nil?
'application/json'
end
def body(_method)
@@ -59,10 +60,12 @@
def run(method)
a_type = accept_content_type method
command_endpoint = endpoint(method)
file = @args[:accept_file]
+ file ||= @args[:accept_any_file]
@args.delete :accept_file
+ @args.delete :accept_any_file
@client.run(
command_endpoint, method, content_type(method),
a_type, body(method), file
)
end