Base Sinatra app layout for use in ruby, or jruby with dependency-free JAR compilation.
Sinatra is great for quick and small web apps, and even better if you want to have users run the app on their own workstation under Java.
Use this project to get up and running quickly with:
- Basic ruby
sinatra
directory layout - Rack configuration file and puma web server
- Jar compliation with
warbler
- Twitter bootstrap 3 styling
- Simple view layout with
erb
templates
$ git clone ...... your-app-name
- Edit
.ruby-version
file with either straight ruby version or leave as jruby version if stand alone JAR compilation is required. - Edit
.ruby-gemset
with your-app-name for an isolated gemset. - Optionally, edit the ruby version and engine type in the top line of the
Gemfile
$ cd your-app-name
$ gem install bundler
$ bundle
rake run # (OS X only)
rackup (All platforms)
$ rake build
Copy the your-app-name.jar
and config.ru
files to a directory of their own
$ cd /path/you/created
$ java -jar your-app-name.jar
http://blog.evanweaver.com/2013/08/07/standalone-sinatra-jar-with-jruby/
http://stackoverflow.com/questions/5015471/using-sinatra-for-larger-projects-via-multiple-files