a few tweaks
This commit is contained in:
parent
2dc1e03aff
commit
91ad5de7d1
@ -13,14 +13,20 @@ module Flowerbox
|
||||
|
||||
def start
|
||||
@server_thread = Thread.new do
|
||||
Rack::Handler::WEBrick.run(lambda { |env| [ 200, {}, [] ] }, :Port => port, :Host => interface) { |server|
|
||||
::Rack::Handler::WEBrick.run(options[:app], :Port => port, :Host => interface) do |server|
|
||||
trap('QUIT') { server.stop }
|
||||
|
||||
Thread.current[:server] = server
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
while !@server_thread[:server]
|
||||
while !@server_thread[:server] && @server_thread.alive?
|
||||
$stderr.puts "waiting"
|
||||
|
||||
sleep 0.1
|
||||
end
|
||||
|
||||
raise StandardError.new("Server died") if !@server_thread.alive?
|
||||
end
|
||||
|
||||
def stop
|
||||
|
@ -1,10 +1,15 @@
|
||||
require 'sprockets'
|
||||
require 'sprockets/engines'
|
||||
require 'forwardable'
|
||||
|
||||
module Flowerbox::Delivery
|
||||
class SprocketsHandler
|
||||
extend Forwardable
|
||||
|
||||
attr_reader :files, :options
|
||||
|
||||
def_delegators :environment, :append_path
|
||||
|
||||
def initialize(options)
|
||||
@options = options
|
||||
|
||||
@ -29,8 +34,8 @@ module Flowerbox::Delivery
|
||||
@environment.register_engine('.css', Flowerbox::Delivery::Tilt::CSSTemplate)
|
||||
@environment.register_engine('.jst', Flowerbox::Delivery::Tilt::JSTTemplate)
|
||||
|
||||
options[:asset_paths].each { |path| append_path(path) }
|
||||
|
||||
options[:asset_paths].each { |path| @environment.append_path(path) }
|
||||
@environment
|
||||
end
|
||||
|
||||
@ -43,3 +48,4 @@ module Flowerbox::Delivery
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user