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:
parent
d5bab85927
commit
77edb0398c
2 changed files with 7 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue