def self.write(filename, data, options = {}) # rubocop:disable MethodLength, AbcSize
      write_options = WriteOptions.new(filename, options)

      FileUtils.mkdir_p(::File.dirname(filename))
      ::File.open(filename, 'w+', write_options.perm) do |file|