This approach of passing a zip construct into the exporter feels quite awkward; the new code in the exporter (in the bonnie_bundler pull request) feels even more awkward (setting a zip instance variable, which is referenced in the "write_file" method, which then doesn't actually write a file...).

I think refactoring this into something like

    config = ...
    exporter = Measures::Exporter::BundleExporter.new(measures, config)
    zip_data = exporter.export_zip
    
    cookies[:fileDownload] = "true" # We need to set this cookie for jquery.fileDownload
    
    send_data zip_data, :type => 'application/zip', :disposition => 'attachment', :filename => "bundle_#{user.email}_export.zip"

would clean things up quite a bit.