-
Notifications
You must be signed in to change notification settings - Fork 17
Support lower case options. #38
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
base: main
Are you sure you want to change the base?
Conversation
…tup gets the value from :port
|
The challenge here is other gems that provide https://github.com/puma/puma/blob/master/lib/rack/handler/puma.rb#L54-L58 The best short term option, IMHO, is to provide both So my advice is:
Eventually, in a major version bump, we could deprecate the old options. |
What if the developer passes both port and Port, which you think should have priority? |
|
I think priority should be given to the new options. |
|
HI @ioquatix . I added another PR, where my approach was more or less what you proposed, with a few tweaks that I found while tinkering at it:
So, as the tests imply:
I am aware this adds a lot of redundancy, and does not solve issues like If you agree with this approach I can optimise it a bit to avoid redundant assignments and such, given that currently it rechecks the values multiple times. [Later Edit] The more I think about this, the uglier it seems, adding all those redundant values in the options, but I can't see a way around allowing custom values like "SomeTestValue" which anyone might want to use for their own implementation. |
|
@ioquatix I think one of the main issue of the above approach is that it tries dealing with both default rackup options and server options. What do you think about moving the logic in a separate file which defines a constant set of 'predefined' possible option values which get normalized in a specific manner (SSLEncryption => ssl_encryption) and the remainder of options remain the same? |

Issue
Addressing: #37 (comment)
Approach
Given that we want to ensure backward compatibility until the option
Portis fully deprecated, we still accept thePortoption, but we delete it atRackup::Serverinitialization and set its value to:port.In case a user, for whatever reason, chooses to pass both
portandPort,porttakes precedence.I also changed the WEBrick initialization from using
Portto usingport.I am also wondering:
server.options[:Port]which will now fail, because we have deleted that? (I changed the tests to function with this new approach)Host?Portis deleted?Tests
Modified tests and they're all passing now:
Please let me know what you think!