rack-server-pages icon indicating copy to clipboard operation
rack-server-pages copied to clipboard

Fix: Require tilt, if Tilt module is defined

Open aberkowitz opened this issue 2 years ago • 3 comments

This Fixes #14.

Testing.

  1. Start a project that has both slack-ruby-client and sidekiq-scheduler as dependencies in the GemFile
  2. Start puma bundle exec puma -p 4000
  3. Browse to localhost:4000 and verify that you do not receive an error caused by Tilt module missing methods.

Notes

There might be a cleaner way to detect whether Tilt has been loaded in the tilt? method on lib/rack/server_pages.rb:193, which would not necessitate using Tilt, unless the user has explicitly required it. My ruby wizardry is shamefully lacking, and I do not know how to do this; I'm open to suggestions.

aberkowitz avatar May 27 '23 20:05 aberkowitz

Tagging @dblock, because I encountered this situation using his library slack-ruby-bot-server, and he is probably the best person to opine on whether: this is a good solution, or there even needs to be a solution.

aberkowitz avatar May 27 '23 20:05 aberkowitz

Generally I don't think it's the job of the implementation to require.

I do think this project needs to move from Travis-CI to GHA, replacing https://github.com/migrs/rack-server-pages/blob/master/.travis.yml, before making any more changes :)

dblock avatar May 27 '23 23:05 dblock

Fixed CI in https://github.com/migrs/rack-server-pages/pull/17, maybe you want to pick this one up again @aberkowitz?

dblock avatar Jun 15 '24 13:06 dblock