I have a gem. It can optionally be run as a command line app myapp_cli, or as an app with a local web ui myapp_web.
When working on my app, I can run bundle exec myapp_cli for the command line UI, or
I can run bundle exec rackup for the web UI.
Now I’d like bin/myapp_web to essentially be a synonym for rackup. So when someone installs my gem, they can just run myapp_cli or myapp_web.
Is there a nice way of doing that?
I can make my myapp_web look like
Rack::Handler::WEBrick.run(
App.new,
:Port => 9000
)
but that doesn’t give me all the goodies that rackup gives me.
All I had to do was browse the source.