Permalink
Browse files

oh my shit it works

  • Loading branch information...
1 parent 65e3702 commit 50ae2b186b77b2b0c38a853d503633abfdce571e @geelen committed Jun 5, 2012
Showing with 42 additions and 23 deletions.
  1. +2 −0 Gemfile
  2. +10 −0 Gemfile.lock
  3. +1 −1 Procfile
  4. 0 app/application.coffee
  5. +0 −7 app/index.haml
  6. +0 −15 app/server.rb
  7. +29 −0 server.rb
View
@@ -4,3 +4,5 @@ gem 'sinatra'
gem 'sinatra-contrib'
gem 'haml'
gem 'coffee-script'
+gem 'pry'
+gem 'curb'
View
@@ -2,16 +2,23 @@ GEM
remote: http://rubygems.org/
specs:
backports (2.6.1)
+ coderay (1.0.6)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.2.0)
+ curb (0.8.0)
daemons (1.1.8)
eventmachine (0.12.10)
execjs (1.3.0)
multi_json (~> 1.0)
haml (3.1.4)
+ method_source (0.7.1)
multi_json (1.2.0)
+ pry (0.9.9.3)
+ coderay (~> 1.0.5)
+ method_source (~> 0.7.1)
+ slop (>= 2.4.4, < 3)
rack (1.4.1)
rack-protection (1.2.0)
rack
@@ -28,6 +35,7 @@ GEM
rack-test
sinatra (~> 1.3.0)
tilt (~> 1.3)
+ slop (2.4.4)
thin (1.3.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
@@ -39,7 +47,9 @@ PLATFORMS
DEPENDENCIES
coffee-script
+ curb
haml
+ pry
sinatra
sinatra-contrib
thin
View
@@ -1 +1 @@
-web: bundle exec ruby app/server.rb -p $PORT
+web: bundle exec ruby server.rb -p $PORT
No changes.
View
@@ -1,7 +0,0 @@
-!!! 5
-%html
- %head
- %script(src='http://code.angularjs.org/angular-1.0.0rc10.min.js')
- %script(src='/application.js')
- %body(ng-app)
- %h1 {{ 1 + 2 }}
View
@@ -1,15 +0,0 @@
-require 'sinatra'
-require 'sinatra/reloader' if development?
-require 'coffee-script'
-require 'haml'
-
-set :haml, format: :html5
-set :views, File.dirname(__FILE__)
-
-get '/application.js' do
- coffee :application
-end
-
-get '*' do
- haml :index
-end
View
@@ -0,0 +1,29 @@
+require 'sinatra'
+require 'sinatra/reloader' if development?
+require 'coffee-script'
+require 'haml'
+require 'curb'
+
+set :haml, format: :html5
+set :views, 'app'
+
+def gist_id
+ request.host[/^(\w+)\./,1]
+end
+
+def gist(filename)
+ Curl::Easy.perform("http://gist.github.com/raw/#{gist_id}/#{filename}") { |e|
+ e.follow_location = true
+ }.body_str
+end
+
+get '/application.js' do
+ coffee gist('application.coffee')
+end
+
+get '/favicon.ico' do
+end
+
+get '*' do
+ haml gist('index.haml')
+end

0 comments on commit 50ae2b1

Please sign in to comment.