acpc_dealer 2.4.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Brickfile +6 -0
- data/README.md +7 -6
- data/Rakefile +30 -14
- data/acpc_dealer.gemspec +2 -1
- data/bin/acpc_dealer +4 -0
- data/ext/hand_evaluator/extconf.rb +10 -0
- data/lib/acpc_dealer/version.rb +1 -1
- data/lib/hand_evaluator.bundle +0 -0
- data/spec/dealer_runner_spec.rb +76 -72
- metadata +19 -82
- data/vendor/project_acpc_server/LICENCE +0 -23
- data/vendor/project_acpc_server/Makefile +0 -35
- data/vendor/project_acpc_server/README +0 -113
- data/vendor/project_acpc_server/README.submission +0 -42
- data/vendor/project_acpc_server/acpc_play_match.pl +0 -101
- data/vendor/project_acpc_server/bm_run_matches.c +0 -238
- data/vendor/project_acpc_server/bm_server.c +0 -1604
- data/vendor/project_acpc_server/bm_server.config +0 -78
- data/vendor/project_acpc_server/bm_widget.c +0 -230
- data/vendor/project_acpc_server/dealer.c +0 -1293
- data/vendor/project_acpc_server/evalHandTables +0 -4269
- data/vendor/project_acpc_server/example_player.c +0 -204
- data/vendor/project_acpc_server/example_player.limit.2p.sh +0 -3
- data/vendor/project_acpc_server/example_player.limit.3p.sh +0 -3
- data/vendor/project_acpc_server/example_player.nolimit.2p.sh +0 -3
- data/vendor/project_acpc_server/example_player.nolimit.3p.sh +0 -3
- data/vendor/project_acpc_server/game.c +0 -1792
- data/vendor/project_acpc_server/game.h +0 -253
- data/vendor/project_acpc_server/holdem.limit.2p.reverse_blinds.game +0 -13
- data/vendor/project_acpc_server/holdem.limit.3p.game +0 -13
- data/vendor/project_acpc_server/holdem.nolimit.2p.reverse_blinds.game +0 -12
- data/vendor/project_acpc_server/holdem.nolimit.3p.game +0 -12
- data/vendor/project_acpc_server/kuhn.limit.3p.game +0 -14
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player.sf1.sh +0 -3
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player.sf2.sh +0 -3
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player.sf3.sh +0 -3
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/LICENCE +0 -23
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/Makefile +0 -127
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/README.md +0 -35
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/src/CExceptionConfig.h +0 -12
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/src/dealer_connection.c +0 -49
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/src/dealer_connection.h +0 -22
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/src/kuhn_3p_equilibrium_player.c +0 -483
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/src/kuhn_3p_equilibrium_player.h +0 -108
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/src/main.c +0 -84
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/src/player_config.c +0 -253
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/src/player_config.h +0 -21
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/test/support/test_helper.c +0 -45
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/test/support/test_helper.h +0 -27
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/test/test_kuhn_3p_equilibrium_player.c +0 -698
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/test/test_kuhn_3p_equilibrium_player_sub_family_1.c +0 -324
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/test/test_kuhn_3p_equilibrium_player_sub_family_2.c +0 -262
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/test/test_kuhn_3p_equilibrium_player_sub_family_3.c +0 -177
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/cexception/docs/license.txt +0 -30
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/cexception/docs/readme.txt +0 -242
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/cexception/lib/CException.c +0 -43
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/cexception/lib/CException.h +0 -86
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/cexception/release/build.info +0 -2
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/cexception/release/version.info +0 -2
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/commander.c/History.md +0 -27
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/commander.c/Makefile +0 -8
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/commander.c/Readme.md +0 -103
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/commander.c/package.json +0 -9
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/commander.c/src/commander.c +0 -250
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/commander.c/src/commander.h +0 -88
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/commander.c/test.c +0 -34
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/auto/colour_prompt.rb +0 -94
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/auto/colour_reporter.rb +0 -39
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/auto/generate_config.yml +0 -36
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/auto/generate_module.rb +0 -202
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/auto/generate_test_runner.rb +0 -316
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/auto/test_file_filter.rb +0 -23
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/auto/unity_test_summary.rb +0 -139
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/docs/Unity Summary.txt +0 -216
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/docs/license.txt +0 -31
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/release/build.info +0 -2
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/release/version.info +0 -2
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/src/unity.c +0 -1146
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/src/unity.h +0 -245
- data/vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/src/unity_internals.h +0 -546
- data/vendor/project_acpc_server/net.c +0 -218
- data/vendor/project_acpc_server/net.h +0 -62
- data/vendor/project_acpc_server/play_match.pl +0 -99
- data/vendor/project_acpc_server/protocol.md +0 -239
- data/vendor/project_acpc_server/protocol.odt +0 -0
- data/vendor/project_acpc_server/protocol.pdf +0 -0
- data/vendor/project_acpc_server/rng.c +0 -139
- data/vendor/project_acpc_server/rng.h +0 -63
- data/vendor/project_acpc_server/validate_submission.pl +0 -546
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 542b5073d045209f50bb901d42889333d11cf2c6
|
4
|
+
data.tar.gz: d2d0ca0919f50b6a8c74e94e45ce3d3785375a5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02b2d87deefe40a81943b2294f1d8782fc90ebc22c1119653f3257aa680ce784037e860f0c7b55a96af47c10dd83745047c14b5bea4680e428215c97e282fbb2
|
7
|
+
data.tar.gz: 905ddacae6985df06de5155353b6bb6c2b995a60583830158106318cf39f6fd255f79a88680cd309fb08b7afbbf1c8a6f38d2640be54305622f47aba21a71d28
|
data/Brickfile
ADDED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
ACPC Dealer
|
2
2
|
============
|
3
3
|
|
4
|
+
[![Build Status](https://travis-ci.org/dmorrill10/acpc_dealer.svg?branch=master)](https://travis-ci.org/dmorrill10/acpc_dealer)
|
5
|
+
|
4
6
|
The [Annual Computer Poker Competition Dealer][ACPC Dealer GitHub] gem wraps the [<em>ACPC Dealer Server</em>][ACPC competition server] in a handy gem with a convenient runner class, and a script for compiling and running the dealer and example players.
|
5
7
|
|
6
8
|
## Installation
|
@@ -17,15 +19,11 @@ Or install it yourself as:
|
|
17
19
|
|
18
20
|
$ gem install acpc_dealer
|
19
21
|
|
20
|
-
Then run (may need to restart your terminal first):
|
21
|
-
|
22
|
-
$ acpc_dealer --compile
|
23
|
-
to compile the ACPC Dealer and example players.
|
24
22
|
|
25
23
|
## Usage
|
26
24
|
|
27
25
|
Run
|
28
|
-
|
26
|
+
|
29
27
|
$ acpc_dealer -h
|
30
28
|
to see a list of commands available in the command line interface.
|
31
29
|
|
@@ -45,9 +43,12 @@ See the [issue tracker](https://github.com/dmorrill10/acpc_dealer/issues) for cu
|
|
45
43
|
4. Push to the branch (`git push origin my-new-feature`)
|
46
44
|
5. Create new Pull Request
|
47
45
|
|
46
|
+
Please test your changes, otherwise I may not be able to find the time to
|
47
|
+
incorporate them into this project.
|
48
|
+
|
48
49
|
Copyright
|
49
50
|
---------
|
50
|
-
Copyright © 2012 by the Computer Poker Research Group, University of Alberta. See [LICENSE](LICENSE.md) for details.
|
51
|
+
Copyright © 2012-2017 by the Computer Poker Research Group, University of Alberta. See [LICENSE](LICENSE.md) for details.
|
51
52
|
|
52
53
|
|
53
54
|
<!---
|
data/Rakefile
CHANGED
@@ -8,15 +8,19 @@ require 'rubygems/package_task'
|
|
8
8
|
|
9
9
|
require File.expand_path('../lib/acpc_dealer/version', __FILE__)
|
10
10
|
|
11
|
-
|
12
|
-
task :default => [:test]
|
11
|
+
task :default => :test
|
13
12
|
|
14
|
-
|
13
|
+
desc 'Compile hand_evaluator and dealer'
|
14
|
+
task :compile => ['compile:hand_evaluator', 'compile:dealer']
|
15
15
|
|
16
|
+
desc 'Run tests'
|
16
17
|
task :test => :compile
|
17
18
|
|
18
19
|
task :build => :clean
|
19
20
|
|
21
|
+
desc 'Remove compiled products'
|
22
|
+
task :clean => ['clean:hand_evaluator', 'clean:dealer']
|
23
|
+
|
20
24
|
Rake::TestTask.new do |t|
|
21
25
|
t.libs << "lib" << 'spec/support'
|
22
26
|
t.test_files = FileList['spec/**/*_spec.rb']
|
@@ -28,25 +32,37 @@ def gemspec
|
|
28
32
|
@clean_gemspec ||= eval(File.read(File.expand_path('../acpc_dealer.gemspec', __FILE__)))
|
29
33
|
end
|
30
34
|
|
31
|
-
Gem::PackageTask.new(gemspec)
|
35
|
+
Gem::PackageTask.new(gemspec)
|
32
36
|
Rake::ExtensionTask.new('hand_evaluator', gemspec)
|
33
37
|
|
34
|
-
|
35
|
-
sh "rm -f lib/hand_evaluator.so"
|
36
|
-
end
|
37
|
-
|
38
|
-
namespace :dealer do
|
38
|
+
namespace :compile do
|
39
39
|
desc 'Compile ACPC dealer'
|
40
|
-
task :
|
40
|
+
task :dealer do
|
41
41
|
Dir.chdir(File.expand_path('../vendor/project_acpc_server', __FILE__)) do
|
42
42
|
sh "make"
|
43
43
|
end
|
44
44
|
end
|
45
|
+
end
|
46
|
+
|
47
|
+
namespace :clean do
|
48
|
+
desc 'Clean hand_evaluator'
|
49
|
+
task :hand_evaluator do
|
50
|
+
Dir.chdir(File.expand_path('../ext/hand_evaluator', __FILE__)) do
|
51
|
+
begin
|
52
|
+
sh 'make clean'
|
53
|
+
rescue
|
54
|
+
end
|
55
|
+
end
|
56
|
+
sh "rm -f #{File.expand_path('../lib/hand_evaluator.so', __FILE__)}"
|
57
|
+
end
|
45
58
|
|
46
59
|
desc 'Clean ACPC dealer'
|
47
|
-
task :
|
48
|
-
|
49
|
-
|
60
|
+
task :dealer do
|
61
|
+
begin
|
62
|
+
Dir.chdir(File.expand_path('../vendor/project_acpc_server', __FILE__)) do
|
63
|
+
sh "make clean"
|
64
|
+
end
|
65
|
+
rescue Errno::ENOENT
|
50
66
|
end
|
51
67
|
end
|
52
|
-
end
|
68
|
+
end
|
data/acpc_dealer.gemspec
CHANGED
@@ -15,6 +15,7 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.add_dependency 'clive', '~> 1.2'
|
16
16
|
gem.add_dependency 'process_runner', '~> 0.0'
|
17
17
|
gem.add_dependency 'rake-compiler', '~> 0.8'
|
18
|
+
gem.add_dependency 'brick_and_mortar'
|
18
19
|
|
19
20
|
gem.add_development_dependency 'minitest', '~> 5.0'
|
20
21
|
gem.add_development_dependency 'mocha', '~> 0.13'
|
@@ -22,7 +23,7 @@ Gem::Specification.new do |gem|
|
|
22
23
|
gem.add_development_dependency 'simplecov', '~> 0.7'
|
23
24
|
|
24
25
|
gem.files = Dir.glob("lib/**/*") + Dir.glob("ext/**/*") + Dir.glob('*.gemspec') +
|
25
|
-
%w(Rakefile README.md) + Dir.glob('spec/**/*')
|
26
|
+
%w(Rakefile README.md Brickfile) + Dir.glob('spec/**/*')
|
26
27
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
27
28
|
gem.extensions = Dir.glob("ext/**/extconf.rb")
|
28
29
|
gem.require_paths = ["lib"]
|
data/bin/acpc_dealer
CHANGED
@@ -31,6 +31,10 @@ class AcpcDealerCli < Clive
|
|
31
31
|
game_def
|
32
32
|
end
|
33
33
|
|
34
|
+
opt :v, :version, "Display version" do
|
35
|
+
puts AcpcDealer::VERSION
|
36
|
+
end
|
37
|
+
|
34
38
|
command :compile, 'Compiles the ACPC Dealer program' do
|
35
39
|
opt :c, :clean, 'Do a clean and full recompile' do
|
36
40
|
print 'Cleaning...'
|
@@ -2,4 +2,14 @@
|
|
2
2
|
#Run 'ruby -r mkmf extconf.rb' to generate a Makefile
|
3
3
|
|
4
4
|
require 'mkmf'
|
5
|
+
root_dir = File.expand_path('../../../', __FILE__)
|
6
|
+
Dir.chdir(root_dir) do
|
7
|
+
command = "mortar --store #{File.join(root_dir, '.bricks')}"
|
8
|
+
puts "Getting Bricks (non-gem dependencies): `#{command}`"
|
9
|
+
system command
|
10
|
+
|
11
|
+
command = 'rake compile:dealer'
|
12
|
+
puts "Compiling project_acpc_server: `#{command}`"
|
13
|
+
system command
|
14
|
+
end
|
5
15
|
create_makefile("hand_evaluator")
|
data/lib/acpc_dealer/version.rb
CHANGED
Binary file
|
data/spec/dealer_runner_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require_relative 'support/spec_helper'
|
2
|
-
|
2
|
+
require 'timeout'
|
3
3
|
require 'socket'
|
4
4
|
require 'tmpdir'
|
5
5
|
|
@@ -8,13 +8,35 @@ require_relative '../lib/acpc_dealer/dealer_runner'
|
|
8
8
|
include AcpcDealer
|
9
9
|
|
10
10
|
describe DealerRunner do
|
11
|
-
|
12
|
-
|
11
|
+
let(:various_numbers_of_players) { [2, 3] }
|
12
|
+
|
13
|
+
def cleanup(pid)
|
14
|
+
Process.kill 'KILL', pid
|
15
|
+
begin
|
16
|
+
Timeout::timeout(3) do
|
17
|
+
Process.getpgid(pid)
|
18
|
+
sleep 0.2
|
19
|
+
end
|
20
|
+
rescue Errno::ESRCH
|
21
|
+
else
|
22
|
+
->() { Process.getpgid(pid) }.must_raise Errno::ESRCH
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def check_process_exists(pid)
|
27
|
+
Process.getpgid(pid)
|
28
|
+
rescue Errno::ESRCH => e
|
29
|
+
flunk "Dealer with pid #{pid} does not exist: #{e.message}"
|
13
30
|
end
|
14
31
|
|
15
|
-
def
|
16
|
-
|
17
|
-
|
32
|
+
def check_ports_are_in_use(port_numbers)
|
33
|
+
port_numbers.each do |port|
|
34
|
+
begin
|
35
|
+
Socket.tcp('localhost', port, connect_timeout: 1)
|
36
|
+
rescue
|
37
|
+
flunk "No dealer listening on port #{port}"
|
38
|
+
end
|
39
|
+
end
|
18
40
|
end
|
19
41
|
|
20
42
|
describe '::ports_for_players' do
|
@@ -22,7 +44,7 @@ describe DealerRunner do
|
|
22
44
|
various_numbers_of_players.each do |number_of_players|
|
23
45
|
DealerRunner.ports_for_players(number_of_players).each do |port|
|
24
46
|
begin
|
25
|
-
TCPServer.open('localhost', port) {
|
47
|
+
TCPServer.open('localhost', port) {}
|
26
48
|
rescue Errno::EADDRINUSE => e
|
27
49
|
flunk "Port #{port} is not open: #{e.message}"
|
28
50
|
end
|
@@ -31,94 +53,76 @@ describe DealerRunner do
|
|
31
53
|
end
|
32
54
|
end
|
33
55
|
|
56
|
+
def in_tmp_dir_with_process_cleanup
|
57
|
+
Dir.mktmpdir do |temp_log_directory|
|
58
|
+
cleanup(yield(temp_log_directory))
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
34
62
|
describe '::start' do
|
63
|
+
let(:options) { ['--start_timeout 1000'].join(' ') }
|
64
|
+
let(:match_name) { 'test_match' }
|
65
|
+
let(:hands) { 10 }
|
66
|
+
let(:random_seed) { 0 }
|
67
|
+
|
68
|
+
def player_names(number_of_players)
|
69
|
+
number_of_players.times.inject([]) do |names, i|
|
70
|
+
names << "p#{i}"
|
71
|
+
end.join(' ')
|
72
|
+
end
|
73
|
+
|
74
|
+
def game_def(number_of_players)
|
75
|
+
GAME_DEFINITION_FILE_PATHS[number_of_players][:limit]
|
76
|
+
end
|
77
|
+
|
35
78
|
it 'starts a dealer asynchronously that can clean up after itself and returns both its PID and the ports that each player can use to connect' do
|
36
79
|
various_numbers_of_players.each do |number_of_players|
|
37
|
-
|
38
|
-
|
80
|
+
in_tmp_dir_with_process_cleanup do |temp_log_directory|
|
81
|
+
patient = DealerRunner.start(
|
39
82
|
{
|
40
|
-
match_name:
|
41
|
-
game_def_file_name:
|
42
|
-
hands:
|
43
|
-
random_seed:
|
44
|
-
player_names: number_of_players
|
45
|
-
|
46
|
-
end.join(' '),
|
47
|
-
options: ['--start_timeout 1000'].join(' ')
|
83
|
+
match_name: match_name,
|
84
|
+
game_def_file_name: game_def(number_of_players),
|
85
|
+
hands: hands,
|
86
|
+
random_seed: random_seed,
|
87
|
+
player_names: player_names(number_of_players),
|
88
|
+
options: options
|
48
89
|
},
|
49
90
|
temp_log_directory
|
50
91
|
)
|
51
92
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
check_ports_are_in_use
|
58
|
-
|
59
|
-
check_process_exists
|
60
|
-
|
61
|
-
cleanup
|
62
|
-
reset_state!
|
93
|
+
patient[:log_directory].must_equal temp_log_directory
|
94
|
+
check_process_exists patient[:pid]
|
95
|
+
check_ports_are_in_use patient[:port_numbers]
|
96
|
+
patient[:pid]
|
63
97
|
end
|
64
98
|
end
|
65
99
|
end
|
66
100
|
|
67
101
|
it 'starts a dealer listening on specific ports' do
|
68
102
|
various_numbers_of_players.each do |number_of_players|
|
69
|
-
|
70
|
-
port_numbers = [
|
71
|
-
|
103
|
+
in_tmp_dir_with_process_cleanup do |temp_log_directory|
|
104
|
+
port_numbers = [10_000, 20_000]
|
105
|
+
patient = DealerRunner.start(
|
72
106
|
{
|
73
|
-
match_name:
|
74
|
-
game_def_file_name:
|
75
|
-
hands:
|
76
|
-
random_seed:
|
77
|
-
player_names: number_of_players
|
78
|
-
|
79
|
-
end.join(' '),
|
80
|
-
options: ['--start_timeout 1000'].join(' ')
|
107
|
+
match_name: match_name,
|
108
|
+
game_def_file_name: game_def(number_of_players),
|
109
|
+
hands: hands,
|
110
|
+
random_seed: random_seed,
|
111
|
+
player_names: player_names(number_of_players),
|
112
|
+
options: options
|
81
113
|
},
|
82
114
|
temp_log_directory,
|
83
115
|
port_numbers
|
84
116
|
)
|
85
117
|
|
86
|
-
|
87
|
-
@port_numbers = result[:port_numbers]
|
88
|
-
(@port_numbers.map { |n| n.to_i })[0..port_numbers.length-1].must_equal port_numbers
|
118
|
+
patient[:port_numbers].map(&:to_i)[0..port_numbers.length - 1].must_equal port_numbers
|
89
119
|
|
90
|
-
|
91
|
-
|
92
|
-
check_ports_are_in_use
|
93
|
-
|
94
|
-
check_process_exists
|
95
|
-
|
96
|
-
cleanup
|
97
|
-
reset_state!
|
120
|
+
patient[:log_directory].must_equal temp_log_directory
|
121
|
+
check_process_exists patient[:pid]
|
122
|
+
check_ports_are_in_use patient[:port_numbers]
|
123
|
+
patient[:pid]
|
98
124
|
end
|
99
125
|
end
|
100
126
|
end
|
101
127
|
end
|
102
|
-
|
103
|
-
def cleanup
|
104
|
-
Process.kill 'KILL', @pid
|
105
|
-
sleep 1
|
106
|
-
|
107
|
-
->() { Process.getpgid(@pid) }.must_raise Errno::ESRCH
|
108
|
-
end
|
109
|
-
def check_process_exists
|
110
|
-
begin
|
111
|
-
Process.getpgid(@pid)
|
112
|
-
rescue Errno::ESRCH => e
|
113
|
-
flunk "Dealer with pid #{@pid} does not exist: #{e.message}"
|
114
|
-
end
|
115
|
-
end
|
116
|
-
def check_ports_are_in_use
|
117
|
-
@port_numbers.each do |port|
|
118
|
-
->() do
|
119
|
-
TCPServer.open('localhost', port)
|
120
|
-
end.must_raise Errno::EADDRINUSE
|
121
|
-
end
|
122
|
-
end
|
123
|
-
def various_numbers_of_players() [2, 3] end
|
124
128
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acpc_dealer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dustin Morrill
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clive
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.8'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: brick_and_mortar
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: minitest
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -117,6 +131,7 @@ extensions:
|
|
117
131
|
- ext/hand_evaluator/extconf.rb
|
118
132
|
extra_rdoc_files: []
|
119
133
|
files:
|
134
|
+
- Brickfile
|
120
135
|
- README.md
|
121
136
|
- Rakefile
|
122
137
|
- acpc_dealer.gemspec
|
@@ -126,88 +141,10 @@ files:
|
|
126
141
|
- lib/acpc_dealer.rb
|
127
142
|
- lib/acpc_dealer/dealer_runner.rb
|
128
143
|
- lib/acpc_dealer/version.rb
|
144
|
+
- lib/hand_evaluator.bundle
|
129
145
|
- spec/connection_information_spec.rb
|
130
146
|
- spec/dealer_runner_spec.rb
|
131
147
|
- spec/support/spec_helper.rb
|
132
|
-
- vendor/project_acpc_server/LICENCE
|
133
|
-
- vendor/project_acpc_server/Makefile
|
134
|
-
- vendor/project_acpc_server/README
|
135
|
-
- vendor/project_acpc_server/README.submission
|
136
|
-
- vendor/project_acpc_server/acpc_play_match.pl
|
137
|
-
- vendor/project_acpc_server/bm_run_matches.c
|
138
|
-
- vendor/project_acpc_server/bm_server.c
|
139
|
-
- vendor/project_acpc_server/bm_server.config
|
140
|
-
- vendor/project_acpc_server/bm_widget.c
|
141
|
-
- vendor/project_acpc_server/dealer.c
|
142
|
-
- vendor/project_acpc_server/evalHandTables
|
143
|
-
- vendor/project_acpc_server/example_player.c
|
144
|
-
- vendor/project_acpc_server/example_player.limit.2p.sh
|
145
|
-
- vendor/project_acpc_server/example_player.limit.3p.sh
|
146
|
-
- vendor/project_acpc_server/example_player.nolimit.2p.sh
|
147
|
-
- vendor/project_acpc_server/example_player.nolimit.3p.sh
|
148
|
-
- vendor/project_acpc_server/game.c
|
149
|
-
- vendor/project_acpc_server/game.h
|
150
|
-
- vendor/project_acpc_server/holdem.limit.2p.reverse_blinds.game
|
151
|
-
- vendor/project_acpc_server/holdem.limit.3p.game
|
152
|
-
- vendor/project_acpc_server/holdem.nolimit.2p.reverse_blinds.game
|
153
|
-
- vendor/project_acpc_server/holdem.nolimit.3p.game
|
154
|
-
- vendor/project_acpc_server/kuhn.limit.3p.game
|
155
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player.sf1.sh
|
156
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player.sf2.sh
|
157
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player.sf3.sh
|
158
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/LICENCE
|
159
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/Makefile
|
160
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/README.md
|
161
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/src/CExceptionConfig.h
|
162
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/src/dealer_connection.c
|
163
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/src/dealer_connection.h
|
164
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/src/kuhn_3p_equilibrium_player.c
|
165
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/src/kuhn_3p_equilibrium_player.h
|
166
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/src/main.c
|
167
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/src/player_config.c
|
168
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/src/player_config.h
|
169
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/test/support/test_helper.c
|
170
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/test/support/test_helper.h
|
171
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/test/test_kuhn_3p_equilibrium_player.c
|
172
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/test/test_kuhn_3p_equilibrium_player_sub_family_1.c
|
173
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/test/test_kuhn_3p_equilibrium_player_sub_family_2.c
|
174
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/test/test_kuhn_3p_equilibrium_player_sub_family_3.c
|
175
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/cexception/docs/license.txt
|
176
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/cexception/docs/readme.txt
|
177
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/cexception/lib/CException.c
|
178
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/cexception/lib/CException.h
|
179
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/cexception/release/build.info
|
180
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/cexception/release/version.info
|
181
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/commander.c/History.md
|
182
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/commander.c/Makefile
|
183
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/commander.c/Readme.md
|
184
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/commander.c/package.json
|
185
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/commander.c/src/commander.c
|
186
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/commander.c/src/commander.h
|
187
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/commander.c/test.c
|
188
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/auto/colour_prompt.rb
|
189
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/auto/colour_reporter.rb
|
190
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/auto/generate_config.yml
|
191
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/auto/generate_module.rb
|
192
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/auto/generate_test_runner.rb
|
193
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/auto/test_file_filter.rb
|
194
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/auto/unity_test_summary.rb
|
195
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/docs/Unity Summary.txt
|
196
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/docs/license.txt
|
197
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/release/build.info
|
198
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/release/version.info
|
199
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/src/unity.c
|
200
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/src/unity.h
|
201
|
-
- vendor/project_acpc_server/kuhn_3p_equilibrium_player/vendor/unity/src/unity_internals.h
|
202
|
-
- vendor/project_acpc_server/net.c
|
203
|
-
- vendor/project_acpc_server/net.h
|
204
|
-
- vendor/project_acpc_server/play_match.pl
|
205
|
-
- vendor/project_acpc_server/protocol.md
|
206
|
-
- vendor/project_acpc_server/protocol.odt
|
207
|
-
- vendor/project_acpc_server/protocol.pdf
|
208
|
-
- vendor/project_acpc_server/rng.c
|
209
|
-
- vendor/project_acpc_server/rng.h
|
210
|
-
- vendor/project_acpc_server/validate_submission.pl
|
211
148
|
homepage: https://github.com/dmorrill10/acpc_dealer
|
212
149
|
licenses:
|
213
150
|
- MIT
|
@@ -228,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
165
|
version: '0'
|
229
166
|
requirements: []
|
230
167
|
rubyforge_project:
|
231
|
-
rubygems_version: 2.
|
168
|
+
rubygems_version: 2.5.1
|
232
169
|
signing_key:
|
233
170
|
specification_version: 4
|
234
171
|
summary: Ruby interface to the Annual Computer Poker Competition's dealer program.
|