Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into improve-oob-hook
Browse files Browse the repository at this point in the history
  • Loading branch information
wjordan committed Apr 26, 2020
2 parents 5956969 + 883b861 commit d416d0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions History.md
Expand Up @@ -38,6 +38,7 @@
* Fixed a few minor concurrency bugs in ThreadPool that may have affected non-GVL Rubies (#2220)
* 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)
* Improvements to `out_of_band` hook (#2234)

* Refactor
Expand Down
10 changes: 6 additions & 4 deletions lib/puma/configuration.rb
Expand Up @@ -54,17 +54,19 @@ def initialize(user_options, default_options)
attr_reader :user_options, :file_options, :default_options

def [](key)
return user_options[key] if user_options.key?(key)
return file_options[key] if file_options.key?(key)
return default_options[key] if default_options.key?(key)
fetch(key)
end

def []=(key, value)
user_options[key] = value
end

def fetch(key, default_value = nil)
self[key] || default_value
return user_options[key] if user_options.key?(key)
return file_options[key] if file_options.key?(key)
return default_options[key] if default_options.key?(key)

default_value
end

def all_of(key)
Expand Down

0 comments on commit d416d0c

Please sign in to comment.