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 +4 -4
- data/RELEASES.md +8 -0
- data/example/main.rb +6 -1
- data/lib/software_challenge_client/network.rb +3 -3
- data/lib/software_challenge_client/runner.rb +2 -2
- data/lib/software_challenge_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea1997c65515d492cd8a99cd8fe7069ed5486b08
|
4
|
+
data.tar.gz: 4533a7f40fe280278eb0d10fd6afacde7b0a8c8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46d1621bc76f4510d3d59f11d7e4d4d2addaa1b3d9eb411c79e221d8aae8eae7484ed6b81a27a3bb465bc82ed5d8a1f6b0e2ad345280deebbfda37d28659c6c7
|
7
|
+
data.tar.gz: 88854720a31730260411c5029995aefdeb97cea404657fdc62bb66532bcbea27525d27f47c337edbbdb7b117ab226b7460857fe71938ae592dfefcfede504a41
|
data/RELEASES.md
CHANGED
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
|
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.
|
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:
|
11
|
+
date: 2016-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|