From 30ff22b063bdafa2fb6ef6b52618600347cc1417 Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Fri, 13 Oct 2023 14:44:55 -0400 Subject: [PATCH] Fix non-root deployment. (#134) --- config.ru | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/config.ru b/config.ru index 10dd14c7..5d5e798f 100644 --- a/config.ru +++ b/config.ru @@ -1,21 +1,8 @@ require 'inferno' -inferno_spec = Bundler.locked_gems.specs.find { |spec| spec.name == 'inferno_core' } - -base_path = - if inferno_spec.respond_to? :stub - inferno_spec.stub.full_gem_path - elsif inferno_spec.source.is_a? Bundler::Source::Path - inferno_spec.source.path.to_s - elsif inferno_spec.source.specs.local_search('inferno_core').present? - inferno_spec.source.specs.local_search('inferno_core').first.full_gem_path - else - raise 'Unable to locate inferno static assets' - end - -inferno_path = File.join(base_path, 'lib', 'inferno') - -use Rack::Static, urls: ['/public'], root: inferno_path +use Rack::Static, + urls: Inferno::Utils::StaticAssets.static_assets_map, + root: Inferno::Utils::StaticAssets.inferno_path Inferno::Application.finalize!