Permalink
Browse files

Use Bundler.require so that the gems are required' automatically.

  • Loading branch information...
1 parent 619b373 commit 0cff95e74088e47d2750c795b036feeb7926dee3 @benschwarz committed Mar 7, 2011
Showing with 12 additions and 16 deletions.
  1. +4 −4 Gemfile
  2. +2 −2 Gemfile.lock
  3. +5 −8 app.rb
  4. +1 −2 config.ru
View
@@ -3,11 +3,11 @@ source :rubygems
gem "sinatra"
gem "haml"
gem "rack"
-gem "rack-client", "0.3.1.pre.f"
-gem "rack-cache"
-gem "yajl-ruby"
+gem "rack-client", "0.3.1.pre.f", require: "rack/client"
+gem "rack-cache", require: "rack/cache"
+gem "yajl-ruby", require: ["yajl", "json"]
gem "peach"
-gem "rack-pagespeed"
+gem "rack-pagespeed", require: "rack/pagespeed"
gem "heroku"
gem "thin"
View
@@ -7,9 +7,9 @@ GEM
eventmachine (0.12.10)
haml (3.0.24)
heroku (1.14.9)
- json_pure (>= 1.2.0, < 1.5.0)
+ json_pure (< 1.5.0, >= 1.2.0)
launchy (~> 0.3.2)
- rest-client (>= 1.4.0, < 1.7.0)
+ rest-client (< 1.7.0, >= 1.4.0)
jsmin (1.0.1)
json_pure (1.4.6)
launchy (0.3.7)
View
13 app.rb
@@ -1,9 +1,3 @@
-require 'sinatra'
-require 'rack/client'
-require 'rack/cache'
-require 'yajl'
-require 'json'
-
HTTPClient = Rack::Client.new do
use Rack::Cache,
:metastore => 'heap://',
@@ -15,7 +9,10 @@
YQL_BASE = "http://query.yahooapis.com/v1/public/yql"
-configure { mime_type :manifest, "text/cache-manifest" }
+configure do
+ set :root, File.dirname(__FILE__)
+ mime_type :manifest, "text/cache-manifest"
+end
before do
content_type :html, charset: 'utf-8'
@@ -48,4 +45,4 @@
get '/offline.manifest' do
content_type :manifest
erb :"offline.manifest", layout: false
-end
+end
View
@@ -1,9 +1,8 @@
require 'rubygems'
require 'bundler'
-Bundler.setup
+Bundler.require
require ::File.dirname(__FILE__) + '/app'
-require 'rack/pagespeed'
use Rack::ContentLength # Set Content-Length on string bodies
use Rack::ETag # Set E-Tags on string bodies

0 comments on commit 0cff95e

Please sign in to comment.