mirror of
https://github.com/github/codeql.git
synced 2026-01-06 19:20:25 +01:00
29 lines
501 B
Ruby
29 lines
501 B
Ruby
require 'rack'
|
|
require 'rack/handler/puma'
|
|
handler = Rack::Handler::Puma
|
|
|
|
class InstanceApp
|
|
def call(env)
|
|
status = 200
|
|
headers = {}
|
|
body = ["instance app"]
|
|
resp = [status, headers, body]
|
|
resp
|
|
end
|
|
end
|
|
|
|
class ClassApp
|
|
def self.call(env)
|
|
[200, {}, ["class app"]]
|
|
end
|
|
end
|
|
|
|
lambda_app = ->(env) { [200, {}, ["lambda app"]] }
|
|
|
|
proc_app = Proc.new { |env| [200, {}, ["proc app"]] }
|
|
|
|
handler.run InstanceApp.new
|
|
handler.run ClassApp
|
|
handler.run lambda_app
|
|
handler.run proc_app
|