savonrb / httpi

Common interface for Ruby's HTTP clients
http://httpirb.com
MIT License
300 stars 150 forks source link

Optional dependency rack used internally #229

Closed tbolender closed 2 years ago

tbolender commented 2 years ago

Thanks for your work on this gem! We notice the following error on all non-Rails usages after the update to version 3.0.0:

/app/vendor/bundle/ruby/2.7.0/gems/httpi-3.0.0/lib/httpi/request.rb:4:in `require': cannot load such file -- rack/utils (LoadError)
    from /app/vendor/bundle/ruby/2.7.0/gems/httpi-3.0.0/lib/httpi/request.rb:4:in `<top (required)>'
    from /app/vendor/bundle/ruby/2.7.0/gems/httpi-3.0.0/lib/httpi.rb:4:in `require'
    from /app/vendor/bundle/ruby/2.7.0/gems/httpi-3.0.0/lib/httpi.rb:4:in `<top (required)>'

I noticed that you made rack an optional dependency, but seem to treat it internally as mandatory. I would be glad to have the reference either removed or as an actual dependency set (that it seems to be?).

olleolleolle commented 2 years ago

Yeah, the smoothest way would probably be to upgrade it to be a... real runtime dependency: https://github.com/savonrb/httpi/search?q=Utils

HeaderHash class and something about building URLs.

olleolleolle commented 2 years ago

@tbolender Would you like to offer a PR adding rack as a runtime dependency in the gemspec?

tbolender commented 2 years ago

Here you go. Would be nice to have that as soon as possible out there :)