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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 665f027ae63b2c171832fe0534254100735b0d18
4
- data.tar.gz: 74818c2328408f318a9fb44572634aa22922fe71
3
+ metadata.gz: b0db25b7764a417bbfa3251343eb6276d2a437ba
4
+ data.tar.gz: dea50170bb8d9cc50f4d6cbe203c61a6ad4821f5
5
5
  SHA512:
6
- metadata.gz: 8f6aa38b81c6ea3e3ae3b7d7ba4f687c2a269c09880fe711ab874f9d3937958789ff78479edab10a2a7d3bfbfe6b272b1e254d5f9fbbad1387ffec50022c5880
7
- data.tar.gz: 02b9897e144b842fd7fe30aaee2d41c9c58393b207602bfb54c4f34f2d2fdbb6342e81bacdc50c975a590d3200858313efeeda8aaaf3458d6b2b46dc3068037b
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
- def self.parse(pgn)
16
- pgn.force_encoding(Encoding::ISO_8859_1)
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
@@ -132,7 +132,7 @@ module PGN
132
132
  #
133
133
  def to_s
134
134
  [
135
- self.fen_string,
135
+ self.board_string,
136
136
  self.active,
137
137
  self.castling,
138
138
  self.en_passant,
data/lib/pgn/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module PGN
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/spec/fen_spec.rb CHANGED
@@ -84,4 +84,11 @@ describe PGN::FEN do
84
84
  next_pos.to_fen.fullmove.should == "26"
85
85
  end
86
86
  end
87
+
88
+ describe "displaying FEN notation" do
89
+ it "should return a string on inspect" do
90
+ fen = PGN::FEN.start
91
+ fen.inspect.should be_a(String)
92
+ end
93
+ end
87
94
  end
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
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-09 00:00:00.000000000 Z
11
+ date: 2013-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: whittle