From f73cd572332cafac66b2ff267df8beb596cceb32 Mon Sep 17 00:00:00 2001 From: Tim Morgan Date: Thu, 13 Feb 2020 16:55:35 -0600 Subject: [PATCH] Remove diagnostic logging --- bin/puma-wild | 6 ------ lib/puma/configuration.rb | 4 ---- lib/puma/launcher.rb | 9 +-------- test/test_preserve_bundler_env.rb | 4 ++-- 4 files changed, 3 insertions(+), 20 deletions(-) diff --git a/bin/puma-wild b/bin/puma-wild index 8eb2902e..b3ba0152 100644 --- a/bin/puma-wild +++ b/bin/puma-wild @@ -3,7 +3,6 @@ # Copyright (c) 2014 Evan Phoenix # -puts "puma-wild 111 defined?(Bundler) = #{defined?(Bundler).inspect}" require 'rubygems' gems = ARGV.shift @@ -16,22 +15,17 @@ if gems == "-I" gems = ARGV.shift end -p gems - gems.split(",").each do |s| name, ver = s.split(":",2) gem name, ver end -puts "puma-wild 222 defined?(Bundler) = #{defined?(Bundler).inspect}" - module Puma; end Puma.const_set("WILD_ARGS", ["-I", inc, gems]) require 'puma/cli' -puts "puma-wild 333 defined?(Bundler) = #{defined?(Bundler).inspect}" cli = Puma::CLI.new ARGV cli.run diff --git a/lib/puma/configuration.rb b/lib/puma/configuration.rb index f587c0c8..e8e546d6 100644 --- a/lib/puma/configuration.rb +++ b/lib/puma/configuration.rb @@ -299,12 +299,8 @@ module Puma # a Gemfile if ENV.key? 'PUMA_BUNDLER_PRUNED' begin - puts '>>>> loading Bundler...' require 'bundler/setup' rescue LoadError - puts 'failed' - else - puts 'success' end end diff --git a/lib/puma/launcher.rb b/lib/puma/launcher.rb index b0520235..f45e035e 100644 --- a/lib/puma/launcher.rb +++ b/lib/puma/launcher.rb @@ -286,9 +286,6 @@ module Puma end def prune_bundler - puts '>>>> prune_bundler starting...' - puts "prune_bundler defined?(Bundler) = #{defined?(Bundler).inspect}" - #return if ENV.key?('PUMA_BUNDLER_PRUNED') return unless defined?(Bundler) require_rubygems_min_version!(Gem::Version.new("2.2"), "prune_bundler") unless puma_wild_location @@ -298,20 +295,16 @@ module Puma deps, dirs = dependencies_and_files_to_require_after_prune - log "* Pruning Bundler environment" + log '* Pruning Bundler environment' home = ENV['GEM_HOME'] bundle_gemfile = ENV['BUNDLE_GEMFILE'] Bundler.with_clean_env do - require 'pp' - puts 'ENV after Bundler.with_original_env:' - pp ENV ENV['GEM_HOME'] = home ENV['BUNDLE_GEMFILE'] = bundle_gemfile ENV['PUMA_BUNDLER_PRUNED'] = '1' args = [Gem.ruby, puma_wild_location, '-I', dirs.join(':'), deps.join(',')] + @original_argv # Ruby 2.0+ defaults to true which breaks socket activation args += [{:close_others => false}] - p args Kernel.exec(*args) end end diff --git a/test/test_preserve_bundler_env.rb b/test/test_preserve_bundler_env.rb index 07d2840e..35aaee71 100644 --- a/test/test_preserve_bundler_env.rb +++ b/test/test_preserve_bundler_env.rb @@ -21,12 +21,12 @@ class TestPreserveBundlerEnv < TestIntegration Dir.chdir(File.expand_path("bundle_preservation_test", __dir__)) do @server = IO.popen(env, cmd.split, "r") end - wait_for_server_to_boot(log: true) + wait_for_server_to_boot @pid = @server.pid connection = connect initial_reply = read_body(connection) assert_match("Gemfile.bundle_env_preservation_test", initial_reply) - restart_server connection, log: true + restart_server connection new_reply = read_body(connection) assert_match("Gemfile.bundle_env_preservation_test", new_reply) end