]> git.openstreetmap.org Git - rails.git/blobdiff - script/statistics
Fix rubocop style issues
[rails.git] / script / statistics
index ce785bb07741523e483cd782dd7e82930b7fcbd3..4165bb0d36fd8237f033836f38e014cb68c60938 100755 (executable)
@@ -11,11 +11,11 @@ puts "<title>OpenStreetMap Statistics</title>"
 puts "<style>th { text-align: left }</style>"
 puts "</head>"
 puts "<body>"
-puts "<h2>OpenStreetMap stats report run at #{start_time.to_s}</h2>"
+puts "<h2>OpenStreetMap stats report run at #{start_time}</h2>"
 
 begin
   ActiveRecord::Base.transaction do
-    user_count = User.where(:status => ["active", "confirmed", "suspended"]).count
+    user_count = User.where(:status => %w(active confirmed suspended)).count
     tracepoint_count = Tracepoint.count
     node_count = Node.where(:visible => true).count
     way_count = Way.where(:visible => true).count
@@ -57,7 +57,7 @@ begin
     puts "<tr><th>Nodes</th><td>#{day_count}</td><td>#{week_count}</td><td>#{month_count}</td></tr>"
 
     puts "</table>"
-  
+
     puts "<h2>Top users editing over the past...</h2>"
     puts "<table>"
     puts "<tr><th>Day</th><th>Week</th><th>Month</th></tr>"
@@ -82,11 +82,11 @@ begin
 
     puts "</table>"
   end
-rescue Exception => e
-  puts "<p><em>Exception: #{e.to_s}</em><br />#{e.backtrace.join('<br />')}</p>"
+rescue StandardError => e
+  puts "<p><em>Exception: #{e}</em><br />#{e.backtrace.join('<br />')}</p>"
 end
 
-puts "<p>Report took #{(Time.new - start_time).to_s} seconds to run</p>"
+puts "<p>Report took #{(Time.new - start_time)} seconds to run</p>"
 puts "</body>"
 puts "</html>"