lib/pact_broker/diagnostic/app.rb in pact_broker-2.79.1 vs lib/pact_broker/diagnostic/app.rb in pact_broker-2.80.0
- old
+ new
@@ -1,29 +1,29 @@
-require 'pact_broker/diagnostic/resources/heartbeat'
-require 'pact_broker/diagnostic/resources/dependencies'
-require 'webmachine/adapters/rack_mapped'
+require "pact_broker/diagnostic/resources/heartbeat"
+require "pact_broker/diagnostic/resources/dependencies"
+require "webmachine/adapters/rack_mapped"
module PactBroker
module Diagnostic
class App
def initialize
@app = build_diagnostic_app
end
def call env
- if env['PATH_INFO'].start_with? "/diagnostic/"
+ if env["PATH_INFO"].start_with? "/diagnostic/"
@app.call(env)
else
[404, {}, []]
end
end
def build_diagnostic_app
- app = Webmachine::Application.new do |app|
- app.routes do
- add ['diagnostic','status','heartbeat'], Diagnostic::Resources::Heartbeat, {resource_name: 'diagnostic_heartbeat'}
- add ['diagnostic','status','dependencies'], Diagnostic::Resources::Dependencies, {resource_name: 'diagnostic_dependencies'}
+ app = Webmachine::Application.new do |webmachine_app|
+ webmachine_app.routes do
+ add ["diagnostic","status","heartbeat"], Diagnostic::Resources::Heartbeat, {resource_name: "diagnostic_heartbeat"}
+ add ["diagnostic","status","dependencies"], Diagnostic::Resources::Dependencies, {resource_name: "diagnostic_dependencies"}
end
end
app.configure do |config|
config.adapter = :RackMapped