pgn 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/pgn.rb +7 -2
- data/lib/pgn/fen.rb +1 -1
- data/lib/pgn/version.rb +1 -1
- data/spec/fen_spec.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0db25b7764a417bbfa3251343eb6276d2a437ba
|
4
|
+
data.tar.gz: dea50170bb8d9cc50f4d6cbe203c61a6ad4821f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dac8be300ff071e21478f75eaf030c1b1b315ff23e75b195f4456eca309cba28ea70facfdc298d9c2f67c8e1a07511022bf517d04ccfb620175e1de80c5917d
|
7
|
+
data.tar.gz: c32cdb2516e554c60b91d4992f8b495c7e6f0fdc075d9e3a449ab3eb069ec8a0db771c229597f8631635f82ab45f362c12501f4729878dbb087122a8edd194c7
|
data/lib/pgn.rb
CHANGED
@@ -12,8 +12,13 @@ module PGN
|
|
12
12
|
# @param pgn [String] a pgn representation of one or more chess games
|
13
13
|
# @return [Array<PGN::Game>] a list of games
|
14
14
|
#
|
15
|
-
|
16
|
-
|
15
|
+
# @note The PGN spec specifies Latin-1 as the encoding for PGN files, so
|
16
|
+
# this is default.
|
17
|
+
#
|
18
|
+
# @see http://www.chessclub.com/help/PGN-spec PGN Specification
|
19
|
+
#
|
20
|
+
def self.parse(pgn, encoding = Encoding::ISO_8859_1)
|
21
|
+
pgn.force_encoding(encoding) if encoding
|
17
22
|
|
18
23
|
PGN::Parser.new.parse(pgn).map do |game|
|
19
24
|
PGN::Game.new(game[:moves], game[:tags], game[:result])
|
data/lib/pgn/fen.rb
CHANGED
data/lib/pgn/version.rb
CHANGED
data/spec/fen_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pgn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stacey Touset
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: whittle
|