From 5616fb1c4b74e313c15e6cbf54ca8fb3db9c1cae Mon Sep 17 00:00:00 2001 From: Ynda Jas Date: Tue, 30 Jul 2024 11:05:49 +0100 Subject: [PATCH] Update `Rack::Builder.parse_file` syntax This now returns an instance of `PrometheusExporter::Middleware` directly, instead of inside an array --- lib/benchmark/all.rb | 2 +- spec/features/http_request_handling_spec.rb | 4 ++-- spec/performance/benchmark_spec.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/benchmark/all.rb b/lib/benchmark/all.rb index 4ef69bc9..2fd20f03 100644 --- a/lib/benchmark/all.rb +++ b/lib/benchmark/all.rb @@ -21,7 +21,7 @@ def initialize(number_of_runs) end def app - @app ||= Rack::Builder.parse_file("config.ru")[0] + @app ||= Rack::Builder.parse_file("config.ru") end def run! diff --git a/spec/features/http_request_handling_spec.rb b/spec/features/http_request_handling_spec.rb index 571b0132..deaeeea6 100644 --- a/spec/features/http_request_handling_spec.rb +++ b/spec/features/http_request_handling_spec.rb @@ -6,7 +6,7 @@ subject { last_response } def app - Rack::Builder.parse_file("config.ru")[0] + Rack::Builder.parse_file("config.ru") end let(:department_of_health) do @@ -896,7 +896,7 @@ def app # In dev (but not production), CommonLogger middleware is in use, which expects # us not to violate the Rack spec. Part of this is not allowing nil query strings, # which at time of writing optic14n does. - let(:app) { Rack::CommonLogger.new(Rack::Builder.parse_file("config.ru")[0]) } + let(:app) { Rack::CommonLogger.new(Rack::Builder.parse_file("config.ru")) } describe "Nil querystrings do not faze us" do before do diff --git a/spec/performance/benchmark_spec.rb b/spec/performance/benchmark_spec.rb index 80917558..6e486d78 100644 --- a/spec/performance/benchmark_spec.rb +++ b/spec/performance/benchmark_spec.rb @@ -5,7 +5,7 @@ include Rack::Test::Methods def app - Rack::Builder.parse_file("config.ru")[0] + Rack::Builder.parse_file("config.ru") end let(:number_of_runs) { ENV["NUMBER_OF_RUNS"] || 1000 }