#!/bin/bash function fail() { echo Something went wrong. Exiting. exit } echo Checking if you have wget which -s wget || fail echo Checking if you have unzip which -s unzip || fail mkdir -p public/css mkdir -p public/js mkdir -p public/img mkdir -p views # Skeleton app files echo Downloading app stub wget -q https://gist.github.com/raw/4052398/app.rb || fail echo Downloading layout.erb wget -q -P views https://gist.github.com/raw/4052398/layout.erb || fail echo Downloading main.erb wget -q -P views https://gist.github.com/raw/4052398/main.erb || fail # Download jQuery and Twitter Bootstrap echo Downloading jQuery wget -q -P public/js https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js || fail echo Downloading Bootstrap wget -q http://twitter.github.com/bootstrap/assets/bootstrap.zip || fail unzip -q bootstrap.zip mv bootstrap/css/* public/css/ mv bootstrap/js/* public/js/ mv bootstrap/img/* public/img/ # clean up echo Cleaning up rm bootstrap.zip rm -rf bootstrap echo Done! echo echo You can run your app with echo echo ruby -rubygems app.rb echo