config.ru in opal-jquery-0.0.5 vs config.ru in opal-jquery-0.0.6
- old
+ new
@@ -1,31 +1,10 @@
require 'bundler'
Bundler.require
-html = <<-HTML
- <!DOCTYPE html>
- <html>
- <head>
- <title>opal-jquery specs</title>
- </head>
- <body>
- <script src="/assets/autorun.js"></script>
- </body>
- </html>
-HTML
+require 'opal/spec/server'
-map '/assets' do
- env = Opal::Environment.new
- env.append_path 'vendor' # for jquery
- env.append_path 'spec'
- run env
-end
+# Run in non-debug mode (faster, all files concatenated into 1 file)
+run Opal::Spec::Server.new(false)
-map '/' do
- run lambda { |env|
- if env['PATH_INFO'] == '/'
- [200, {'Content-Type' => 'text/html'}, [html]]
- else
- Rack::Directory.new('spec').call(env)
- end
- }
-end
+# Run in debug mode - all files loaded seperately, but slower
+# run Opal::Spec::Server.new