]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/planet/files/default/replication-bin/replicate-changesets
Remove trailing whitespace in ruby code
[chef.git] / cookbooks / planet / files / default / replication-bin / replicate-changesets
index 443d8ede30b91cf6591bfd33d701e563c5c39bf3..8cdc26e7aa2fe93475b2a61c904a5a34e807c385 100644 (file)
@@ -57,7 +57,7 @@ class Replicator
     last_run = (@now - 60) if last_run.nil?
     @state['last_run'] = @now
     # pretty much all operations on a changeset will modify its closed_at
-    # time (see rails_port's changeset model). so it is probably enough 
+    # time (see rails_port's changeset model). so it is probably enough
     # for us to look at anything that was closed recently, and filter from
     # there.
     @conn.
@@ -66,7 +66,7 @@ class Replicator
       select {|cs| cs.activity_between?(last_run, @now) }
   end
 
-  # creates an XML file containing the changeset information from the 
+  # creates an XML file containing the changeset information from the
   # list of changesets output by open_changesets.
   def changeset_dump(changesets)
     doc = XML::Document.new
@@ -84,6 +84,7 @@ class Replicator
       xml['created_at'] = cs.created_at.getutc.xmlschema
       xml['closed_at'] = cs.closed_at.getutc.xmlschema if cs.closed?(@now)
       xml['open'] = cs.open?(@now).to_s
+      xml['num_changes'] = cs.num_changes.to_s
 
       res = @conn.exec("select u.id, u.display_name, c.min_lat, c.max_lat, c.min_lon, c.max_lon from users u join changesets c on u.id=c.user_id where c.id=#{cs.id}")
       xml['user'] = res[0]['display_name']
@@ -109,7 +110,7 @@ class Replicator
 
       doc.root << xml
     end
-    
+
     doc.to_s
   end
 
@@ -149,4 +150,3 @@ end
 
 rep = Replicator.new(ARGV[0])
 rep.save!
-