class Bundler::Dsl
def validate_keys(command, opts, valid_keys)
def validate_keys(command, opts, valid_keys) invalid_keys = opts.keys - valid_keys if invalid_keys.any? message = "You passed #{invalid_keys.map {|k| ":" + k }.join(", ")} " message << if invalid_keys.size > 1 "as options for #{command}, but they are invalid." else "as an option for #{command}, but it is invalid." end message << " Valid options are: #{valid_keys.join(", ")}" raise InvalidOption, message end end