Fix datastore to validate options w/o a default

Options without a default were not pulled into the `@options` hash and
therefore were not used to validate options on assignment.

I am not entirely sure how this fix works, since it would seem that
non-override options would not get pulled in if an option was first set
in the global datastore. However, a previous value does not get
overridden and new values are validated. Anything further is merely
speculation on my part.
bug/bundler_fix
Adam Cammack 2016-03-22 19:12:53 -05:00
parent 5c163960ed
commit 22df7c0071
No known key found for this signature in database
GPG Key ID: C9378BA088092D66
1 changed files with 1 additions and 2 deletions

View File

@ -75,8 +75,7 @@ class DataStore < Hash
#
def import_options(options, imported_by = nil, overwrite = false)
options.each_option do |name, opt|
# Skip options without a default or if is already a value defined
if !opt.default.nil? && (self[name].nil? || overwrite)
if self[name].nil? || overwrite
import_option(name, opt.default, true, imported_by, opt)
end
end