make middleman not be so outright jruby hostile

This commit is contained in:
Travis Tilley 2011-02-21 10:19:18 -05:00
parent 1a15147f67
commit 08a9f45164
4 changed files with 52 additions and 41 deletions

View file

@ -1,7 +1,7 @@
#!/usr/bin/env ruby
# Non-blocking site rebuilding
trap("TSTP") do
trap("TSTP") do
fork do
require "open3"
first_run = true
@ -38,7 +38,7 @@ OptionParser.new { |opts|
opts.on("--debug", "Debug mode") {
::Middleman::Server.set :logging, true
}
opts.parse! ARGV
}
@ -54,9 +54,16 @@ end
app = Middleman::Server.new
require 'rubygems'
require 'thin'
Thin::Logging.silent = true
Rack::Handler::Thin.run app, options do |inst|
unless defined?(JRUBY_VERSION)
require 'thin'
handler = Rack::Handler::Thin
else
require 'kirk'
require 'rack/handler/kirk'
handler = Rack::Handler::Kirk
end
handler.run app, options do |inst|
puts "== The Middleman is standing watch on port #{options[:Port]}"
end
end