Skip to content

Instantly share code, notes, and snippets.

@lachlanjc
Created November 28, 2014 22:36
Show Gist options
  • Save lachlanjc/b2b9d811b396f1a2ae46 to your computer and use it in GitHub Desktop.
Save lachlanjc/b2b9d811b396f1a2ae46 to your computer and use it in GitHub Desktop.
The fast way to start working on a Sinatra app.
mkdir app
cd app
touch app.rb
touch Gemfile
touch config.ru
mkdir views
mkdir public
touch views/index.erb
touch public/app.css
echo "require './app'" > config.ru
echo "run Sinatra::Aplication" >> config.ru
echo "source 'https://rubygems.org'" > Gemfile
echo "ruby '2.1.3'" >> Gemfile
echo "gem 'sinatra'" >> Gemfile
bundle install
echo "require 'sinatra'" > app.rb
echo "require 'erb'" >> app.rb
echo >> app.rb
echo "get '/' do" >> app.rb
echo " erb :index" >> app.rb
echo "end" >> app.rb
echo "<link rel='stylesheet' href='main.css' />" > views/index.erb
echo "<h1>Hello world!</h1>" >> views/index.erb
ruby app.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment