Skip to content
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

docs: Make UPGRADING examples more copyable #1363

Merged
merged 2 commits into from
Jan 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 9 additions & 6 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,18 @@ We did our best to make this transition as painless as possible for you, so here
#### That's great! What should I change in my code immediately after upgrading?

* Add the corresponding adapter gem to your Gemfile (e.g. `faraday-net_http`). Ideally, this should replace
`faraday` altogether as these gems usually have Faraday already in their dependencies.
`faraday` altogether as these gems usually have Faraday already in their dependencies. Example Gemfile line:
```ruby
gem 'faraday-net_http'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When requiring, this should be faraday/net_http

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated: Right. I peeked in the Gemfile description, of the kwarg "require:" for gem, but it doesn't fully help the user.

https://bundler.io/v2.2/man/gemfile.5.html#REQUIRE-AS

I'll improve the documentation on "what to do in the app code".

```
* If you're relying on `Faraday.default_adapter` (e.g. if you use `Faraday.get` or other verb class methods, or not
specifying an adapter in your connection initializer), then you'll now need to set it yourself. It previously
defaulted to `:net_http`, but it now requires to be explicitly set. You can do so simply by using the setter:

```ruby
# For example, to use net_http (previous default value, will now require `gem 'faraday-net_http'` in your gemfile)
Faraday.default_adapter = :net_http
```
```ruby
require 'faraday/net_http'
Faraday.default_adapter = :net_http
```

### Faraday Middleware Deprecation

Expand Down