Created
November 11, 2013 13:55
-
-
Save nicholalexander/7413525 to your computer and use it in GitHub Desktop.
a script to build the sinatra skeleton and minimal config of files. missing sinatra reloader and ability to set path. chmod 755 to make executable - and also i think it has to be in the path where you're building, i don't know how it would work to make it part of your bin folder.
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/sh | |
mkdir app | |
cd app | |
mkdir public | |
mkdir views | |
touch server.rb | |
echo "require 'pry' \n require 'sinatra' \n \n get '/' do \n erb :index \n end \n" >> server.rb | |
cd public | |
touch app.js | |
echo "window.onload = function(){ \n console.log('ready to ajax'); \n } \n" >> app.js | |
cd ../views | |
touch index.erb | |
echo "<h1>Hello World</h1>" >> index.erb | |
touch layout.erb | |
echo " <!doctype html> \n <html lang='en'> \n <head> \n <meta charset='UTF-8'> \n <title>postey</title> \n <script type='text/javascript' src="app.js"></script> \n </head> \n <body> \n <%= yield %> \n </body> \n </html>" >> layout.erb | |
cd .. | |
ruby server.rb | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment