File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
modules/swagger-codegen/src/main/resources/ruby
samples/client/petstore/ruby/lib/petstore Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ module {{moduleName}}
160
160
# @see Configuration#temp_folder_path
161
161
# @return [File] the file downloaded
162
162
def download_file(response)
163
- tmp_file = Tempfile.new '', @ temp_folder_path
163
+ tmp_file = Tempfile.new '', Configuration. temp_folder_path
164
164
content_disposition = response.headers['Content-Disposition']
165
165
if content_disposition
166
166
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
@@ -172,7 +172,8 @@ module {{moduleName}}
172
172
tmp_file.close!
173
173
174
174
File.open(path, 'w') { |file| file.write(response.body) }
175
- logger.info "File written to #{ path} . Please move the file to a proper folder for further processing and delete the temp afterwards"
175
+ Configuration.logger.info "File written to #{ path} . Please move the file to a proper "\
176
+ "folder for further processing and delete the temp afterwards"
176
177
File.new(path)
177
178
end
178
179
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ def convert_to_type(data, return_type)
160
160
# @see Configuration#temp_folder_path
161
161
# @return [File] the file downloaded
162
162
def download_file ( response )
163
- tmp_file = Tempfile . new '' , @ temp_folder_path
163
+ tmp_file = Tempfile . new '' , Configuration . temp_folder_path
164
164
content_disposition = response . headers [ 'Content-Disposition' ]
165
165
if content_disposition
166
166
filename = content_disposition [ /filename=['"]?([^'"\s ]+)['"]?/ , 1 ]
@@ -172,7 +172,8 @@ def download_file(response)
172
172
tmp_file . close!
173
173
174
174
File . open ( path , 'w' ) { |file | file . write ( response . body ) }
175
- logger . info "File written to #{ path } . Please move the file to a proper folder for further processing and delete the temp afterwards"
175
+ Configuration . logger . info "File written to #{ path } . Please move the file to a proper " \
176
+ "folder for further processing and delete the temp afterwards"
176
177
File . new ( path )
177
178
end
178
179
You can’t perform that action at this time.
0 commit comments