clean up a little more stuff

This commit is contained in:
John Bintz 2012-03-21 19:57:30 -04:00
parent 1b1c160639
commit 04854f42e4
3 changed files with 5 additions and 46 deletions

View File

@ -1,5 +1,4 @@
require 'sinatra'
require 'json'
require 'cgi'
module Flowerbox
@ -8,55 +7,12 @@ module Flowerbox
attr_accessor :runner, :sprockets
end
def runner
self.class.runner
end
def sprockets
self.class.sprockets
end
def data
JSON.parse(request.body.string)
end
def self.command(*args, &block)
url, args = args
url = "/#{url}"
post(url, *args) do
instance_eval(&block)
""
end
end
command :results do
runner.finish!(data.flatten.first)
end
command :start_test do
runner.add_tests(data.flatten)
end
command :finish_test do
runner.add_results(data.flatten)
end
command :log do
runner.log(data.first)
end
command :ping do
end
command :pause_timer do
end
command :unpause_timer do
end
command :starting do
def runner
self.class.runner
end
get %r{^/__F__/(.*)$} do |file|

View File

@ -59,6 +59,8 @@ module Flowerbox
attempts = 3
require 'flowerbox/server'
while true
begin
server.start

View File

@ -4,6 +4,7 @@ require 'socket'
require 'rack/builder'
require 'thin'
require 'em-websocket'
require 'json'
module Flowerbox
class Server