lib/google_apps/transport.rb in google_apps-0.3.1 vs lib/google_apps/transport.rb in google_apps-0.3.2

- old
+ new

@@ -79,19 +79,20 @@ # TODO: Return actual status not whole body. (@response = request(uri)).body end - def fetch_export(flename) # :nodoc: + def fetch_export(username, req_id, filename) # :nodoc: # TODO: Shouldn't rely on export_status being run first. Self, this is lazy and stupid. + export_status(username, req_id) doc = REXML::Document.new(@response.body) urls = [] doc.elements.each('entry/apps:property') do |property| urls << property.attributes['value'] if property.attributes['name'].match 'fileUrl' end urls.each do |url| - download(url, filename) + download(url, filename + "#{urls.index[url]}") end end # download makes a get request of the provided url # and writes the body to the provided filename. \ No newline at end of file