Sha256: 4e8e822dfea30c1c149b71b7b5a4465c982bc3cd9545daabb650789be65e9b8b

Contents?: true

Size: 1.57 KB

Versions: 1

Compression:

Stored size: 1.57 KB

Contents

= ChessIcu

For parsing files of chess tournament data into ruby classes.


== Install

  sudo gem install sanichi-chess_icu --source http://gems.github.com
  
  
== Usage

A tournament (ICU::Tournament) has two or more players (ICU::Player), and each player has one or more results (ICU::Result).

Tournament objects are created by parsing files of various formats. An instance of a class taylored for the type of data
in the file is first created (see below), and then it's parse or parse! method is called with the file's contents as argument.

  data = open('tournament.csv') { |f| f.read }
  tournament = parser.parse(data)

On success, the parse method returns an object of type ICU::Tournament. On error, it returns nil and an error message
can be retrieved from the parser instance:

  parser.error  # => error message or nil on success
  
Alternatively, if an exception is preferred on error, the parse! method can be used:

  tournament = parser.parse!(data)

The file formats supported in the current version are:

* Foreign CSV


=== Foreign CSV

This is a format specific to the ICU[http://icu.ie] ({specification}[http://www.icu.ie/articles/display.php?id=172])
and is used by players to submit their individual results in foreign tournaments for domestic rating.
It's parsed by instances of ICU::Tournament::ForeignCSV.

  parser = ICU::Tournament::ForeignCSV.new
  

== TODO
  
Future versions of this software will be able to parse more common formats such as SwissPerfect and FIDE's Krause format.


== Author

  Mark Orr, rating officer for the Irish Chess Union (ICU[http://icu.ie]).

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sanichi-chess_icu-0.2.0 README.rdoc