lib/setsuzoku/service/web_service/api_strategy.rb in setsuzoku-0.12.58 vs lib/setsuzoku/service/web_service/api_strategy.rb in setsuzoku-0.12.59
- old
+ new
@@ -84,9 +84,19 @@
JSON.parse(response.body).deep_symbolize_keys
when :xml
convert_xml_to_hash(response.body)
when :html
response.body
+ when :txt, :png, :jpg, :gif
+ # for now just return the file
+ response.body
+ # for now just put in tmp
+ # tmp_dir = "#{Dir.tmpdir}/setsuzoku/#{self.plugin.class.system_name.underscore}/#{self.plugin.name.underscore}"
+ # file_name = "#{self.plugin.class.system_name.underscore}_#{self.plugin.name.underscore}_#{Time.now.strftime("%Y_%m_%d_%T")}"
+ # t = Tempfile.new([file_name, ".#{options[:response_type]}"], encoding: 'ascii-8bit')
+ # t.write(response.body)
+ # t.rewind
+ # t
else
JSON.parse(response.body).deep_symbolize_keys
end
end
\ No newline at end of file