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

Rack dependency should be explicit or optional #14

Closed
stevehodgkiss opened this issue Apr 16, 2018 · 2 comments
Closed

Rack dependency should be explicit or optional #14

stevehodgkiss opened this issue Apr 16, 2018 · 2 comments

Comments

@stevehodgkiss
Copy link

I'd like to use this gem in a library that doesn't depend on Rack, but I get the following error when requiring dry/monitor:

LoadError: cannot load such file -- rack/utils
  /Users/steve/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/dry-monitor-0.1.2/lib/dry/monitor/rack/middleware.rb:1:in `require'
  /Users/steve/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/dry-monitor-0.1.2/lib/dry/monitor/rack/middleware.rb:1:in `<top (required)>'
  /Users/steve/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/dry-monitor-0.1.2/lib/dry/monitor.rb:3:in `require'
  /Users/steve/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/dry-monitor-0.1.2/lib/dry/monitor.rb:3:in `<top (required)>'

Should the dependency on Rack be optional? If it is then that needs taking into account when attempting to load the rack middleware. If not then rack should be added to the gemspec. I'm guessing the intention is for it to be an optional dependency. Maybe a separate gem would be better for that?

@GustavoCaso
Copy link
Member

I think having rack as an optional dependency would be a right approach. WDYT? @solnic

@solnic
Copy link
Member

solnic commented Apr 18, 2018

Don't require entire dry/monitor if you don't want to use all of its features (which include rack middleware).

@solnic solnic closed this as completed Apr 18, 2018
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

No branches or pull requests

3 participants