Hello,

   The latest sportdb Ruby gem[1] includes new tables (and models) for
group, league and all-time standings. For example, to calculate the
all-time standings table for the World Cup (including all nineteen
tournaments from 1930 to 2010) use the football.db build script[2],
that is, Rakefile, and issue:

  $ rake build DATA=history

  This will import all teams, tournaments, results, and so on and dump
the all-time standing e.g.

  1  Brazil (BRA)                 97   67  15  15  210:88   216  19
  2  Germany (GER)                99   60  19  20  206:117  199  17
  3  Italy (ITA)                  80   44  21  15  126:74   153  17
  ...

 The full results [3] also serve as a great checksum that all
football.db match data is up-to-date and complete.

  Have fun with the World Cup and Ruby. Cheers.

PS: FYI: A look inside the history rake task (surprise, surprise it's all Ruby):

task :history  do
  SportDb.read_setup( 'setups/all',     NATIONAL_TEAMS_INCLUDE_PATH )
  SportDb.read_setup( 'setups/history', NATIONAL_TEAMS_INCLUDE_PATH )
  SportDb.read_setup( 'setups/history', WORLD_CUP_INCLUDE_PATH )

  ## calc alltime standings
  st = SportDb::Model::AlltimeStanding.where( key: 'world'
).first_or_create! do |rec|
    rec.title = 'All Time World Cup'
  end
  st.recalc_for_league!( SportDb::Model::League.find_by_key!( 'world'),
                            includes: { 'ger' => 'frg',
                                    'rus' => 'urs',
                                    'cze' => 'tch',
                                    'srb' => 'yug',
                                    'idn' => 'dei',
                                    'cod' => 'zai' },
                           pts_exclude_scorep: true )

  dump_alltime_standings()
end


[1] github.com/sportdb/sport.db.ruby
[2] github.com/openfootball/build
[3] github.com/openfootball/world-cup/blob/master/stats/alltime.txt