rackup icon indicating copy to clipboard operation
rackup copied to clipboard

Rackup::Server.start :port to be :Port?

Open rubyFeedback opened this issue 2 months ago • 1 comments

I have had code like this:

Rackup::Server.start(
  app:  SomeApp.new,
  port: 12345   
)

This was not working, though, due to :port and I looked at the source.

There I found that it was :Port. Would it be possible to treat both lowercase (first letter that is) and uppercase (again first letter) the same?

It is not a huge thing, I can adapt, but I was surprised that :port did not work but :Port does. I assume this was inherited from webrick? Either way it seems quite unusual to focus on capitalized keys in a Hash, as a symbol. Most often we use the downcased variant instead. Either way, I think the best solution would be to allow both capitalized and non-capitalized, for all options that would make sense - so, :port would be the same as :Port and so forth.

Again, it is such a minor thing - not sure whether I should even report it, but it confused me for a little while, until I today decided to look into the source and found that :port is not the same as :Port.

rubyFeedback avatar Sep 30 '25 13:09 rubyFeedback

I agree, lower case options would be more canonical.

ioquatix avatar Sep 30 '25 21:09 ioquatix