chess_openings 1.0.1 → 1.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 +4 -4
- data/README.md +10 -13
- data/chess_openings.gemspec +1 -3
- metadata +3 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5139093279a5a3669d3520bcdc2485bf17808ba4
|
4
|
+
data.tar.gz: 91fe2f9e06fd36b1d2ff0adb34d7bb1c20c5a36b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63f9dc880716fa0345212719c46baf9104e1ef3f5870ebbc9c01a5024aab2087271914995186e9dfb46db291de5d992092b20bfd8773deb22b19791895b16771
|
7
|
+
data.tar.gz: 47ae4f4f58ae6240892d4fd4638d20a45eb519adc43857f27f4fcc66a42793d29ad8aa2312404f087bd2453f302524126d66c48125ee5041ae8fd224c4d19d9e
|
data/README.md
CHANGED
@@ -2,6 +2,7 @@ Chess Openings
|
|
2
2
|
==========================
|
3
3
|
Ruby gem that where you can manipulate, search for and get information from chess openings.
|
4
4
|
|
5
|
+
Search, manipulate and get information on chess openings
|
5
6
|
## Features:
|
6
7
|
- Get opening from PGN file
|
7
8
|
- Get opening from PGN string
|
@@ -39,7 +40,7 @@ chess_openings = ChessOpenings.new
|
|
39
40
|
|
40
41
|
From here you can use several functions:
|
41
42
|
|
42
|
-
|
43
|
+
#### .from_pgn
|
43
44
|
Get opening from PGN file
|
44
45
|
|
45
46
|
```ruby
|
@@ -49,7 +50,7 @@ opening = chess_openings.from_pgn('path_to/pgn_game.pgn')
|
|
49
50
|
```
|
50
51
|
|
51
52
|
|
52
|
-
|
53
|
+
#### .from_string
|
53
54
|
Get opening from a string, formated like a PGN file
|
54
55
|
|
55
56
|
```ruby
|
@@ -59,7 +60,7 @@ opening = chess_openings.from_string("1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Bxc6")
|
|
59
60
|
```
|
60
61
|
|
61
62
|
|
62
|
-
|
63
|
+
#### .from_moves
|
63
64
|
Get opening from an array with moves (as symbols or strings)
|
64
65
|
|
65
66
|
```ruby
|
@@ -68,7 +69,7 @@ opening = chess_openings.from_moves [:e4, :c6, :d4, :d5]
|
|
68
69
|
#=> #<Opening:0x007f8209d9c910 @name="Caro-Kann defence", @eco_code="B12", @moves=[:e4, :c6, :d4, :d5]>
|
69
70
|
```
|
70
71
|
|
71
|
-
|
72
|
+
#### .with_name
|
72
73
|
Search openings by name
|
73
74
|
|
74
75
|
```ruby
|
@@ -84,7 +85,7 @@ openings = chess_openings.with_name "alekhine defence"
|
|
84
85
|
=end
|
85
86
|
```
|
86
87
|
|
87
|
-
|
88
|
+
#### .all
|
88
89
|
Get all existing openings as an array
|
89
90
|
|
90
91
|
```ruby
|
@@ -100,7 +101,7 @@ all_openings = chess_openings.all
|
|
100
101
|
=end
|
101
102
|
```
|
102
103
|
|
103
|
-
|
104
|
+
#### .that_start_with
|
104
105
|
Get all possible openings that start with determined moves
|
105
106
|
|
106
107
|
```ruby
|
@@ -119,7 +120,7 @@ e4_e5_openings = chess_openings.that_start_with [:e4, :e5]
|
|
119
120
|
=end
|
120
121
|
```
|
121
122
|
|
122
|
-
|
123
|
+
#### .from_fen
|
123
124
|
Get opening from FEN string
|
124
125
|
|
125
126
|
```ruby
|
@@ -127,13 +128,9 @@ opening_from_fen = chess_openings.from_fen 'rnbqkbnr/pppp1ppp/8/4p3/4P3/8/PPPP1P
|
|
127
128
|
#=> #<Opening:0x007ff69c858258 @name="King's pawn game", @eco_code="C20", @moves=[:e4, :e5]>
|
128
129
|
```
|
129
130
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
131
|
When you have a opening you can invoke these methods on it:
|
135
132
|
|
136
|
-
|
133
|
+
#### .to_pgn
|
137
134
|
Get PGN string from an opening
|
138
135
|
|
139
136
|
```ruby
|
@@ -143,7 +140,7 @@ opening.to_pgn
|
|
143
140
|
#=> "1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Bxc6"
|
144
141
|
```
|
145
142
|
|
146
|
-
|
143
|
+
#### .to_fen
|
147
144
|
Get FEN string of the opening
|
148
145
|
|
149
146
|
```ruby
|
data/chess_openings.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'chess_openings'
|
7
|
-
spec.version = '1.0.
|
7
|
+
spec.version = '1.0.2'
|
8
8
|
spec.authors = ['Simão Neves']
|
9
9
|
spec.email = ['simaocostaneves@gmail.com']
|
10
10
|
|
@@ -17,11 +17,9 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.license = 'MIT'
|
18
18
|
|
19
19
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
-
spec.executables << 'openings_parser'
|
21
20
|
spec.require_paths = ['lib']
|
22
21
|
|
23
22
|
spec.add_dependency 'pgn', '0.1.1'
|
24
|
-
spec.add_dependency 'nokogiri', '1.6.6.2'
|
25
23
|
spec.add_development_dependency 'bundler', '~> 1.8'
|
26
24
|
spec.add_development_dependency 'rspec', '~> 3.3.0'
|
27
25
|
spec.add_development_dependency 'rake', '~> 10.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chess_openings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simão Neves
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pgn
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.1.1
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: nokogiri
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - '='
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.6.6.2
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - '='
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 1.6.6.2
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: bundler
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -112,8 +98,7 @@ description: Gem that allows you to know what chess opening was used in a chess
|
|
112
98
|
find chess openings by name or get all openings that start with certain moves
|
113
99
|
email:
|
114
100
|
- simaocostaneves@gmail.com
|
115
|
-
executables:
|
116
|
-
- openings_parser
|
101
|
+
executables: []
|
117
102
|
extensions: []
|
118
103
|
extra_rdoc_files: []
|
119
104
|
files:
|