#!/usr/bin/env ruby

require 'rubygems'
require 'merb-core'

ARGV.push '-H' if ARGV[0] && ARGV[0] =~ /^[^-]/
unless %w[-a --adapter -i --irb-console -r --script-runner].any? { |o| ARGV.index(o) }
  ARGV.push *%w[-a mongrel]
end

Merb.start