X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/501d13e1c0936cc3ba3d9639620517bae34e5784..5cbd4038edb32b0304bd766e70fc680ea447b52b:/script/statistics
diff --git a/script/statistics b/script/statistics
index ce785bb07..4165bb0d3 100755
--- a/script/statistics
+++ b/script/statistics
@@ -11,11 +11,11 @@ puts "
OpenStreetMap Statistics"
puts ""
puts ""
puts ""
-puts "OpenStreetMap stats report run at #{start_time.to_s}
"
+puts "OpenStreetMap stats report run at #{start_time}
"
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 "Nodes | #{day_count} | #{week_count} | #{month_count} |
"
puts ""
-
+
puts "Top users editing over the past...
"
puts ""
puts "Day | Week | Month |
"
@@ -82,11 +82,11 @@ begin
puts "
"
end
-rescue Exception => e
- puts "Exception: #{e.to_s}
#{e.backtrace.join('
')}
"
+rescue StandardError => e
+ puts "Exception: #{e}
#{e.backtrace.join('
')}
"
end
-puts "Report took #{(Time.new - start_time).to_s} seconds to run
"
+puts "Report took #{(Time.new - start_time)} seconds to run
"
puts ""
puts "