Last active
August 29, 2015 14:01
-
-
Save qrohlf/150b44deecf6ec3123ed to your computer and use it in GitHub Desktop.
getting started check for webdev
This file contains hidden or 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
# app.rb | |
# this is a simple Sinatra app that will test to make sure that your | |
# system is set up for the class correctly | |
# use bundler | |
require 'rubygems' | |
require 'bundler/setup' | |
# load all of the gems in the gemfile | |
Bundler.require | |
get '/' do | |
erb :index | |
end | |
# Sneaky template stuff: http://www.sinatrarb.com/intro.html#Inline%20Templates | |
__END__ | |
@@ index | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Sinatra Hello World</title> | |
<style> | |
body { | |
text-align: center; | |
font-family: Tahoma, Geneva, sans-serif; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Hello, World!</h1> | |
<p>If you're seeing this, it means that you've got git, ruby, bundler, and sqlite working properly. Nice job!</p> | |
<p>Here is some example dynamic content: <em><%= Time.now.to_s %></em></p> | |
</body> | |
</html> |
This file contains hidden or 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
require './app' | |
run Sinatra::Application |
This file contains hidden or 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
ruby "2.1.1" | |
source 'https://rubygems.org' | |
gem 'sinatra' | |
gem 'sqlite3' | |
gem 'shotgun' |
This file contains hidden or 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
GEM | |
remote: https://rubygems.org/ | |
specs: | |
rack (1.5.2) | |
rack-protection (1.5.3) | |
rack | |
shotgun (0.9) | |
rack (>= 1.0) | |
sinatra (1.4.5) | |
rack (~> 1.4) | |
rack-protection (~> 1.4) | |
tilt (~> 1.3, >= 1.3.4) | |
sqlite3 (1.3.9) | |
tilt (1.4.1) | |
PLATFORMS | |
ruby | |
DEPENDENCIES | |
shotgun | |
sinatra | |
sqlite3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment