sports-manager 0.0.2 → 0.0.3
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 +4 -4
- data/lib/sports_manager/tournament_generator.rb +6 -3
- data/lib/sports_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 896fa713f3fa999a6d852b8987a626998201f976a48c382297944bd0068488e9
|
4
|
+
data.tar.gz: e3f14be9cd4eaa4edf88a084ae4d041afd70800c536177fed88f20e5bb8be02c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '099e7f7e9049254d6ee2b68a34acb263308235f0d67e829fbaaff182b3cb59fbbbb75ab52471fd620af2c31551630008fc0613719ef2d4f802e4a19f9e57807e'
|
7
|
+
data.tar.gz: e2e7c3057107fd7ae76f1dcb364246003cf8ff889fc1a9ad4f8a5aee42cbfaa580c944d33455eef1cb0dc72a37ead9b087c25799adee3e2e465f9c789bc2c0ed
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'timeout'
|
4
|
+
|
3
5
|
# rubocop:disable Metrics/AbcSize
|
4
6
|
module SportsManager
|
5
7
|
# Public:Tournament Solver
|
@@ -22,7 +24,7 @@ module SportsManager
|
|
22
24
|
extend Forwardable
|
23
25
|
|
24
26
|
attr_reader :format, :tournament, :variables, :domains,
|
25
|
-
:ordering, :filtering, :lookahead, :csp
|
27
|
+
:ordering, :filtering, :lookahead, :csp, :timeout
|
26
28
|
|
27
29
|
attr_accessor :days, :subscriptions, :matches, :courts, :game_length, :rest_break, :single_day_matches,
|
28
30
|
:tournament_type
|
@@ -43,8 +45,9 @@ module SportsManager
|
|
43
45
|
.call
|
44
46
|
end
|
45
47
|
|
46
|
-
def initialize(format: :cli)
|
48
|
+
def initialize(format: :cli, timeout: nil)
|
47
49
|
@format = format
|
50
|
+
@timeout = timeout
|
48
51
|
@days = {}
|
49
52
|
@subscriptions = {}
|
50
53
|
@matches = {}
|
@@ -129,7 +132,7 @@ module SportsManager
|
|
129
132
|
def call
|
130
133
|
setup
|
131
134
|
|
132
|
-
solutions = csp.solve
|
135
|
+
solutions = Timeout.timeout(timeout) { csp.solve }
|
133
136
|
|
134
137
|
TournamentSolution
|
135
138
|
.new(tournament: tournament, solutions: solutions)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sports-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- André Benjamim
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-08-
|
12
|
+
date: 2024-08-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: csp-resolver
|