Class: WorldDb::Stats

Inherits:
Object
  • Object
show all
Includes:
Models
Defined in:
lib/worlddb/stats.rb,
lib/worlddb/stats_comp.rb

Instance Method Summary collapse

Instance Method Details

#propsObject

fix: move to ConfDb for (re)use - do not use - use Props.dump or similar!!!!!



10
11
12
13
14
15
16
17
# File 'lib/worlddb/stats_comp.rb', line 10

def props
  puts "deprecated API - WorldDb::Stats.props  -- use Props.dump or similar"
  
  puts "Props:"
  Prop.order( 'created_at asc' ).all.each do |prop|
    puts "  #{prop.key} / #{prop.value} || #{prop.created_at}"
  end
end

#tablesObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/worlddb/stats.rb', line 8

def tables
  puts "Stats:"
  puts " #{'%5d' % Continent.count} continents"
  puts " #{'%5d' % Country.count} countries (#{Country.where(s: true).count} supras, #{Country.where(d:true).count} deps)"
  puts " #{'%5d' % Region.count} regions"
  puts " #{'%5d' % City.where(m: true).where(c: false).count} metros"
  puts " #{'%5d' % City.where(c: true).count} cities (#{City.where(c: true).where(m: true).count} metros)"
  puts " #{'%5d' % City.where(d: true).count} districts"
#      puts " #{'%5d' % Tag.count} tags"
#      puts " #{'%5d' % Tagging.count} taggings"
  puts " #{'%5d' % Place.count} places"
  puts " #{'%5d' % Name.count} names"
  puts " #{'%5d' % Lang.count} langs"
  puts " #{'%5d' % Usage.count} usages"
end