ai_games-parser 0.3.0 → 0.4.0
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 +2 -2
- data/ai_games-parser.gemspec +1 -1
- data/lib/ai_games/parser.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab3e347b26ef931f5614da2c312938a760593ec6
|
4
|
+
data.tar.gz: 6ec06118208f0bac93ab6808bfa35bfb89f5ec08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b12424cd0a25b7e7f5852081b4f11d3286ed655572f7ff59b5390b80270f79181522e61a428f753d10f2125dea70f19264882e0d6ecde559512d39bdd66dbe0
|
7
|
+
data.tar.gz: ba7be2035f705669c0881154582f6e3d69b97dfb8bc9c040287ff397be5cbe5eedfaa4ac1077b2a78323f3ac3c9445e2447adacc6fc29855d22b1ff612d3f8e4
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# AiGames::Parser
|
2
2
|
|
3
3
|
[](https://travis-ci.org/jdno/ai_games-parser)
|
4
4
|
[](https://codeclimate.com/github/jdno/ai_games-parser)
|
@@ -26,7 +26,7 @@ Or install it yourself as:
|
|
26
26
|
|
27
27
|
## Usage
|
28
28
|
|
29
|
-
The gem provides an abstract parser in `
|
29
|
+
The gem provides an abstract parser in `AiGames::Parser`. Extend this class, and
|
30
30
|
overwrite the method `parse(command_array)` to customize your parser for the
|
31
31
|
specific challenge.
|
32
32
|
|
data/ai_games-parser.gemspec
CHANGED
@@ -5,7 +5,7 @@ require 'ai_games/parser'
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'ai_games-parser'
|
8
|
-
spec.version =
|
8
|
+
spec.version = AiGames::Parser::VERSION
|
9
9
|
spec.authors = ['Jan David Nose']
|
10
10
|
spec.email = ['jandavid@awesometechnology.de']
|
11
11
|
|
data/lib/ai_games/parser.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
module
|
1
|
+
module AiGames
|
2
2
|
# This class provides an abstract parser that can be extended to implement
|
3
3
|
# the logic that is required for a specific competition. It provides methods
|
4
4
|
# to communicate with the game engine, but does NOT contain any logic how to
|
5
5
|
# parse the engine's commands. This is totally up to the implementations of
|
6
6
|
# this class.
|
7
7
|
class Parser
|
8
|
-
VERSION = '0.
|
8
|
+
VERSION = '0.4.0'
|
9
9
|
|
10
10
|
# Initializes the parser. Pass in options using a hash structure.
|
11
11
|
def initialize(options = nil)
|
@@ -17,7 +17,7 @@ module AIGames
|
|
17
17
|
# sanitizes the input a little bit, and then passes it to a method that
|
18
18
|
# needs to be overwritten by parsers extending this interface.
|
19
19
|
def run
|
20
|
-
|
20
|
+
AiGames::Logger.info 'Parser.run : Starting loop'
|
21
21
|
|
22
22
|
loop do
|
23
23
|
command = read_from_engine
|
@@ -30,7 +30,7 @@ module AIGames
|
|
30
30
|
write_to_engine response unless response.nil? || response.length < 1
|
31
31
|
end
|
32
32
|
|
33
|
-
|
33
|
+
AiGames::Logger.info 'Parser.run : Stopping loop'
|
34
34
|
end
|
35
35
|
|
36
36
|
# Parses the given command array. This method MUST return a valid response
|