Skip to content

Commit

Permalink
Merge pull request #1239 from puma/schneems/fix-1238
Browse files Browse the repository at this point in the history
[close #1238] Don't call non-existent method
  • Loading branch information
schneems committed Mar 10, 2017
2 parents 1992a79 + 77edb03 commit 5bac8d5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/puma/control_cli.rb
Expand Up @@ -78,11 +78,12 @@ def initialize(argv, stdout=STDOUT, stderr=STDERR)
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

Expand All @@ -97,6 +98,7 @@ def initialize(argv, stdout=STDOUT, stderr=STDERR)

rescue => e
@stdout.puts e.message
@stdout.puts e.backtrace
exit 1
end

Expand Down Expand Up @@ -230,6 +232,7 @@ def run

rescue => e
message e.message
message e.backtrace
exit 1
end

Expand Down
10 changes: 10 additions & 0 deletions test/test_pumactl.rb
@@ -0,0 +1,10 @@
require "test_helper"

require 'puma/control_cli'

class TestPumaControlCli < Minitest::Test
def test_config_file
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

0 comments on commit 5bac8d5

Please sign in to comment.