Skip to content

Commit a66feb5

Browse files
authored
Merge pull request #2940 from sul-dlss/faraday
Upgrade to faraday 2
2 parents d706297 + 2b08f67 commit a66feb5

3 files changed

Lines changed: 26 additions & 41 deletions

File tree

Gemfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ gem 'config'
4646
gem 'dry-monads'
4747
gem 'equivalent-xml', '>= 0.6.0' # For ignoring_attr_values() with arguments
4848
gem 'faraday'
49+
gem 'faraday-multipart'
4950
gem 'honeybadger', '~> 4.1'
5051
gem 'lograge'
5152
gem 'sidekiq', '~> 6.0'
@@ -71,12 +72,12 @@ gem 'openapi_parser', '< 1.0'
7172
# Stanford related gems
7273
gem 'blacklight', '~> 7.20'
7374
gem 'blacklight-hierarchy', '~> 5.1'
74-
gem 'dor-services-client', '~> 7.10'
75-
gem 'dor-workflow-client', '~> 3.19'
75+
gem 'dor-services-client', '~> 8.0'
76+
gem 'dor-workflow-client', '~> 4.0'
7677
gem 'druid-tools'
7778
gem 'mods_display', '~> 1.0.0.alpha1'
7879
gem 'okcomputer' # monitors application and its dependencies
79-
gem 'preservation-client', '~> 3.2'
80+
gem 'preservation-client', '~> 4.0'
8081
gem 'rsolr'
8182
gem 'sdr-client', '~> 0.60'
8283

Gemfile.lock

Lines changed: 20 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ GEM
7676
parser (>= 2.4)
7777
smart_properties
7878
bindex (0.8.1)
79-
blacklight (7.22.2)
79+
blacklight (7.23.0.1)
8080
deprecation
8181
globalid
8282
i18n (>= 1.7.0)
8383
jbuilder (~> 2.7)
8484
kaminari (>= 0.15)
8585
ostruct (>= 0.3.2)
86-
rails (>= 5.1, < 7)
87-
view_component (~> 2.42)
86+
rails (>= 5.1, < 7.1)
87+
view_component (~> 2.43)
8888
blacklight-hierarchy (5.4.0)
8989
blacklight (~> 7.18)
9090
deprecation
@@ -168,17 +168,18 @@ GEM
168168
capistrano-one_time_key
169169
capistrano-shared_configs
170170
docile (1.4.0)
171-
dor-services-client (7.12.0)
171+
dor-services-client (8.0.0)
172172
activesupport (>= 4.2, < 8)
173173
cocina-models (~> 0.66.0)
174174
deprecation
175-
faraday (>= 0.15, < 2)
175+
faraday (~> 2.0)
176+
faraday-retry
176177
zeitwerk (~> 2.1)
177-
dor-workflow-client (3.24.0)
178+
dor-workflow-client (4.0.0)
178179
activesupport (>= 3.2.1, < 8)
179180
deprecation (>= 0.99.0)
180-
faraday (>= 0.9.2, < 2.0)
181-
faraday_middleware
181+
faraday (~> 2.0)
182+
faraday-retry
182183
nokogiri (~> 1.6)
183184
zeitwerk (~> 2.1)
184185
druid-tools (2.1.0)
@@ -240,31 +241,13 @@ GEM
240241
factory_bot_rails (6.2.0)
241242
factory_bot (~> 6.2.0)
242243
railties (>= 5.0.0)
243-
faraday (1.10.0)
244-
faraday-em_http (~> 1.0)
245-
faraday-em_synchrony (~> 1.0)
246-
faraday-excon (~> 1.1)
247-
faraday-httpclient (~> 1.0)
248-
faraday-multipart (~> 1.0)
249-
faraday-net_http (~> 1.0)
250-
faraday-net_http_persistent (~> 1.0)
251-
faraday-patron (~> 1.0)
252-
faraday-rack (~> 1.0)
253-
faraday-retry (~> 1.0)
244+
faraday (2.2.0)
245+
faraday-net_http (~> 2.0)
254246
ruby2_keywords (>= 0.0.4)
255-
faraday-em_http (1.0.0)
256-
faraday-em_synchrony (1.0.0)
257-
faraday-excon (1.1.0)
258-
faraday-httpclient (1.0.1)
259247
faraday-multipart (1.0.3)
260248
multipart-post (>= 1.2, < 3)
261-
faraday-net_http (1.0.1)
262-
faraday-net_http_persistent (1.2.0)
263-
faraday-patron (1.0.0)
264-
faraday-rack (1.0.0)
249+
faraday-net_http (2.0.1)
265250
faraday-retry (1.0.3)
266-
faraday_middleware (1.2.0)
267-
faraday (~> 1.0)
268251
ffi (1.15.5)
269252
globalid (1.0.0)
270253
activesupport (>= 5.0)
@@ -313,7 +296,7 @@ GEM
313296
mini_mime (1.1.2)
314297
mini_portile2 (2.8.0)
315298
minitest (5.15.0)
316-
moab-versioning (4.4.2)
299+
moab-versioning (5.0.0)
317300
druid-tools (>= 1.0.0)
318301
json
319302
nokogiri
@@ -363,10 +346,10 @@ GEM
363346
ttfunk (~> 1.4.0)
364347
prawn-table (0.2.2)
365348
prawn (>= 1.3.0, < 3.0.0)
366-
preservation-client (3.5.0)
349+
preservation-client (4.0.0)
367350
activesupport (>= 4.2, < 8)
368-
faraday (>= 0.15, < 2.0)
369-
moab-versioning (~> 4.3)
351+
faraday (~> 2.0)
352+
moab-versioning (~> 5.0)
370353
zeitwerk (~> 2.1)
371354
pry (0.13.1)
372355
coderay (~> 1.1)
@@ -584,14 +567,15 @@ DEPENDENCIES
584567
devise
585568
devise-remote-user (~> 1.0)
586569
dlss-capistrano
587-
dor-services-client (~> 7.10)
588-
dor-workflow-client (~> 3.19)
570+
dor-services-client (~> 8.0)
571+
dor-workflow-client (~> 4.0)
589572
druid-tools
590573
dry-monads
591574
equivalent-xml (>= 0.6.0)
592575
erb_lint (~> 0.0.31)
593576
factory_bot_rails
594577
faraday
578+
faraday-multipart
595579
honeybadger (~> 4.1)
596580
http_logger
597581
jbuilder (~> 2.5)
@@ -606,7 +590,7 @@ DEPENDENCIES
606590
openapi_parser (< 1.0)
607591
prawn (~> 1)
608592
prawn-table
609-
preservation-client (~> 3.2)
593+
preservation-client (~> 4.0)
610594
pry-byebug
611595
pry-rails
612596
pry-remote

app/services/modsulator_client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ def convert_spreadsheet_to_mods
5252
# @return [String] XML, either generated from a given spreadsheet, or a normalized version of a given XML file.
5353
def call_remote_modsulator(url, content_type)
5454
response_xml = nil
55-
payload = Faraday::UploadIO.new(uploaded_filename, content_type)
55+
payload = Faraday::Multipart::FilePart.new(uploaded_filename, content_type)
5656

5757
connection = Faraday.new(url: url) do |faraday|
5858
faraday.use Faraday::Response::RaiseError
5959
faraday.request :multipart
6060
faraday.request :url_encoded
61-
faraday.adapter :net_http # A MUST for file upload to work with UploadIO
61+
faraday.adapter :net_http # A MUST for file upload to work with Faraday::Multipart::FilePart
6262
end
6363

6464
response_xml = connection.post do |req|

0 commit comments

Comments
 (0)