-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to faraday 2 #50
base: master
Are you sure you want to change the base?
Conversation
# rack 2.x requires ruby 2.2.x | ||
if RUBY_VERSION < '2.2' | ||
gem 'rack', '~> 1.6.0', group: :test | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The minimum was already set to 2.6, this is pointless, removed.
lib = File.expand_path('../lib', __FILE__) | ||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | ||
require 'cover_my_meds/version' | ||
require_relative 'lib/cover_my_meds/version' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quit messing with $LOAD_PATH.
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } | ||
spec.bindir = "exe" | ||
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } | ||
spec.require_paths = ["lib"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no executables, and lib is already the default require path. No idea why the default name was even changed.
spec.add_development_dependency "webmock", "~> 2.0" | ||
spec.add_development_dependency "rspec" | ||
spec.add_development_dependency "rspec-junklet" | ||
spec.add_development_dependency "webmock" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can forego versioning on dev dependencies unless we're really locked into a version.
spec.add_runtime_dependency "faraday", "~> 2.9.0" | ||
spec.add_runtime_dependency "faraday-follow_redirects", "~> 0.3.0" | ||
spec.add_runtime_dependency "faraday-multipart", "~> 1.0.4" | ||
spec.add_runtime_dependency "faraday-typhoeus", "~> 1.1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The extra faraday-xxx dependencies here were required because of the updated faraday gem, i.e. multipart and redirect are no longer baked into it, but require separate gems.
require 'typhoeus/adapters/faraday' | ||
require 'faraday/typhoeus' | ||
require 'faraday/multipart' | ||
require 'faraday/follow_redirects' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
Using https://github.com/lostisland/faraday/blob/main/UPGRADING.md as a guide, update this gem to use faraday 2.x.