-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Implement user_supplied_options behavior. #1234
Merged
schneems
merged 15 commits into
puma:master
from
schneems:schneems/puma-port-problem-patched-per-prior-parley-possibly
Mar 9, 2017
Merged
Implement user_supplied_options behavior. #1234
schneems
merged 15 commits into
puma:master
from
schneems:schneems/puma-port-problem-patched-per-prior-parley-possibly
Mar 9, 2017
Commits on Mar 9, 2017
-
Separate Config method so we can test output
The RackHandler for Puma has configuration options that I want to test without booting up a server. By separating out into a new method we can do this easily.
Configuration menu - View commit details
-
Copy full SHA for 6dde986 - Browse repository at this point
Copy the full SHA 6dde986View commit details -
Configuration menu - View commit details
-
Copy full SHA for c946d15 - Browse repository at this point
Copy the full SHA c946d15View commit details -
Configuration menu - View commit details
-
Copy full SHA for 01b38fc - Browse repository at this point
Copy the full SHA 01b38fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for e80b0cf - Browse repository at this point
Copy the full SHA e80b0cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for cda9317 - Browse repository at this point
Copy the full SHA cda9317View commit details -
Configuration menu - View commit details
-
Copy full SHA for 24f1257 - Browse repository at this point
Copy the full SHA 24f1257View commit details -
Implement user_supplied_options behavior.
When options are passed to the Puma rack handler it is unknown if the options were set via a framework as a default or via a user. Puma currently has 3 different sources of configuration, the user via command line, the config files, and defaults. Rails 5.1+ will record the values actually specified by the user versus the values specified by the frameworks. It passes these values to the Rack handler and now it's up to Puma to do something with that information. When only framework defaults are passed it will set ``` options[:user_supplied_options] = [] ``` When one or more options are specified by the user such as `:Port` then those keys will be in the array. In that example it will look like this ``` options[:user_supplied_options] = [:Port] ``` This change is 100% backwards compatible. If the framework is older and does not pass this information then the `user_supplied_options` will not be set, in that case we assume all values are user supplied. Internally we accomplish this separation by replacing `LeveledOptions` which was a generic way of specifying options with different priorities with a more explicit `UserFileDefaultOptions` this assumes only 3 levels of options and it will use them in the order supplied (user config wins over file based config wins over defaults). Now instead of using 1 dsl to set all values, we use 3. A user dsl, a file dsl and a Configuration.new` will return all 3 DSLs to the block. It's up to the person using the block to use the correct dsl corresponding to the source of data they are getting.
Configuration menu - View commit details
-
Copy full SHA for 85dfe8e - Browse repository at this point
Copy the full SHA 85dfe8eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7215699 - Browse repository at this point
Copy the full SHA 7215699View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3dcf7dc - Browse repository at this point
Copy the full SHA 3dcf7dcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 995ed8b - Browse repository at this point
Copy the full SHA 995ed8bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 89f3743 - Browse repository at this point
Copy the full SHA 89f3743View commit details -
Configuration menu - View commit details
-
Copy full SHA for 82cdefd - Browse repository at this point
Copy the full SHA 82cdefdView commit details -
Configuration menu - View commit details
-
Copy full SHA for d0c8a31 - Browse repository at this point
Copy the full SHA d0c8a31View commit details -
Configuration menu - View commit details
-
Copy full SHA for 13d7534 - Browse repository at this point
Copy the full SHA 13d7534View commit details -
Configuration menu - View commit details
-
Copy full SHA for 852f52f - Browse repository at this point
Copy the full SHA 852f52fView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.