Merge pull request #8836 from MikeMcQuaid/options-nil-array

options: handle `nil` array.
This commit is contained in:
Mike McQuaid 2020-10-02 14:34:56 +01:00 committed by GitHub
commit 7e240288fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,7 +68,7 @@ class Options
include Enumerable
def self.create(array)
new array.map { |e| Option.new(e[/^--([^=]+=?)(.+)?$/, 1] || e) }
new Array(array).map { |e| Option.new(e[/^--([^=]+=?)(.+)?$/, 1] || e) }
end
def initialize(*args)