Remove jRuby hacks

This commit is contained in:
Thomas Reynolds 2011-12-24 16:09:07 -08:00
parent d04a8b5052
commit dd8391be93
4 changed files with 11 additions and 21 deletions

View file

@ -226,13 +226,10 @@ module Middleman
app_class = options[:app] ||= ::Middleman.server.inst app_class = options[:app] ||= ::Middleman.server.inst
opts[:app] = app_class opts[:app] = app_class
opts[:server] = if ::Middleman::JRUBY
'webrick' # Maybe Kirk?
else
require "thin" require "thin"
::Thin::Logging.silent = !options[:logging] ::Thin::Logging.silent = !options[:logging]
'thin' opts[:server] = 'thin'
end
server = ::Rack::Server.new(opts) server = ::Rack::Server.new(opts)
server.start server.start

View file

@ -1,5 +1,6 @@
# Built on Rack # Built on Rack
require "rack" require "rack"
require "rack/file"
# Using Tilt for templating # Using Tilt for templating
require "tilt" require "tilt"

View file

@ -45,13 +45,8 @@ module Guard
# Start Middleman in a fork # Start Middleman in a fork
def start def start
if ::Middleman::JRUBY
thread = Thread.new { bootup }
thread.join
else
@server_job = fork { bootup } @server_job = fork { bootup }
end end
end
def bootup def bootup
env = (@options[:environment] || "development").to_sym env = (@options[:environment] || "development").to_sym
@ -73,13 +68,10 @@ module Guard
# Stop the forked Middleman # Stop the forked Middleman
def stop def stop
puts "== The Middleman is shutting down" puts "== The Middleman is shutting down"
if ::Middleman::JRUBY
else
Process.kill(::Middleman::WINDOWS ? :KILL : :TERM, @server_job) Process.kill(::Middleman::WINDOWS ? :KILL : :TERM, @server_job)
Process.wait @server_job Process.wait @server_job
@server_job = nil @server_job = nil
end end
end
# Simply stop, then start # Simply stop, then start
def reload def reload