Remove jRuby hacks
This commit is contained in:
parent
d04a8b5052
commit
dd8391be93
4 changed files with 11 additions and 21 deletions
|
@ -2,4 +2,4 @@ rvm:
|
||||||
- 1.8.7
|
- 1.8.7
|
||||||
- 1.9.2
|
- 1.9.2
|
||||||
- 1.9.3
|
- 1.9.3
|
||||||
script: "bundle exec rake test"
|
script: "bundle exec rake test"
|
||||||
|
|
|
@ -226,14 +226,11 @@ 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?
|
require "thin"
|
||||||
else
|
::Thin::Logging.silent = !options[:logging]
|
||||||
require "thin"
|
opts[:server] = 'thin'
|
||||||
::Thin::Logging.silent = !options[:logging]
|
|
||||||
'thin'
|
|
||||||
end
|
|
||||||
|
|
||||||
server = ::Rack::Server.new(opts)
|
server = ::Rack::Server.new(opts)
|
||||||
server.start
|
server.start
|
||||||
server
|
server
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -45,12 +45,7 @@ module Guard
|
||||||
|
|
||||||
# Start Middleman in a fork
|
# Start Middleman in a fork
|
||||||
def start
|
def start
|
||||||
if ::Middleman::JRUBY
|
@server_job = fork { bootup }
|
||||||
thread = Thread.new { bootup }
|
|
||||||
thread.join
|
|
||||||
else
|
|
||||||
@server_job = fork { bootup }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def bootup
|
def bootup
|
||||||
|
@ -73,12 +68,9 @@ 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
|
Process.kill(::Middleman::WINDOWS ? :KILL : :TERM, @server_job)
|
||||||
else
|
Process.wait @server_job
|
||||||
Process.kill(::Middleman::WINDOWS ? :KILL : :TERM, @server_job)
|
@server_job = nil
|
||||||
Process.wait @server_job
|
|
||||||
@server_job = nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Simply stop, then start
|
# Simply stop, then start
|
||||||
|
|
Loading…
Reference in a new issue