acpc_table_manager 3.0.10 → 3.0.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d6b52ba6c9414adceb73a82e5e3c43b3092ad74
4
- data.tar.gz: cc041ba4807834f9ceea70e0d42f69ab5bcb4753
3
+ metadata.gz: c6045e649f8474fe093e827a3fd6c659aa639a26
4
+ data.tar.gz: c19ca84bbb26ce0285dbcb6d7a2bae23dda3c341
5
5
  SHA512:
6
- metadata.gz: 8ff3da09376243348ff22ac992bbac1fd1b2309cd9d2e811397cde4b89a0409b0271ec7e245678e5278ceb9ffedd26cb32f7c63f5a3efea0a87bcb44516ed452
7
- data.tar.gz: 41ff5b80650fbaf609111aecbbabce4bc38f59ac28f60c8b039170f076d691739c112db755b6a0c442dca3e0d19b5f5d239cc77d0d7a4bd36310d57656276ea1
6
+ metadata.gz: e58888e75fd4f7918cd41a3ad5cb23be6406d05a28e52a38fed941552e8f8ff68519008bdadf84f8fe1a53d3dcbb99cd2d463bf3e1d08d62c811f3a1649303cb
7
+ data.tar.gz: 0356b56a54da1ae702bacd23c575cc541c184f127db14ceb5a1ce2ba812ffcfe49f47900551c9e50909fffeb16dbf2627f9ae27a2604a981be7fedecdfed7b9d
@@ -1,10 +1,7 @@
1
1
  require 'acpc_dealer'
2
2
  require 'timeout'
3
3
  require 'zaru'
4
-
5
4
  require_relative 'config'
6
- require_relative 'match'
7
-
8
5
  require_relative 'simple_logging'
9
6
 
10
7
  module AcpcTableManager
@@ -1,8 +1,4 @@
1
- require 'yaml'
2
- require_relative 'dealer'
3
- require_relative 'match'
4
1
  require_relative 'table_queue'
5
-
6
2
  require_relative 'simple_logging'
7
3
  using AcpcTableManager::SimpleLogging::MessageFormatting
8
4
 
@@ -50,6 +50,13 @@ class Match
50
50
  :possibly_running,
51
51
  where(:proxy_pid.gt => 0).and.where(:dealer_pid.gt => 0)
52
52
  )
53
+ # @return The matches to be started (have not been started and not
54
+ # currently running) ordered from newest to oldest.
55
+ scope :queue, not_started.and.ready_to_start.desc(:updated_at)
56
+
57
+ index({ game_definition_key: 1 })
58
+ index({ proxy_pid: 1, dealer_pid: 1 })
59
+ index({ user_name: 1 })
53
60
 
54
61
  class << self
55
62
  # @todo Move to AcpcDealer
@@ -109,12 +116,6 @@ class Match
109
116
  running(matches).inject([]) { |ports, m| ports += m.port_numbers }
110
117
  end
111
118
 
112
- # @return The matches to be started (have not been started and not
113
- # currently running) ordered from newest to oldest.
114
- def start_queue(matches=all)
115
- matches.not_started.and.ready_to_start.desc(:updated_at)
116
- end
117
-
118
119
  def kill_all_orphan_processes!(matches=all)
119
120
  matches.each { |m| m.kill_orphan_processes! }
120
121
  end
@@ -1,7 +1,4 @@
1
1
  require 'mongoid'
2
-
3
- require 'acpc_poker_types/game_definition'
4
-
5
2
  require_relative 'config'
6
3
 
7
4
  module AcpcTableManager
@@ -68,7 +68,7 @@ module AcpcTableManager
68
68
  self
69
69
  end
70
70
 
71
- def matches_to_start() Match.start_queue(my_matches) end
71
+ def matches_to_start() my_matches.queue end
72
72
 
73
73
  def my_matches
74
74
  Match.where(game_definition_key: @game_definition_key.to_sym)
@@ -1,3 +1,3 @@
1
1
  module AcpcTableManager
2
- VERSION = "3.0.10"
2
+ VERSION = "3.0.11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acpc_table_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.10
4
+ version: 3.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dustin Morrill
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-15 00:00:00.000000000 Z
11
+ date: 2016-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pony