Sha256: 082099972b122f9b80fcd08499089b7148de13ba4e0aa23b68e55fa5742390f4

Contents?: true

Size: 1.52 KB

Versions: 19

Compression:

Stored size: 1.52 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.txt') { |f| f.read }
  parser = ICU::Tournament::Parser.new  # substitute the name of an available parser (see below) for "Parser"
  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 currently available parsers are:

* ICU::Tournament::Krause - the format used by FIDE
* ICU::Tournament::ForeignCSV - used by Irish players to report their individual results in foreign tournaments


== TODO
  
Future versions of this software will be able to parse additional file formats (such as SwissPerfect).


== Author

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

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
sanichi-chess_icu-0.3.2 README.rdoc
sanichi-chess_icu-0.3.3 README.rdoc
sanichi-chess_icu-0.3.4 README.rdoc
sanichi-chess_icu-0.3.5 README.rdoc
sanichi-chess_icu-0.4.0 README.rdoc
sanichi-chess_icu-0.4.1 README.rdoc
sanichi-chess_icu-0.4.10 README.rdoc
sanichi-chess_icu-0.4.2 README.rdoc
sanichi-chess_icu-0.4.3 README.rdoc
sanichi-chess_icu-0.4.4 README.rdoc
sanichi-chess_icu-0.4.5 README.rdoc
sanichi-chess_icu-0.4.6 README.rdoc
sanichi-chess_icu-0.4.7 README.rdoc
sanichi-chess_icu-0.4.8 README.rdoc
sanichi-chess_icu-0.4.9 README.rdoc
sanichi-chess_icu-0.5.0 README.rdoc
sanichi-chess_icu-0.5.1 README.rdoc
sanichi-chess_icu-0.5.2 README.rdoc
sanichi-chess_icu-0.5.3 README.rdoc