Commit a5bb2df
authored
Migrate to Faraday 2.x (#7)
This PR upgrades the faraday dependency from 1.x to 2.x and resolves
several breaking changes.
Currently, this library is running the test suite fails with a
`NameError` because the older `typhoeus` gem attempts to modify
Faraday's internal adapter classes using a legacy structure that is no
longer compatible with Faraday 2.x.
```
$ bundle exec rake test
/home/watson/.rbenv/versions/3.4.8/bin/ruby -w -I"lib:test" /home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/rake_test_loader.rb "test/test_client.rb"
/home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/typhoeus-1.1.2/lib/typhoeus/adapters/faraday.rb:28:in 'Module#remove_method': method 'call' not defined in Faraday::Adapter::Typhoeus (NameError)
remove_method :call if method_defined? :call
^^^^^^^^^^^^^
from /home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/typhoeus-1.1.2/lib/typhoeus/adapters/faraday.rb:28:in '<class:Typhoeus>'
from /home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/typhoeus-1.1.2/lib/typhoeus/adapters/faraday.rb:21:in '<class:Adapter>'
from /home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/typhoeus-1.1.2/lib/typhoeus/adapters/faraday.rb:4:in '<module:Faraday>'
from /home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/typhoeus-1.1.2/lib/typhoeus/adapters/faraday.rb:3:in '<top (required)>'
from /home/watson/.rbenv/versions/3.4.8/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
from /home/watson/.rbenv/versions/3.4.8/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
from /home/watson/src/ruby-zulip-client/lib/zulip/client.rb:5:in '<top (required)>'
from /home/watson/.rbenv/versions/3.4.8/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
from /home/watson/.rbenv/versions/3.4.8/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
from /home/watson/src/ruby-zulip-client/test/helper.rb:4:in '<top (required)>'
from /home/watson/.rbenv/versions/3.4.8/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
from /home/watson/.rbenv/versions/3.4.8/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
from /home/watson/src/ruby-zulip-client/test/test_client.rb:1:in '<top (required)>'
from /home/watson/.rbenv/versions/3.4.8/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
from /home/watson/.rbenv/versions/3.4.8/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
from /home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/rake_test_loader.rb:21:in 'block in <main>'
from /home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/rake_test_loader.rb:6:in 'Array#select'
from /home/watson/.rbenv/versions/3.4.8/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/rake_test_loader.rb:6:in '<main>'
rake aborted!
```
This PR will migrate to 2.x to resolve the above error.
Fix #61 parent 94d21db commit a5bb2df
2 files changed
+7
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | | - | |
| 20 | + | |
22 | 21 | | |
23 | 22 | | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
0 commit comments