commondream-google-spreadsheet-ruby 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/google_spreadsheet.rb +6 -8
- metadata +1 -1
data/lib/google_spreadsheet.rb
CHANGED
@@ -486,20 +486,20 @@ module GoogleSpreadsheet
|
|
486
486
|
|
487
487
|
while current_cell < cells
|
488
488
|
batch_count = 0
|
489
|
-
xml = <<-
|
489
|
+
xml = <<-EOS
|
490
490
|
<feed xmlns="http://www.w3.org/2005/Atom"
|
491
491
|
xmlns:batch="http://schemas.google.com/gdata/batch"
|
492
492
|
xmlns:gs="http://schemas.google.com/spreadsheets/2006">
|
493
493
|
<id>#{h(@cells_feed_url)}</id>
|
494
494
|
EOS
|
495
495
|
|
496
|
-
|
496
|
+
until batch_count >= 250
|
497
497
|
row,col = @modified[current_cell]
|
498
498
|
value = @cells[[row, col]]
|
499
499
|
entry = cell_entries[[row, col]]
|
500
500
|
id = entry.search("id").text
|
501
501
|
edit_url = entry.search("link[@rel='edit']")[0]["href"]
|
502
|
-
xml << <<-
|
502
|
+
xml << <<-EOS
|
503
503
|
<entry>
|
504
504
|
<batch:id>#{h(row)},#{h(col)}</batch:id>
|
505
505
|
<batch:operation type="update"/>
|
@@ -511,13 +511,11 @@ module GoogleSpreadsheet
|
|
511
511
|
EOS
|
512
512
|
|
513
513
|
# close each batch out at 500 cells
|
514
|
-
current_cell
|
515
|
-
batch_count
|
514
|
+
current_cell +=1
|
515
|
+
batch_count += 1
|
516
516
|
end
|
517
517
|
|
518
|
-
xml <<
|
519
|
-
</feed>
|
520
|
-
EOS
|
518
|
+
xml << "</feed>"
|
521
519
|
|
522
520
|
result = @session.post("#{@cells_feed_url}/batch", xml)
|
523
521
|
for entry in result.search("atom:entry")
|