acpc_dealer 1.0.1 → 1.0.2

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: ed8e503cf462de01940333dd16baa6f8c9ad8c74
4
- data.tar.gz: 55a7d921be277ae88d01ce87f8dfd4078be7ca4a
3
+ metadata.gz: 857af780da68795a200b594499f48a26b1931f45
4
+ data.tar.gz: 5beb04a330da5ea8ed90558da17ab3cd2494cfd0
5
5
  SHA512:
6
- metadata.gz: ff2d5a21b2481e137ecf0b24d8921913859d13bb81223786f98a604f42f40962e9c6c2f9d618c19c54cc63d6ca72f77da69a999a14d66a9cc56742b56cae719a
7
- data.tar.gz: f4891cbae744ab714fc0aec70f130a4bfd45b8bf87615023d4a07a4d228db9b32442e913f1f2a35ee450b69572dd4ece368948037df7af913f668a10dce5ae1c
6
+ metadata.gz: 4bb3b908c8b7be45bd1ccabcf02c66885ee938f426d3ad06737a6e109e63bcd07e39b0b4d2911cf956a31d5c4e4d01beb8d9ecdeca8d9713a59addb4f7262c57
7
+ data.tar.gz: 8c8d5fd1fa34e29c592090fd1fcfcdf87b01f434841ce12482c1a2cbd531fba9062992bf5d652ba7b6ae5f2fb83647a3681174ceffff451adaa92fece81ae8f6
data/acpc_dealer.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
11
11
  gem.homepage = "https://github.com/dmorrill10/acpc_dealer"
12
12
 
13
13
  gem.add_dependency 'clive', '~> 1.2'
14
- gem.add_dependency 'dmorrill10-utils', '~> 1.0'
14
+ gem.add_dependency 'process_runner', '~> 0.0'
15
15
  gem.add_dependency 'rake-compiler', '~> 0.8'
16
16
 
17
17
  gem.add_development_dependency 'mocha', '~> 0.13'
data/bin/acpc_dealer CHANGED
@@ -1,12 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'dmorrill10-utils/process_runner'
4
-
3
+ require 'process_runner'
5
4
  require 'fileutils'
6
-
7
5
  require 'clive'
8
6
 
9
- require File.expand_path('../../lib/acpc_dealer', __FILE__)
7
+ require_relative '../lib/acpc_dealer'
10
8
 
11
9
  class AcpcDealerCli < Clive
12
10
 
@@ -54,26 +52,26 @@ class AcpcDealerCli < Clive
54
52
  command :dealer, 'Runs the ACPC Dealer' do
55
53
  desc 'The name of the match, defaults to <number_of_players>p.<betting_type>.h<hands>.r<random_seed>'
56
54
  opt :m, :name, arg: '<name>', as: String
57
-
55
+
58
56
  desc 'Parameters that determine which game definition to use'
59
57
  opt :g, :game_def, args: '<number_of_players> <betting_type>', as: [Integer, Symbol]
60
-
58
+
61
59
  opt :n, :hands, 'The number of hands to play', arg: '<hands>', as: Integer
62
-
60
+
63
61
  desc 'The random seed to determine how the cards are dealt, defaults to a random random seed'
64
62
  opt :r, :random_seed, arg: '<random_seed>', as: Integer
65
-
63
+
66
64
  desc 'The names of the players participating in the match, defaults to "p1", "p2", ...'
67
65
  opt :p, :player_names, args: '<p1_name>...', as: [String]
68
-
66
+
69
67
  opt :l, :log_directory, 'Directory where logs will be placed', arg: '<log_directory>', as: String
70
68
 
71
69
  opt :t_response, 'Maximum time per response', arg: '<t_response_milliseconds>', as: Integer
72
-
70
+
73
71
  opt :t_hand, 'Maximum player time per hand', arg: '<t_hand_milliseconds>', as: Integer
74
-
75
- opt :t_per_hand, 'Maximum average player time for match', arg: '<t_per_hand_milliseconds>', as: Integer
76
-
72
+
73
+ opt :t_per_hand, 'Maximum average player time for match', arg: '<t_per_hand_milliseconds>', as: Integer
74
+
77
75
  desc 'Maximum time to wait for players to connect, defaults to no timeout'
78
76
  opt :start_timeout, arg: '<start_timeout_milliseconds>', as: Integer
79
77
 
@@ -92,25 +90,25 @@ class AcpcDealerCli < Clive
92
90
  end
93
91
 
94
92
  name = if get(:name)
95
- get(:name)
96
- else
93
+ get(:name)
94
+ else
97
95
  "#{number_of_players}p.#{betting_type}.h#{get(:hands)}.r#{random_seed}"
98
96
  end
99
97
 
100
- player_names = if get(:player_names)
98
+ player_names = if get(:player_names)
101
99
  get(:player_names)
102
100
  else
103
101
  []
104
102
  end
105
-
103
+
106
104
  while player_names.length < get(:game_def).first
107
105
  player_names << "p#{player_names.length+1}"
108
106
  end
109
107
 
110
108
  arguments = {
111
- match_name: name,
112
- game_def_file_name: game_def,
113
- hands: get(:hands).to_s,
109
+ match_name: name,
110
+ game_def_file_name: game_def,
111
+ hands: get(:hands).to_s,
114
112
  random_seed: random_seed.to_s,
115
113
  player_names: player_names.join(' ')
116
114
  }
@@ -163,6 +161,6 @@ end
163
161
 
164
162
  if ARGV.empty?
165
163
  puts AcpcDealerCli.help
166
- else
164
+ else
167
165
  AcpcDealerCli.run
168
166
  end
@@ -1,7 +1,7 @@
1
1
 
2
2
  require 'socket'
3
3
 
4
- require 'dmorrill10-utils/process_runner'
4
+ require 'process_runner'
5
5
 
6
6
  module AcpcDealer
7
7
  class DealerRunner
@@ -1,3 +1,3 @@
1
1
  module AcpcDealer
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acpc_dealer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dustin Morrill
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.2'
27
27
  - !ruby/object:Gem::Dependency
28
- name: dmorrill10-utils
28
+ name: process_runner
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: '1.0'
33
+ version: '0.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: '1.0'
40
+ version: '0.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake-compiler
43
43
  requirement: !ruby/object:Gem::Requirement