Sha256: 30ea01d0f65297367d0bb9888a78737e3d357c4c4bcffb92212d0c1e26af44dc

Contents?: true

Size: 736 Bytes

Versions: 3

Compression:

Stored size: 736 Bytes

Contents

# Mongrel postamble
if __FILE__ == $0
  require 'mongrel/camping'
  
  <%= @appname %>::Models::Base.establish_connection :adapter => 'sqlite3', :database => File.dirname(__FILE__) + "/../db/<%= @appname %>.db"
  <%= @appname %>::Models::Base.logger = Logger.new(File.dirname(__FILE__) + "/../log/<%= @appname %>.log")
  <%= @appname %>.create if <%= @appname %>.respond_to? :create
  <%= @appname %>::Models::Base.threaded_connections = false
  
  s = Mongrel::Camping.start("<%= @server_address %>", <%= @server_port %>, "/", <%= @appname %>)
  
  # This lets Ctrl+C shut down your server
  trap(:INT) do
    s.stop
  end
  
  puts "** <%= @appname %> is running at http://<%= @server_address %>:<%= @server_port %>/"
  s.run.join
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bivouac-0.0.4 lib/bivouac/template/application/postamble_mongrel.rb
bivouac-0.0.5 lib/bivouac/template/application/postamble_mongrel.rb
bivouac-0.0.6 lib/bivouac/template/application/postamble_mongrel.rb