From 232bb6b17e470aeabe0dc71cad34bc226fa21ab6 Mon Sep 17 00:00:00 2001 From: schneems Date: Thu, 4 Feb 2016 09:49:01 -0600 Subject: [PATCH] Fix bad rebase --- lib/puma/cli.rb | 6 +----- lib/puma/launcher.rb | 12 ++++++------ test/test_cli.rb | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/puma/cli.rb b/lib/puma/cli.rb index b52942e8..4e4de650 100644 --- a/lib/puma/cli.rb +++ b/lib/puma/cli.rb @@ -26,11 +26,7 @@ module Puma # Handles invoke a Puma::Server in a command line style. # class CLI - KEYS_NOT_TO_PERSIST_IN_STATE = [ - :logger, :lowlevel_error_handler, - :before_worker_shutdown, :before_worker_boot, :before_worker_fork, - :after_worker_boot, :before_fork, :on_restart - ] + KEYS_NOT_TO_PERSIST_IN_STATE = Launcher::KEYS_NOT_TO_PERSIST_IN_STATE # Create a new CLI object using +argv+ as the command line # arguments. diff --git a/lib/puma/launcher.rb b/lib/puma/launcher.rb index ea365e27..7cc7f535 100644 --- a/lib/puma/launcher.rb +++ b/lib/puma/launcher.rb @@ -8,6 +8,11 @@ module Puma # It is responsible for either launching a cluster of Puma workers or a single # puma server. class Launcher + KEYS_NOT_TO_PERSIST_IN_STATE = [ + :logger, :lowlevel_error_handler, + :before_worker_shutdown, :before_worker_boot, :before_worker_fork, + :after_worker_boot, :before_fork, :on_restart + ] # Returns an instance of Launcher # # +input_options+ A Hash of options that is supplied by a user, typically through @@ -127,12 +132,7 @@ module Puma state = { 'pid' => Process.pid } cfg = @config.dup - [ - :logger, - :before_worker_shutdown, :before_worker_boot, :before_worker_fork, - :after_worker_boot, - :on_restart, :lowlevel_error_handler - ].each { |k| cfg.options.delete(k) } + KEYS_NOT_TO_PERSIST_IN_STATE.each { |k| cfg.options.delete(k) } state['config'] = cfg require 'yaml' diff --git a/test/test_cli.rb b/test/test_cli.rb index 2a29351f..096a69eb 100644 --- a/test/test_cli.rb +++ b/test/test_cli.rb @@ -137,7 +137,7 @@ class TestCLI < Test::Unit::TestCase end def test_state_file_callback_filtering - cli = Puma::CLI.new [ "--config", "test/config/state_file_testing_config.rb", + cli = Puma::CLI.new [ "--config", "test/config/state_file_testing_config.rb", "--state", @tmp_path ] cli.send( :parse_options ) cli.write_state