Skip to content

Commit

Permalink
Use AsyncRack::CommonLogger in generated app
Browse files Browse the repository at this point in the history
  • Loading branch information
lifo committed Aug 3, 2011
1 parent 596b206 commit bddc523
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/cramp/generators/templates/application/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ gem 'thin'
# Rack based routing
gem 'http_router'

# Collection of async-proof rack middlewares
gem 'async-rack'

# For async Active Record models
<% if active_record? -%>
gem 'mysql2', '~> 0.2.11'
Expand Down
19 changes: 17 additions & 2 deletions lib/cramp/generators/templates/application/config.ru
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
require './application'

# bundle exec thin --max-persistent-conns 1024 -V -R config.ru start
<%= app_const %>.initialize!
# Development middlewares
if <%= app_const %>.env == 'development'
require 'async-rack'
use AsyncRack::CommonLogger
end

# Running thin :
#
# bundle exec thin --max-persistent-conns 1024 -R config.ru start
#
# Vebose mode :
#
# Very useful when you want to view all the data being sent/received by thin
#
# bundle exec thin --max-persistent-conns 1024 -R -V config.ru start
#
run <%= app_const %>.routes

0 comments on commit bddc523

Please sign in to comment.