Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first commit

  • Loading branch information...
commit 137f2f8348c1dd8d85442e9de68d81790da08c2c 0 parents
@jasonmelgoza authored
3  .gitignore
@@ -0,0 +1,3 @@
+# As suggested in the Dev Center @ Heroku http://devcenter.heroku.com/articles/bundler
+.bundle
+.DS_Store
2  Gemfile
@@ -0,0 +1,2 @@
+source 'http://rubygems.org'
+gem 'sinatra'
17 Gemfile.lock
@@ -0,0 +1,17 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ rack (1.3.5)
+ rack-protection (1.1.4)
+ rack
+ sinatra (1.3.1)
+ rack (~> 1.3, >= 1.3.4)
+ rack-protection (~> 1.1, >= 1.1.2)
+ tilt (~> 1.3, >= 1.3.3)
+ tilt (1.3.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ sinatra
39 README.md
@@ -0,0 +1,39 @@
+#Armor
+
+A sample [Sinatra](http://www.sinatrarb.com/) application ready for deployment to [Heroku](http://heroku.com). Using Twitter's [Bootstrap](http://twitter.github.com/bootstrap/) project for style. Both projects are great for rapid prototyping.
+
+**Get Started**
+
+* Clone then cd to this repo.
+
+**Add Bootstrap**
+
+* `$ git submodule init`
+* `$ git submodule update`
+
+**Commit**
+
+* `$ git add *` (Make sure all new files are added to the repo)
+* `$ git commit -m 'first commit'`
+
+**Push to Heroku**
+
+* `$ heroku create [optional-app-name]` (You can rename your app with `heroku rename`)
+* `$ git push heroku master`
+
+[Heroku](http://devcenter.heroku.com/articles/git-submodules) currently dosen't support git submodules so the workaround is to track the submodule using the method below.
+
+<pre class="CodeRay" lang="term"><span class="c">$</span><span class="fu"> cd myapp
+</span><span class="c">$</span><span class="fu"> rm -rf `find . -mindepth 2 -name .git`
+</span><span class="c">$</span><span class="fu"> git rm --cache `git submodule | cut -f2 -d' '`
+</span><span class="c">$</span><span class="fu"> git rm .gitmodules
+</span><span class="c">$</span><span class="fu"> git add .
+</span><span class="c">$</span><span class="fu"> git config -l | grep '^submodule' | cut -d'=' -f1 | xargs -n1 git config --unset-all
+</span><span class="c">$</span><span class="fu"> git commit -m "brought submodules into the main repo"
+</span></pre>
+
+Then just build.
+
+[More info](http://devcenter.heroku.com/articles/rack) using Rack apps in Heroku.
+
+*Inspired by Blake Mizerany's [Sinatra-Heroku-App](https://github.com/bmizerany/heroku-sinatra-app).*
60 app.rb
@@ -0,0 +1,60 @@
+# $ ruby app.rb
+#
+require 'rubygems'
+require 'sinatra'
+
+configure :production do
+ # Configure stuff here you'll want to
+ # only be run at Heroku at boot
+
+ # TIP: You can get you database information
+ # from ENV['DATABASE_URI'] (see /env route below)
+end
+
+# Routes
+
+#get '/' do
+ #erb :frontpage
+#end
+
+#get '/gallery' do
+ #erb :gallery
+#end
+
+#get '/' do
+ #erb :forms
+#end
+
+#get '/blog' do
+ #erb :blog
+#end
+
+# Errors
+
+not_found do
+ erb :'404'
+end
+
+error do
+ erb :'500'
+end
+
+# Partials
+
+helpers do
+
+ def partial template
+ erb template.to_sym, :layout => false
+ end
+
+end
+
+# Test at <appname>.heroku.com
+
+# You can see all your app specific information this way.
+# IMPORTANT! This is a very bad thing to do for a production
+# application with sensitive information
+
+#get '/env' do
+# ENV.inspect
+#end
2  config.ru
@@ -0,0 +1,2 @@
+require './app.rb'
+run Sinatra::Application
1  views/404.erb
@@ -0,0 +1 @@
+404 Page not found
1  views/500.erb
@@ -0,0 +1 @@
+500 Site error
119 views/layout.erb
@@ -0,0 +1,119 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Project Title</title>
+ <meta name="description" content="">
+ <meta name="author" content="">
+
+ <!-- HTML5 shim, for IE6-8 support of HTML elements -->
+ <!--[if lt IE 9]>
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+
+ <!-- Styles -->
+ <link href="../bootstrap.css" rel="stylesheet">
+ <style type="text/css">
+ /* Override some defaults */
+ html, body {
+ background-color: #eee;
+ }
+ body {
+ padding-top: 40px; /* 40px to make the container go all the way to the bottom of the topbar */
+ }
+ .container > footer p {
+ text-align: center; /* center align it with the container */
+ }
+ .container {
+ width: 820px; /* downsize our container to make the content feel a bit tighter and more cohesive. NOTE: this removes two full columns from the grid, meaning you only go to 14 columns and not 16. */
+ }
+
+ /* The white background content wrapper */
+ .content {
+ background-color: #fff;
+ padding: 20px;
+ margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */
+ -webkit-border-radius: 0 0 6px 6px;
+ -moz-border-radius: 0 0 6px 6px;
+ border-radius: 0 0 6px 6px;
+ -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
+ -moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
+ box-shadow: 0 1px 2px rgba(0,0,0,.15);
+ }
+
+ /* Page header tweaks */
+ .page-header {
+ background-color: #f5f5f5;
+ padding: 20px 20px 10px;
+ margin: -20px -20px 20px;
+ }
+
+ /* Styles you shouldn't keep as they are for displaying this base example only */
+ .content .span10,
+ .content .span4 {
+ min-height: 500px;
+ }
+ /* Give a quick and non-cross-browser friendly divider */
+ .content .span4 {
+ margin-left: 0;
+ padding-left: 19px;
+ border-left: 1px solid #eee;
+ }
+
+ .topbar .btn {
+ border: 0;
+ }
+
+ </style>
+
+ <!-- fav and touch icons -->
+ <link rel="shortcut icon" href="images/favicon.ico">
+ <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
+ <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
+ <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
+ </head>
+
+ <body>
+
+ <div class="topbar">
+ <div class="fill">
+ <div class="container">
+ <a class="brand" href="#">Project name</a>
+ <ul class="nav">
+ <li class="active"><a href="#">Home</a></li>
+ <li><a href="#about">About</a></li>
+ <li><a href="#contact">Contact</a></li>
+ </ul>
+ <form action="" class="pull-right">
+ <input class="input-small" type="text" placeholder="Username">
+ <input class="input-small" type="password" placeholder="Password">
+ <button class="btn" type="submit">Sign in</button>
+ </form>
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+
+ <div class="content">
+ <div class="page-header">
+ <h1>Page name <small>Supporting text or tagline</small></h1>
+ </div>
+ <div class="row">
+ <div class="span10">
+ <%= yield %>
+ </div>
+ <div class="span4">
+ <h3>Secondary content</h3>
+ </div>
+ </div>
+ </div>
+
+ <footer>
+ <p>&copy; Company 2011</p>
+ </footer>
+
+ </div> <!-- /container -->
+
+ </body>
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.