From 7f54ef03251bbcd9b655efdb8fe0b487b652cd7c Mon Sep 17 00:00:00 2001 From: Mark Bussey Date: Sat, 13 Mar 2021 09:25:42 -0600 Subject: [PATCH] Remove obsolete diagnostic code for partials The explain_partials code provided functionality to identify which partials were generating a particular part of a rendered page. The gem x-ray rails provides the same functionality in a cleaner, better integrated fashion. See https://github.com/brentd/xray-rails This PR should also slightly improve coverage by removing unused code. --- Gemfile | 2 +- config/initializers/explain_partials.rb | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 config/initializers/explain_partials.rb diff --git a/Gemfile b/Gemfile index 8a6112057..f58c9e397 100644 --- a/Gemfile +++ b/Gemfile @@ -51,7 +51,6 @@ gem 'twitter-bootstrap-rails' gem 'uglifier', '>= 1.3.0' gem 'webpacker', '~> 4' gem 'whenever', require: false -gem 'xray-rails' gem 'yard' group :development, :test do @@ -96,6 +95,7 @@ group :development do # Access an IRB console on exception pages or by using <%= console %> anywhere # in the code. gem 'web-console', '>= 3.3.0' + gem 'xray-rails' end extra_gems = "/opt/laevigata/shared/Gemfile.local" diff --git a/config/initializers/explain_partials.rb b/config/initializers/explain_partials.rb deleted file mode 100644 index 58329f09f..000000000 --- a/config/initializers/explain_partials.rb +++ /dev/null @@ -1,16 +0,0 @@ -# Start the app with EXPLAIN_PARTIALS=true to show locations of view partials -if Rails.env.development? and ENV['EXPLAIN_PARTIALS'] - module ActionView - class PartialRenderer - def render_with_explanation(*args) - rendered = render_without_explanation(*args).to_s - # Note: We haven't figured out how to get a path when @template is nil. - start_explanation = "\n\n" - end_explanation = "\n\n" - start_explanation.html_safe + rendered + end_explanation.html_safe - end - - alias_method_chain :render, :explanation - end - end -end