lib/hubspot/codegen/cms/site-search/api_client.rb in hubspot-api-client-8.0.1 vs lib/hubspot/codegen/cms/site-search/api_client.rb in hubspot-api-client-9.0.0

- old
+ new

@@ -4,11 +4,11 @@ #Use these endpoints for searching content on your HubSpot hosted CMS website(s). The version of the OpenAPI document: v3 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.2.3 +OpenAPI Generator version: 4.3.1 =end require 'date' require 'json' @@ -301,14 +301,16 @@ request.on_body do |chunk| chunk.force_encoding(encoding) tempfile.write(chunk) end request.on_complete do |response| - tempfile.close if tempfile - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" + if tempfile + tempfile.close + @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + end end end # Sanitize filename by removing path. # e.g. ../../sun.gif becomes sun.gif