rack-server-pages
rack-server-pages copied to clipboard
Fix: Require tilt, if Tilt module is defined
This Fixes #14.
Testing.
- Start a project that has both
slack-ruby-clientandsidekiq-scheduleras dependencies in the GemFile - Start puma
bundle exec puma -p 4000 - Browse to
localhost:4000and 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.
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.
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 :)
Fixed CI in https://github.com/migrs/rack-server-pages/pull/17, maybe you want to pick this one up again @aberkowitz?