Updated version for gem with auto-directory create fix