Commit 8924083 1 parent e9f961e commit 8924083 Copy full SHA for 8924083
File tree 11 files changed +22
-22
lines changed
modules/openapi-generator/src/main/resources/ruby-client
ruby-faraday/lib/openapi_client
ruby-httpx/lib/openapi_client
ruby-typhoeus/lib/openapi_client
ruby-autoload/lib/petstore
ruby-faraday/lib/petstore
extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias
dynamic-servers/ruby/lib/dynamic_servers
generate-alias-as-model/ruby-client/lib/petstore
11 files changed +22
-22
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ module {{moduleName}}
64
64
# @param [String] mime MIME
65
65
# @return [Boolean] True if the MIME is application/json
66
66
def json_mime?(mime)
67
- (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
67
+ (mime == '*/*') || !(mime =~ /^ Application\/.*json(?!p)(;.*)?/i).nil?
68
68
end
69
69
70
70
# Deserialize the response to the given return type.
@@ -143,7 +143,7 @@ module {{moduleName}}
143
143
# @param [String] filename the filename to be sanitized
144
144
# @return [String] the sanitized filename
145
145
def sanitize_filename(filename)
146
- filename.gsub(/.* [\/\\]/, '')
146
+ filename.split(/ [\/\\]/).last
147
147
end
148
148
149
149
def build_request_url(path, opts = { } )
Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ def basic_auth(conn)
249
249
# @param [String] mime MIME
250
250
# @return [Boolean] True if the MIME is application/json
251
251
def json_mime? ( mime )
252
- ( mime == '*/*' ) || !( mime =~ /Application\/ .*json(?!p)(;.*)?/i ) . nil?
252
+ ( mime == '*/*' ) || !( mime =~ /^ Application\/ .*json(?!p)(;.*)?/i ) . nil?
253
253
end
254
254
255
255
# Deserialize the response to the given return type.
@@ -328,7 +328,7 @@ def convert_to_type(data, return_type)
328
328
# @param [String] filename the filename to be sanitized
329
329
# @return [String] the sanitized filename
330
330
def sanitize_filename ( filename )
331
- filename . gsub ( /.* [\/ \\ ]/, '' )
331
+ filename . split ( / [\/ \\ ]/) . last
332
332
end
333
333
334
334
def build_request_url ( path , opts = { } )
Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ def session
188
188
# @param [String] mime MIME
189
189
# @return [Boolean] True if the MIME is application/json
190
190
def json_mime? ( mime )
191
- ( mime == '*/*' ) || !( mime =~ /Application\/ .*json(?!p)(;.*)?/i ) . nil?
191
+ ( mime == '*/*' ) || !( mime =~ /^ Application\/ .*json(?!p)(;.*)?/i ) . nil?
192
192
end
193
193
194
194
# Deserialize the response to the given return type.
@@ -267,7 +267,7 @@ def convert_to_type(data, return_type)
267
267
# @param [String] filename the filename to be sanitized
268
268
# @return [String] the sanitized filename
269
269
def sanitize_filename ( filename )
270
- filename . gsub ( /.* [\/ \\ ]/, '' )
270
+ filename . split ( / [\/ \\ ]/) . last
271
271
end
272
272
273
273
def build_request_url ( path , opts = { } )
Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ def download_file(request)
212
212
# @param [String] mime MIME
213
213
# @return [Boolean] True if the MIME is application/json
214
214
def json_mime? ( mime )
215
- ( mime == '*/*' ) || !( mime =~ /Application\/ .*json(?!p)(;.*)?/i ) . nil?
215
+ ( mime == '*/*' ) || !( mime =~ /^ Application\/ .*json(?!p)(;.*)?/i ) . nil?
216
216
end
217
217
218
218
# Deserialize the response to the given return type.
@@ -291,7 +291,7 @@ def convert_to_type(data, return_type)
291
291
# @param [String] filename the filename to be sanitized
292
292
# @return [String] the sanitized filename
293
293
def sanitize_filename ( filename )
294
- filename . gsub ( /.* [\/ \\ ]/, '' )
294
+ filename . split ( / [\/ \\ ]/) . last
295
295
end
296
296
297
297
def build_request_url ( path , opts = { } )
Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ def download_file(request)
212
212
# @param [String] mime MIME
213
213
# @return [Boolean] True if the MIME is application/json
214
214
def json_mime? ( mime )
215
- ( mime == '*/*' ) || !( mime =~ /Application\/ .*json(?!p)(;.*)?/i ) . nil?
215
+ ( mime == '*/*' ) || !( mime =~ /^ Application\/ .*json(?!p)(;.*)?/i ) . nil?
216
216
end
217
217
218
218
# Deserialize the response to the given return type.
@@ -291,7 +291,7 @@ def convert_to_type(data, return_type)
291
291
# @param [String] filename the filename to be sanitized
292
292
# @return [String] the sanitized filename
293
293
def sanitize_filename ( filename )
294
- filename . gsub ( /.* [\/ \\ ]/, '' )
294
+ filename . split ( / [\/ \\ ]/) . last
295
295
end
296
296
297
297
def build_request_url ( path , opts = { } )
Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ def basic_auth(conn)
249
249
# @param [String] mime MIME
250
250
# @return [Boolean] True if the MIME is application/json
251
251
def json_mime? ( mime )
252
- ( mime == '*/*' ) || !( mime =~ /Application\/ .*json(?!p)(;.*)?/i ) . nil?
252
+ ( mime == '*/*' ) || !( mime =~ /^ Application\/ .*json(?!p)(;.*)?/i ) . nil?
253
253
end
254
254
255
255
# Deserialize the response to the given return type.
@@ -328,7 +328,7 @@ def convert_to_type(data, return_type)
328
328
# @param [String] filename the filename to be sanitized
329
329
# @return [String] the sanitized filename
330
330
def sanitize_filename ( filename )
331
- filename . gsub ( /.* [\/ \\ ]/, '' )
331
+ filename . split ( / [\/ \\ ]/) . last
332
332
end
333
333
334
334
def build_request_url ( path , opts = { } )
Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ def session
188
188
# @param [String] mime MIME
189
189
# @return [Boolean] True if the MIME is application/json
190
190
def json_mime? ( mime )
191
- ( mime == '*/*' ) || !( mime =~ /Application\/ .*json(?!p)(;.*)?/i ) . nil?
191
+ ( mime == '*/*' ) || !( mime =~ /^ Application\/ .*json(?!p)(;.*)?/i ) . nil?
192
192
end
193
193
194
194
# Deserialize the response to the given return type.
@@ -267,7 +267,7 @@ def convert_to_type(data, return_type)
267
267
# @param [String] filename the filename to be sanitized
268
268
# @return [String] the sanitized filename
269
269
def sanitize_filename ( filename )
270
- filename . gsub ( /.* [\/ \\ ]/, '' )
270
+ filename . split ( / [\/ \\ ]/) . last
271
271
end
272
272
273
273
def build_request_url ( path , opts = { } )
Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ def download_file(request)
212
212
# @param [String] mime MIME
213
213
# @return [Boolean] True if the MIME is application/json
214
214
def json_mime? ( mime )
215
- ( mime == '*/*' ) || !( mime =~ /Application\/ .*json(?!p)(;.*)?/i ) . nil?
215
+ ( mime == '*/*' ) || !( mime =~ /^ Application\/ .*json(?!p)(;.*)?/i ) . nil?
216
216
end
217
217
218
218
# Deserialize the response to the given return type.
@@ -291,7 +291,7 @@ def convert_to_type(data, return_type)
291
291
# @param [String] filename the filename to be sanitized
292
292
# @return [String] the sanitized filename
293
293
def sanitize_filename ( filename )
294
- filename . gsub ( /.* [\/ \\ ]/, '' )
294
+ filename . split ( / [\/ \\ ]/) . last
295
295
end
296
296
297
297
def build_request_url ( path , opts = { } )
Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ def download_file(request)
212
212
# @param [String] mime MIME
213
213
# @return [Boolean] True if the MIME is application/json
214
214
def json_mime? ( mime )
215
- ( mime == '*/*' ) || !( mime =~ /Application\/ .*json(?!p)(;.*)?/i ) . nil?
215
+ ( mime == '*/*' ) || !( mime =~ /^ Application\/ .*json(?!p)(;.*)?/i ) . nil?
216
216
end
217
217
218
218
# Deserialize the response to the given return type.
@@ -291,7 +291,7 @@ def convert_to_type(data, return_type)
291
291
# @param [String] filename the filename to be sanitized
292
292
# @return [String] the sanitized filename
293
293
def sanitize_filename ( filename )
294
- filename . gsub ( /.* [\/ \\ ]/, '' )
294
+ filename . split ( / [\/ \\ ]/) . last
295
295
end
296
296
297
297
def build_request_url ( path , opts = { } )
Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ def download_file(request)
211
211
# @param [String] mime MIME
212
212
# @return [Boolean] True if the MIME is application/json
213
213
def json_mime? ( mime )
214
- ( mime == '*/*' ) || !( mime =~ /Application\/ .*json(?!p)(;.*)?/i ) . nil?
214
+ ( mime == '*/*' ) || !( mime =~ /^ Application\/ .*json(?!p)(;.*)?/i ) . nil?
215
215
end
216
216
217
217
# Deserialize the response to the given return type.
@@ -290,7 +290,7 @@ def convert_to_type(data, return_type)
290
290
# @param [String] filename the filename to be sanitized
291
291
# @return [String] the sanitized filename
292
292
def sanitize_filename ( filename )
293
- filename . gsub ( /.* [\/ \\ ]/, '' )
293
+ filename . split ( / [\/ \\ ]/) . last
294
294
end
295
295
296
296
def build_request_url ( path , opts = { } )
Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ def download_file(request)
211
211
# @param [String] mime MIME
212
212
# @return [Boolean] True if the MIME is application/json
213
213
def json_mime? ( mime )
214
- ( mime == '*/*' ) || !( mime =~ /Application\/ .*json(?!p)(;.*)?/i ) . nil?
214
+ ( mime == '*/*' ) || !( mime =~ /^ Application\/ .*json(?!p)(;.*)?/i ) . nil?
215
215
end
216
216
217
217
# Deserialize the response to the given return type.
@@ -290,7 +290,7 @@ def convert_to_type(data, return_type)
290
290
# @param [String] filename the filename to be sanitized
291
291
# @return [String] the sanitized filename
292
292
def sanitize_filename ( filename )
293
- filename . gsub ( /.* [\/ \\ ]/, '' )
293
+ filename . split ( / [\/ \\ ]/) . last
294
294
end
295
295
296
296
def build_request_url ( path , opts = { } )
You can’t perform that action at this time.
0 commit comments