Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Create a template of Rack application

  • Loading branch information...
commit de602f91d87a9abc152c08b87d04a8dc67c51fc6 0 parents
@kana authored
4 Gemfile
@@ -0,0 +1,4 @@
+source :rubygems
+
+gem 'haml'
+gem 'sinatra'
19 Gemfile.lock
@@ -0,0 +1,19 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ haml (3.1.3)
+ rack (1.3.5)
+ rack-protection (1.1.4)
+ rack
+ sinatra (1.3.1)
+ rack (>= 1.3.4, ~> 1.3)
+ rack-protection (>= 1.1.2, ~> 1.1)
+ tilt (>= 1.3.3, ~> 1.3)
+ tilt (1.3.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ haml
+ sinatra
24 LICENSE
@@ -0,0 +1,24 @@
+So-called MIT/X license.
+
+Copyright (C) 2011 Kana Natsuno <kana@whileimautomaton.n3t>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+__END__
14 Rakefile
@@ -0,0 +1,14 @@
+task :deploy do
+ sh 'git diff --quiet HEAD'
+ sh <<'END'
+ sed -i -e "s!@@VERSION@@!$(git describe --always --dirty)!g" $(
+ for i in $(git ls-files)
+ do
+ test -f "$i" && ! test -h "$i" && echo "$i"
+ done
+ )
+END
+ sh 'git commit -am "Replace version numbers"'
+ sh 'git reset --hard HEAD~1'
+ sh 'git push heroku HEAD@{1}:master -f'
+end
20 app.rb
@@ -0,0 +1,20 @@
+require 'cgi'
+require 'haml'
+require 'sinatra'
+
+
+
+
+class App < Sinatra::Application
+ NAME = 'NAME' # FIXME
+ GITHUB_REPOS_URI = 'GITHUB_REPOS_URI' # FIXME
+
+ get '/' do
+ haml :index
+ end
+end
+
+
+
+
+__END__
2  config.ru
@@ -0,0 +1,2 @@
+require './app'
+run App
27 views/index.haml
@@ -0,0 +1,27 @@
+!!! 5
+%html
+ %head
+ %title= App::NAME
+ %meta(charset='utf-8')
+ %body
+ #header
+ %h1= App::NAME
+
+ #footer
+ %address
+ = App::NAME
+ @@VERSION@@
+ &#x2014;
+ Copyright &copy; 2011
+ %a(href='http://whileimautomaton.net/') Kana Natsuno
+ (
+ %a(href='http://twitter.com/kana1')> @kana1
+ )
+ &#x2014;
+ %a(href='#{App::GITHUB_REPOS_URI}')
+ Watch changes
+ &#x2014;
+ %a(href='#{App::GITHUB_REPOS_URI}/issues')
+ Report issues
+
+-# __END__
Please sign in to comment.
Something went wrong with that request. Please try again.