lib/opal/cli_runners/server.rb in opal-0.11.4 vs lib/opal/cli_runners/server.rb in opal-1.0.0.beta1
- old
+ new
@@ -24,14 +24,14 @@
require 'logger'
app = build_app(source)
@server = Rack::Server.start(
- :app => app,
- :Port => port,
- :AccessLog => [],
- :Logger => Logger.new(output)
+ app: app,
+ Port: port,
+ AccessLog: [],
+ Logger: Logger.new(output),
)
end
def exit_status
nil
@@ -40,14 +40,16 @@
def build_app(source)
app = App.new(source)
if static_folder
not_found = [404, {}, []]
- app = Rack::Cascade.new([
- Rack::Static.new(->_{not_found}, urls: [''], root: static_folder),
- app,
- ])
+ app = Rack::Cascade.new(
+ [
+ Rack::Static.new(->(_) { not_found }, urls: [''], root: static_folder),
+ app
+ ],
+ )
end
app
end
@@ -67,17 +69,16 @@
HTML
def call(env)
case env['PATH_INFO']
when '/'
- [200, {'Content-Type' => 'text/html'}, [BODY]]
+ [200, { 'Content-Type' => 'text/html' }, [BODY]]
when '/cli_runner.js'
- [200, {'Content-Type' => 'text/javascript'}, [@source]]
+ [200, { 'Content-Type' => 'text/javascript' }, [@source]]
else
[404, {}, ['not found']]
end
end
end
-
end
end
end