Skip to content

Commit ce0fdf8

Browse files
authored
Remove deprecated Faraday::UploadIO (#1307)
1 parent da878ea commit ce0fdf8

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

UPGRADING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Faraday::Middleware.register_middleware(name: klass)
5050

5151
* Rename `Faraday::Request#method` to `#http_method`.
5252
* Remove `Faraday::Response::Middleware`. You can now use the new `on_complete` callback provided by `Faraday::Middleware`.
53+
* Drop `Faraday::UploadIO` in favour of `Faraday::FilePart`.
5354

5455
## Faraday 1.0
5556

lib/faraday/file_part.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@ module Faraday
5252
# @return [IO]
5353
FilePart = ::UploadIO
5454

55-
# Multipart value used to POST a file.
56-
#
57-
# @deprecated Use FilePart instead of this class. It behaves identically, with
58-
# a matching name to ParamPart.
59-
UploadIO = ::UploadIO
60-
6155
Parts = ::Parts
6256

6357
# Similar to, but not compatible with CompositeReadIO provided by the

spec/faraday/request/multipart_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
{
158158
a: 1,
159159
b: {
160-
c: Faraday::UploadIO.new(__FILE__, 'text/x-ruby', nil,
160+
c: Faraday::FilePart.new(__FILE__, 'text/x-ruby', nil,
161161
'Content-Disposition' => 'form-data; foo=1'),
162162
d: 2
163163
}
@@ -207,7 +207,7 @@
207207
let(:payload) do
208208
{
209209
json: Faraday::ParamPart.new(json, 'application/json'),
210-
io: Faraday::UploadIO.new(io, 'application/pdf')
210+
io: Faraday::FilePart.new(io, 'application/pdf')
211211
}
212212
end
213213

@@ -239,7 +239,7 @@
239239
{
240240
a: 1,
241241
b: [{
242-
c: Faraday::UploadIO.new(__FILE__, 'text/x-ruby'),
242+
c: Faraday::FilePart.new(__FILE__, 'text/x-ruby'),
243243
d: 2
244244
}]
245245
}
@@ -284,8 +284,8 @@
284284
{
285285
a: 1,
286286
b: [
287-
Faraday::UploadIO.new(io, 'application/pdf'),
288-
Faraday::UploadIO.new(io, 'application/pdf')
287+
Faraday::FilePart.new(io, 'application/pdf'),
288+
Faraday::FilePart.new(io, 'application/pdf')
289289
]
290290
}
291291
end

spec/faraday/request/retry_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169

170170
it 'UploadIO: should rewind files on retry' do
171171
io = StringIO.new('Test data')
172-
upload_io = Faraday::UploadIO.new(io, 'application/octet/stream')
172+
upload_io = Faraday::FilePart.new(io, 'application/octet/stream')
173173

174174
rewound = 0
175175
rewind = -> { rewound += 1 }

0 commit comments

Comments
 (0)