luis@970: luis@1453: # Log user and project information luis@1453: # luis@1453: # Invoke with e.g. luis@1453: # luis@1453: # ./script/rails runner -e production extra/soundsoftware/get-statistics.rb luis@970: # luis@970: luis@1454: projectStats = { luis@1454: :all => Project.active.all.count, luis@1454: :private => Project.active.find(:all, :conditions => {:is_public => false}).count, luis@1454: :top_level => Project.active.find(:all, :conditions => {:parent_id => nil}).count, luis@1454: :top_level_and_private => Project.active.find(:all, :conditions => {:is_public => false, :parent_id => nil}).count luis@1454: } luis@970: luis@1453: userStats = {:all => User.active.all.count} Chris@1002: luis@1453: stats = {:date => Date.today, :projects => projectStats, :users => userStats}.to_json Chris@1002: luis@1453: print "#{stats}\n" Chris@1002: