Sha256: 653f4509354c93b92d7b5044f48c508a84e95f6ec8aab773c01992c3d0fab609

Contents?: true

Size: 1.4 KB

Versions: 7

Compression:

Stored size: 1.4 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 that can handle the format
(see below for the available classes) is first created, and then it's <em>parse</em> or <em>parse!</em> method is called
with the file's contents as the only argument.

  require 'chess_icu'
  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 <em>parse!</em> method can be used:

  tournament = parser.parse!(data)

The file formats supported in the current version are:

* Foreign CSV (ICU::Tournament::ForeignCSV) - for players to report their individual results in foreign tournaments


== TODO
  
Future versions of this software will be able to parse other types of files 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

7 entries across 7 versions & 1 rubygems

Version Path
sanichi-chess_icu-0.2.10 README.rdoc
sanichi-chess_icu-0.2.4 README.rdoc
sanichi-chess_icu-0.2.5 README.rdoc
sanichi-chess_icu-0.2.6 README.rdoc
sanichi-chess_icu-0.2.7 README.rdoc
sanichi-chess_icu-0.2.8 README.rdoc
sanichi-chess_icu-0.2.9 README.rdoc