chess2png 0.0.1 → 0.0.2

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: 546fa4ff5e9bb17384f6ea69659e25c68134aa81
4
- data.tar.gz: 649369a75d2c0e4a9db25f9663590f68e1a56914
3
+ metadata.gz: c21078845d9d63a9c88e9568d767d0827ce4c99e
4
+ data.tar.gz: bd8e89c0e39c2750fc0492e3b124b0d978cc3b9c
5
5
  SHA512:
6
- metadata.gz: ce49b144df33f71d26efdba166d3d6fe7b29806ec4a2dbcf420b85c452b972fd4fafe5565ecdd574065a879fe125504a1dfd0fa337f90e61b11e1379a57cb805
7
- data.tar.gz: c676a7978c6dc250cba8e643bdf99b7100ecc6021d4cd466f29701a97ef0f385959f670b0a8c4024fd04106081e1b5d17236bd6500666921a282f3711db5b0c6
6
+ metadata.gz: 3151170270bd6a148b7a896df5445a509f04e40ea87da20730bfdedd1296388d0f5950f78a0c3ccd5711fb759b04c0dedbee6af2c835f94501e32e49c1770318
7
+ data.tar.gz: ebb36b21266446fbb9c7da23d5c6417ae4e8a3e70aca8374b0f34f2cbfa8257bd8eca90e81bf0b267b2b174e724371b4e7a5922c6bee902fdf3c1dd1d16f117c
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  out.png
2
2
  test.pgn
3
+ *.gem
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- chess2png (0.0.1)
4
+ chess2png (0.0.2)
5
5
  chess (~> 0.2.0)
6
6
  chunky_png (~> 1.3.8)
7
7
 
@@ -0,0 +1,55 @@
1
+ # Chess2PNG
2
+
3
+ ## Installation
4
+
5
+ You know the drill.
6
+
7
+ ```
8
+ gem install chess2png
9
+ ```
10
+
11
+ Or, in your Gemfile:
12
+
13
+ ```
14
+ gem "chess2png"
15
+ ```
16
+
17
+ ## Command usage
18
+
19
+ The `chess2png` command is pretty simple, more options will come:
20
+
21
+ ```
22
+ Usage: chess2png -i input -o output
23
+ -i, --input PATH Path to a PGN file
24
+ -o, --output PATH Path where the resulting PNG file will be saved
25
+ ```
26
+
27
+ With an example PGN file:
28
+
29
+ ```
30
+ cat <<EOM >test.pgn
31
+ [Event "chp"]
32
+ [Site "USA"]
33
+ [Date "1956.??.??"]
34
+ [Round "?"]
35
+ [White "Byrne, D."]
36
+ [Black "Fischer, R."]
37
+ [Result "0-1"]
38
+ 1.Nf3 Nf6 2.c4 g6 3.Nc3 Bg7 4.d4 O-O 5.Bf4 d5 6.Qb3 dxc4 7.Qxc4 c6 8.e4 Nbd7 9.Rd1 Nb6 10.Qc5 Bg4 11.Bg5 Na4 12.Qa3 Nxc3 13.bxc3 Nxe4 14.Bxe7 Qb6 15.Bc4 Nxc3 16.Bc5 Rfe8+ 17.Kf1 Be6 18.Bxb6 Bxc4+ 19.Kg1 Ne2+ 20.Kf1 Nxd4+ 21.Kg1 Ne2+ 22.Kf1 Nc3+ 23.Kg1 axb6 24.Qb4 Ra4 25.Qxb6 Nxd1 26.h3 Rxa2 27.Kh2 Nxf2 28.Re1 Rxe1 29.Qd8+ Bf8 30.Nxe1 Bd5 31.Nf3 Ne4 32.Qb8 b5 33.h4 h5 34.Ne5 Kg7 35.Kg1 Bc5+ 36.Kf1 Ng3+ 37.Ke1 Bb4+ 38.Kd1 Bb3+ 39.Kc1 Ne2+ 40.Kb1 Nc3+ 41.Kc1 Rc2+ 0-1
39
+ EOM
40
+
41
+ chess2png -i test.pgn -o out.png
42
+ ```
43
+
44
+ ![Output](https://i.imgur.com/T3BvYeJ.png)
45
+
46
+ ## Library usage
47
+
48
+ `chess2png` is heavily based on [Chess](https://github.com/pioz/chess) and [chunky_png](https://github.com/wvanbergen/chunky_png) and it dont really
49
+ try to hide them away. It takes a `Chess::Board` instance and output a `ChunkyPNG::Image`.
50
+
51
+ ```
52
+ board = Chess::Game.load_pgn(options[:input]).current
53
+ image = Chess2PNG.new.encode(board)
54
+ image.save(options[:output])
55
+ ```
Binary file
@@ -1,3 +1,3 @@
1
1
  class Chess2PNG
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chess2png
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Goya
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-15 00:00:00.000000000 Z
11
+ date: 2017-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chess
@@ -63,6 +63,7 @@ files:
63
63
  - ".gitignore"
64
64
  - Gemfile
65
65
  - Gemfile.lock
66
+ - README.md
66
67
  - assets/Chess_bdt60.png
67
68
  - assets/Chess_blt60.png
68
69
  - assets/Chess_kdt60.png