From be52d4894a5a4ffbf346d482f1af7d34e3c3ab86 Mon Sep 17 00:00:00 2001 From: Jared White Date: Thu, 26 May 2022 00:00:28 -0700 Subject: [PATCH] bugfix: The routes gem will exist if there's no site present --- bridgetown-routes/lib/bridgetown-routes/roda_router.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bridgetown-routes/lib/bridgetown-routes/roda_router.rb b/bridgetown-routes/lib/bridgetown-routes/roda_router.rb index 3d5d847b1..399f3bca6 100644 --- a/bridgetown-routes/lib/bridgetown-routes/roda_router.rb +++ b/bridgetown-routes/lib/bridgetown-routes/roda_router.rb @@ -3,7 +3,14 @@ module Bridgetown module Routes module RodaRouter - def self.start!(app) + def self.start!(app) # rubocop:todo Metrics/MethodLength + unless Bridgetown::Current.site + Bridgetown.logger.warn( + "The `bridgetown_routes` plugin hasn't been configured in the Roda app." + ) + return + end + r = app.request response = app.response