2015-07-14 13:08:28 +02:00
|
|
|
require 'bundler'
|
|
|
|
Bundler.require
|
2015-08-20 02:14:33 +02:00
|
|
|
require 'tilt/erb'
|
|
|
|
|
2015-07-14 15:03:06 +02:00
|
|
|
require_relative "lib/parse_task"
|
2015-07-14 13:08:28 +02:00
|
|
|
|
|
|
|
require "opal"
|
2015-08-20 00:53:39 +02:00
|
|
|
require 'opal-browser'
|
|
|
|
|
2015-07-14 13:08:28 +02:00
|
|
|
Opal.use_gem("salama")
|
2015-08-19 22:34:39 +02:00
|
|
|
Opal.use_gem("salama-arm")
|
2015-07-14 13:08:28 +02:00
|
|
|
|
2015-07-14 15:03:06 +02:00
|
|
|
class DebugServer < Opal::Server
|
|
|
|
def call(env)
|
|
|
|
if( env["REQUEST_PATH"] == "/tasks.json")
|
|
|
|
[200, { 'Content-Type' => 'text/json' }, [ParseTask.new.parse(1).to_json]]
|
|
|
|
else
|
|
|
|
super(env)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
run DebugServer.new { |s|
|
2015-07-14 13:08:28 +02:00
|
|
|
s.main = 'debugger'
|
|
|
|
s.append_path 'lib'
|
2015-08-20 02:14:33 +02:00
|
|
|
s.append_path 'assets'
|
2015-08-20 00:53:39 +02:00
|
|
|
# s.source_map = true
|
2015-08-22 01:35:21 +02:00
|
|
|
s.debug = !ENV["DEBUG"].nil?
|
2015-08-20 02:14:33 +02:00
|
|
|
|
|
|
|
s.index_path = "index.html.erb"
|
2015-08-20 00:53:39 +02:00
|
|
|
s.sprockets.cache = Sprockets::Cache::MemoryStore.new(5000)
|
2015-07-14 13:08:28 +02:00
|
|
|
}
|