software_challenge_client 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 31495d828f8c74923ec05f993fac6c9ede09cc24
4
- data.tar.gz: f39a179740dcf650a29f5d935a812a514f875ec7
3
+ metadata.gz: ea1997c65515d492cd8a99cd8fe7069ed5486b08
4
+ data.tar.gz: 4533a7f40fe280278eb0d10fd6afacde7b0a8c8f
5
5
  SHA512:
6
- metadata.gz: 6a20c8cf937d09ebd0a4176018e2f9d414a44e17d44c82e3fd832c5c95f5dc00cdf0592e7937775a2d25aee575bc4e86449a629075d577807c7c6383ea80a129
7
- data.tar.gz: 04fec5b6316034416e066c75214aa5d717ee7f1f5cc93bd5cc291c159dace9f8e0b9a8162b3f9ed5fdb0a89c6656be0cfe18e38b42fb02727a20ed7584ae8c31
6
+ metadata.gz: 46d1621bc76f4510d3d59f11d7e4d4d2addaa1b3d9eb411c79e221d8aae8eae7484ed6b81a27a3bb465bc82ed5d8a1f6b0e2ad345280deebbfda37d28659c6c7
7
+ data.tar.gz: 88854720a31730260411c5029995aefdeb97cea404657fdc62bb66532bcbea27525d27f47c337edbbdb7b117ab226b7460857fe71938ae592dfefcfede504a41
data/RELEASES.md CHANGED
@@ -1,3 +1,11 @@
1
+ = 0.1.4
2
+
3
+ - Added support for reservation ID to let clients work on contest system.
4
+
5
+ = 0.1.3
6
+
7
+ - Fixed bug in makeClearBoard method (thanks to wollw!).
8
+
1
9
  = 0.1.2
2
10
 
3
11
  - Fixed bug in == (test for equality) method of connections (thanks to
data/example/main.rb CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  # encoding: UTF-8
2
3
  require 'software_challenge_client'
3
4
  require 'optparse'
@@ -23,6 +24,10 @@ opt_parser = OptionParser.new do |opt|
23
24
  options.host = h
24
25
  end
25
26
 
27
+ opt.on("-r","--reservation RESERVATION","the host's RESERVATION (default #{options.reservation})") do |r|
28
+ options.reservation = r
29
+ end
30
+
26
31
  opt.on_tail("-?", "--help", "Show this message") do
27
32
  puts opt
28
33
  exit
@@ -33,5 +38,5 @@ end
33
38
  opt_parser.parse!(ARGV)
34
39
 
35
40
  client = Client.new
36
- runner = Runner.new(options.host, options.port, client)
41
+ runner = Runner.new(options.host, options.port, client, options.reservation)
37
42
  runner.start()
@@ -24,12 +24,12 @@ class Network
24
24
  # @return [Boolean] true, if the client is connected to a server
25
25
  attr_reader :connected
26
26
 
27
- def initialize(host, port, board, client)
27
+ def initialize(host, port, board, client, reservation = nil)
28
28
  @host, @port, @connected, @board, @client =
29
29
  host, port, false, board, client
30
30
 
31
31
  @protocol = Protocol.new(self, @client)
32
- @reservationID = ''
32
+ @reservationID = reservation || ''
33
33
  @receiveBuffer = ''
34
34
 
35
35
  puts '> Network/Socket created.'
@@ -144,4 +144,4 @@ class Network
144
144
  self.sendString(text);
145
145
  end
146
146
 
147
- end
147
+ end
@@ -6,14 +6,14 @@ require_relative 'network'
6
6
  class Runner
7
7
  attr_reader :network
8
8
 
9
- def initialize(host, port, client)
9
+ def initialize(host, port, client, reservation = nil)
10
10
  puts 'Software Challenge 2015'
11
11
  puts 'Ruby Client'
12
12
  puts "Host: #{host}"
13
13
  puts "Port: #{port}"
14
14
 
15
15
  board = Board.new(true)
16
- @network = Network.new(host, port, board, client)
16
+ @network = Network.new(host, port, board, client, reservation)
17
17
  end
18
18
 
19
19
  def start
@@ -1,4 +1,4 @@
1
1
  # encoding: UTF-8
2
2
  module SoftwareChallengeClient
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: software_challenge_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ralf-Tobias Diekert
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-08 00:00:00.000000000 Z
11
+ date: 2016-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler