You could probably return the unless statements on the return for both get_docroots and find_wordpress, and here, as well, then just on line 100, have that set the value unless found.empty?