Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

first commit

  • Loading branch information...
commit 08f1b7ca0c6caa437f5f4aaf901e88317d5ee2ff 0 parents
@caspyin authored
0  .gitignore
No changes.
5 Gemfile
@@ -0,0 +1,5 @@
+gem 'sinatra'
+gem 'haml'
+
+# Uncomment the gems you want to use for your project
+# gem 'data_mapper'
15 Gemfile.lock
@@ -0,0 +1,15 @@
+GEM
+ specs:
+ haml (3.1.1)
+ rack (1.3.0)
+ sinatra (1.2.6)
+ rack (~> 1.1)
+ tilt (>= 1.2.2, < 2.0)
+ tilt (1.3.2)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ haml
+ sinatra
1  README.md
@@ -0,0 +1 @@
+TODO: Add description to README
19 Rakefile
@@ -0,0 +1,19 @@
+# Creates an archive of the repository so you can start a new
+# un-versioned project. Run by specifying a "path" argument
+#
+# rake archive path="/path/to/new_app"
+#
+namespace :ss do
+ desc 'Usage: `rake ss:archive path="/path/to/new_app"` - Archives repo into specified directory and does some cleanup'
+ task :archive do
+ path = ENV['path']
+ Dir.mkdir("#{path}") unless File.exists?("#{path}")
+
+ # archive
+ puts "Archiving repo to #{path}"
+ %x[git archive master | tar -x -C #{path}]
+
+ # cleanup
+ File.open("#{path}/README.md", 'w') {|f| f.write('TODO: Add description to README') }
+ end
+end
19 app.rb
@@ -0,0 +1,19 @@
+require 'sinatra'
+
+get '/' do
+ @time = Time.now
+ haml :index
+ # or if you want to use erb templates
+ # erb :index
+end
+
+# To use inline templates uncomment and put code in the templates
+# (@@template) below
+
+# __END__
+#
+# @@layout
+# <!-- add template code here -->
+#
+# @@index
+# <!-- add template code here -->
11 config.ru
@@ -0,0 +1,11 @@
+require 'bundler'
+
+Bundler.require
+
+require 'app.rb'
+
+# set variables here like :environment, :run, :root, or :views
+# see http://www.sinatrarb.com/intro#Available%20Settings for
+# more variables
+
+run Sinatra::Application
0  config/.gitignore
No changes.
0  lib/.gitignore
No changes.
0  public/images/.gitignore
No changes.
0  public/javascripts/.gitignore
No changes.
48 public/stylesheets/reset.css
@@ -0,0 +1,48 @@
+/* http://meyerweb.com/eric/tools/css/reset/
+ v2.0 | 20110126
+ License: none (public domain)
+*/
+
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed,
+figure, figcaption, footer, header, hgroup,
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline;
+}
+/* HTML5 display-role reset for older browsers */
+article, aside, details, figcaption, figure,
+footer, header, hgroup, menu, nav, section {
+ display: block;
+}
+body {
+ line-height: 1;
+}
+ol, ul {
+ list-style: none;
+}
+blockquote, q {
+ quotes: none;
+}
+blockquote:before, blockquote:after,
+q:before, q:after {
+ content: '';
+ content: none;
+}
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
0  test/.gitignore
No changes.
35 views/index.erb
@@ -0,0 +1,35 @@
+<div class="wrapper">
+ <header>
+ <h1>Sinatra Starter App</h1>
+ </header>
+
+ <aside id="dynamic">
+ <pre class="prettyprint">@time.strftime("%Y-%m-%d %I:%M%p") #=> <%= @time.strftime("%Y-%m-%d %I:%M%p") %></pre>
+ </aside>
+
+ <section>
+ <h2>Great job!</h2>
+ <p>You've got the Sinatra App template up and running.
+ Here's a list of things you can do next to get this app off the ground:
+ <ul>
+ <li>Overwrite <span class="code">index.erb</span> and <span class="code">layout.erb</span> with your own content</li>
+ <li>Rename the <span class="code">app/</span> folder and <span class="code">app.rb</span> file to something more descriptive of your app</li>
+ <li>Delete this content by removing the <span class="code">public/blankslate/</span> folder</li>
+ <li>Start defining your url structure</li>
+ </ul>
+ </p>
+ </section>
+
+ <footer>
+ <ul>
+ <li><a href="http://www.sinatrarb.com/">Sinatra</a></li>
+ <li><a href="http://sinatra-book.gittr.com/">The Sinatra Book</a></li>
+ <li><a href="https://github.com/rack/rack-contrib">Middlewares</a></li>
+ </ul>
+ </footer>
+</div>
+
+<aside id="disclaimer">
+ <p>Background image discovered at<a href="http://mihaioprea.wordpress.com/2007/11/12/blogscorpions/">http://mihaioprea.wordpress.com</a>(I haven't asked for permission yet :-$)</p>
+ <p>Copyright © <%= @time.strftime("%Y") %></p>
+</aside>
45 views/index.haml
@@ -0,0 +1,45 @@
+.wrapper
+ %header
+ %h1 Sinatra Starter App
+ %aside#dynamic
+ %pre.prettyprint
+ @time.strftime("%Y-%m-%d %I:%M%p") #=> #{@time.strftime("%Y-%m-%d %I:%M%p")}
+ %section
+ %h2 Great job!
+ %p
+ You've got the Sinatra App template up and running.
+ Here's a list of things you can do next to get this app off the ground:
+ %ul
+ %li
+ Delete this blank slate content by removing the folder
+ %span.code public/blankslate/
+ %li
+ Overwrite
+ %span.code index.haml
+ and
+ %span.code layout.haml
+ with your own content
+ %li
+ Rename the
+ %span.code app/
+ folder and
+ %span.code app.rb
+ file to something more descriptive of your app
+ %li
+ Start defining your url structure by creating routes in
+ %span.code app.rb
+ %footer
+ %ul
+ %li
+ %a{:href => "http://www.sinatrarb.com/"} Sinatra
+ %li
+ %a{:href => "http://sinatra-book.gittr.com/"} The Sinatra Book
+ %li
+ %a{:href => "https://github.com/rack/rack-contrib"} Middlewares
+%aside#disclaimer
+ %p
+ Background image discovered at
+ %a{:href => "http://mihaioprea.wordpress.com/2007/11/12/blogscorpions/"}> http://mihaioprea.wordpress.com
+ (I haven't asked for permission yet :-$)
+ %p
+ Copyright © #{@time.strftime("%Y")}
13 views/layout.erb
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <title>New Sinatra App</title>
+ <link rel="stylesheet" href="/blankslate/main.css" type="text/css">
+ <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Cherry+Cream+Soda" type="text/css" >
+ <script src="/blankslate/prettify.js" type="text/javascript"></script>
+ </head>
+ <body onload="prettyPrint()">
+ <%= yield %>
+ </body>
+</html>
10 views/layout.haml
@@ -0,0 +1,10 @@
+!!!
+%html{:lang => "en"}
+ %head
+ %meta{:charset => "utf-8"}/
+ %title New Sinatra App
+ %link{:href => "/blankslate/main.css", :rel => "stylesheet", :type => "text/css"}
+ %link{:href => "http://fonts.googleapis.com/css?family=Cherry+Cream+Soda", :rel => "stylesheet", :type => "text/css"}
+ %script{:src => "/blankslate/prettify.js", :type => "text/javascript"}
+ %body{:onload => "prettyPrint()"}
+ = yield
Please sign in to comment.
Something went wrong with that request. Please try again.