From 91ba82ec512351db9438e5001fcbbe48f30f5bfd Mon Sep 17 00:00:00 2001 From: Mike Pastore Date: Thu, 20 Sep 2018 12:02:12 -0500 Subject: [PATCH] IndifferentHash monkeypatch warning improvements * Print warning on Rubies that require monkeypatching only * Print warning to stderr instead of stdout * Load ActiveSupport during internal testing only * Add SINATRA_ACTIVESUPPORT_WARNING opt-out environment variable --- lib/sinatra/indifferent_hash.rb | 17 +++-------------- test/helper.rb | 12 ++++++++++++ test/indifferent_hash_test.rb | 4 ++++ 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/lib/sinatra/indifferent_hash.rb b/lib/sinatra/indifferent_hash.rb index e5cf6cb33c..a0e721d4e1 100644 --- a/lib/sinatra/indifferent_hash.rb +++ b/lib/sinatra/indifferent_hash.rb @@ -1,22 +1,11 @@ # frozen_string_literal: true -if !$LOAD_PATH.grep(%r{gems/activesupport}).empty? && $LOADED_FEATURES.grep(%r{active_support/core_ext/hash}).empty? - puts <<-EOF +$stderr.puts <