Created
June 11, 2014 18:19
-
-
Save srih4ri/0c2eff702d03b24edc26 to your computer and use it in GitHub Desktop.
Sintara Init based on http://blog.chrisblunt.com/lightweight-web-apps-getting-started-with-sinatra/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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