rack / rack-session

MIT License
33 stars 14 forks source link

Lib comaptibility w/ v1 and v2? #26

Closed pboling closed 11 months ago

pboling commented 11 months ago

When I use a "legacy" gemfile in this project I see the following when updating the bundle:

Using rack 2.2.8 (was 3.0.8)
Using rack-session 1.0.1 (was 2.0.0)

That is as expected.

I have this at the top of my spec_helper.rb, which is documented as the correct usage in the README.md of both the stable-v1 branch and the main branch:

require 'rack/session'

But when I run tests I get an error:

❯ BUNDLE_GEMFILE=gemfiles/legacy.gemfile bundle exec rspec spec

An error occurred while loading ./spec/lib/omniauth/strategies/jwt_spec.rb.
Failure/Error: require 'rack/session'

LoadError:
  cannot load such file -- rack/session
# ./spec/spec_helper.rb:5:in `<top (required)>'
# ./spec/lib/omniauth/strategies/jwt_spec.rb:1:in `<top (required)>'
dentarg commented 11 months ago

This is expected. See https://github.com/rack/rack-session/issues/15

pboling commented 11 months ago

If that's the case (and it is, see also) then the README is misleading. It claims to be compatible, yet the instruction in the readme, require "rack/session" only works for one of those versions. It doesn't work with v1.

Ideally v1 could ship with a dummy NO-OP file there so we can use the same code in libraries targetting compatibility with both versions.

ioquatix commented 11 months ago

Released in v1.0.2.