Skip to content

Migrate to Faraday 2.x#7

Merged
kou merged 1 commit intoclear-code:masterfrom
Watson1978:faraday-2
Mar 9, 2026
Merged

Migrate to Faraday 2.x#7
kou merged 1 commit intoclear-code:masterfrom
Watson1978:faraday-2

Conversation

@Watson1978
Copy link
Copy Markdown
Contributor

@Watson1978 Watson1978 commented Mar 9, 2026

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 #6

@kou kou merged commit a5bb2df into clear-code:master Mar 9, 2026
@Watson1978 Watson1978 deleted the faraday-2 branch March 9, 2026 02:46
@Watson1978
Copy link
Copy Markdown
Contributor Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants