From 41f0fb8c6e4dd051e1158835ffde9caf0801946b Mon Sep 17 00:00:00 2001 From: Tatsuya Hoshino Date: Wed, 6 Nov 2019 22:38:55 +0900 Subject: [PATCH] Remove needless `require "pp"` In Ruby 2.5 and later, `Kernel#pp` is automatically loaded. https://bugs.ruby-lang.org/issues/14123 This changes remove the needless `require "pp"`. --- actionpack/test/abstract_unit.rb | 2 -- actionview/test/abstract_unit.rb | 2 -- activesupport/test/dependencies_test.rb | 1 - guides/source/initialization.md | 1 - railties/lib/rails/application.rb | 4 ---- 5 files changed, 10 deletions(-) diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 33ecea17bc..eb66876c3f 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -29,8 +29,6 @@ require "active_support/dependencies" require "active_model" -require "pp" # require 'pp' early to prevent hidden_methods from not picking up the pretty-print methods until too late - module Rails class << self def env diff --git a/actionview/test/abstract_unit.rb b/actionview/test/abstract_unit.rb index b652f2e6cb..c4ad00a9d8 100644 --- a/actionview/test/abstract_unit.rb +++ b/actionview/test/abstract_unit.rb @@ -24,8 +24,6 @@ require "active_model" require "active_record" -require "pp" # require 'pp' early to prevent hidden_methods from not picking up the pretty-print methods until too late - ActiveSupport::Dependencies.hook! Thread.abort_on_exception = true diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb index 6bad69f7f2..1d06141108 100644 --- a/activesupport/test/dependencies_test.rb +++ b/activesupport/test/dependencies_test.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require "abstract_unit" -require "pp" require "active_support/dependencies" require "dependencies_test_helpers" diff --git a/guides/source/initialization.md b/guides/source/initialization.md index 556c85cc0f..1ff37cfc71 100644 --- a/guides/source/initialization.md +++ b/guides/source/initialization.md @@ -405,7 +405,6 @@ def start &blk if options[:debug] $DEBUG = true - require 'pp' p options[:server] pp wrapped_app pp app diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 62456e5ab9..0140c811e7 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -482,10 +482,6 @@ def helpers_paths #:nodoc: config.helpers_paths end - console do - require "pp" - end - console do unless ::Kernel.private_method_defined?(:y) require "psych/y"