Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer rackup file specified by CLI #2236

Merged
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions History.md
Expand Up @@ -39,6 +39,7 @@
* Fix `out_of_band` hook never executed if the number of worker threads is > 1 (#2177)
* Fix ThreadPool#shutdown timeout accuracy (#2221)
* Fix `UserFileDefaultOptions#fetch` to properly use `default` (#2233)
* Prefer the rackup file specified by the CLI (#2225)

* Refactor
* Remove unused loader argument from Plugin initializer (#2095)
Expand Down
2 changes: 1 addition & 1 deletion lib/puma/dsl.rb
Expand Up @@ -308,7 +308,7 @@ def debug
# @example
# rackup '/u/apps/lolcat/config.ru'
def rackup(path)
@options[:rackup] = path.to_s
@options[:rackup] = path.to_s unless @options[:rackup]
nateberkopec marked this conversation as resolved.
Show resolved Hide resolved
end

def early_hints(answer=true)
Expand Down
1 change: 1 addition & 0 deletions test/config/with_rackup_from_dsl.rb
@@ -0,0 +1 @@
rackup "test/rackup/hello-env.ru"
11 changes: 11 additions & 0 deletions test/test_integration_single.rb
Expand Up @@ -43,6 +43,17 @@ def test_term_suppress
assert_equal 0, status
end

def test_prefer_rackup_file_specified_by_cli
skip_unless_signal_exist? :TERM

cli_server "-C test/config/with_rackup_from_dsl.rb test/rackup/hello.ru"
connection = connect
reply = read_body(connection)
_, status = stop_server

assert_match("Hello World", reply)
end

def test_term_not_accepts_new_connections
skip_unless_signal_exist? :TERM
skip_on :jruby
Expand Down