Skip to content

Instantly share code, notes, and snippets.

@srih4ri
Created June 11, 2014 18:19
Show Gist options
  • Save srih4ri/0c2eff702d03b24edc26 to your computer and use it in GitHub Desktop.
Save srih4ri/0c2eff702d03b24edc26 to your computer and use it in GitHub Desktop.
#!/bin/env zsh
myproject=$1
mkdir -p $myproject $myproject/views $myproject/public $myproject/public/javascript $myproject/public/css $myproject/public/images
cd $myproject
touch Gemfile
echo "source 'https://rubygems.org' \n gem 'sinatra' \n gem 'haml' " > Gemfile
bundle
touch config.ru
echo "require 'rubygems'\nrequire 'bundler/setup'\nrequire 'sinatra'\nrequire 'haml'\nrequire './app'\n\nset :run, false\nset :raise_errors, true\n\nrun Sinatra::Application" > config.ru
touch app.rb
echo "set :haml, :format => :html5\n\nget '/' do\n haml :index\nend" > app.rb
touch views/index.haml
echo "\n%html\n %head\n %title $myproject\n\n %body\n %h1 Hello World\n %p Your app is up and running!" > views/index.haml
rackup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment