1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

[close #1238] Don't call non-existent method

`Puma::Configuration._from_file` was removed in 89f37432de. It was still being used by the `Puma::ControlCLI` class which was previously not being tested while being called with a `--config-file` option.

This PR reintroduces the previous behavior of loading a config file when specified via `pumactl` command.
This commit is contained in:
schneems 2017-03-10 10:30:27 -06:00
parent d5bab85927
commit 77edb0398c
2 changed files with 7 additions and 5 deletions

View file

@ -78,11 +78,12 @@ module Puma
end
if @config_file
config = Puma::Configuration.from_file @config_file
@state ||= config.options[:state]
@control_url ||= config.options[:control_url]
config = Puma::Configuration.new({ config_files: [@config_file] }, {})
config.load
@state ||= config.options[:state]
@control_url ||= config.options[:control_url]
@control_auth_token ||= config.options[:control_auth_token]
@pidfile ||= config.options[:pidfile]
@pidfile ||= config.options[:pidfile]
end
end

View file

@ -4,6 +4,7 @@ require 'puma/control_cli'
class TestPumaControlCli < Minitest::Test
def test_config_file
Puma::ControlCLI.new ["halt", "--config-file", 'test/config/settings.rb']
control_cli = Puma::ControlCLI.new ["--config-file", "test/config/state_file_testing_config.rb", "halt"]
assert_equal "t3-pid", control_cli.instance_variable_get("@pidfile")
end
end