sportdb-sync 1.1.1 → 1.1.2
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/Rakefile +1 -1
- data/lib/sportdb/sync/sync.rb +18 -3
- data/lib/sportdb/sync/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: cdadfa4b00e61764c6b7b1f62ffb983f89c4a1ff
|
|
4
|
+
data.tar.gz: 3721087e4b6ff6bf0e604a00cce8658df1cb05bb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 18c37a874743c779fabc931f8e09c14a30e3e13609242a82cc0d2d5f14319092d103f470a8541eabfef95b0f83c0c98849b54d652fc3f9ff5615299be8e7bc17
|
|
7
|
+
data.tar.gz: 2dd81facb4bbcd8a36c09d66d894288660724f058121799f5a6c29a64ece00c115eb6c257ef3075b2b8231a01e8e5a70afc6c4cb7f793e61752113acbf577344
|
data/Rakefile
CHANGED
|
@@ -8,7 +8,7 @@ Hoe.spec 'sportdb-sync' do
|
|
|
8
8
|
self.summary = "sportdb-sync - sport.db sync helpers for leagues, seasons, clubs, match schedules and results, and more"
|
|
9
9
|
self.description = summary
|
|
10
10
|
|
|
11
|
-
self.urls =
|
|
11
|
+
self.urls = { home: 'https://github.com/sportdb/sport.db' }
|
|
12
12
|
|
|
13
13
|
self.author = 'Gerald Bauer'
|
|
14
14
|
self.email = 'opensport@googlegroups.com'
|
data/lib/sportdb/sync/sync.rb
CHANGED
|
@@ -145,6 +145,16 @@ module SportDb
|
|
|
145
145
|
|
|
146
146
|
## todo/check: allow strings too - why? why not?
|
|
147
147
|
|
|
148
|
+
|
|
149
|
+
## todo/check:
|
|
150
|
+
## how to model "same" rounds in different stages
|
|
151
|
+
## e.g. Belgium
|
|
152
|
+
## in regular season (stage) - round 1, round 2, etc.
|
|
153
|
+
## in playoff (stage) - round 1, round 2, etc.
|
|
154
|
+
## reference same round or create a new one for each stage!!???
|
|
155
|
+
## and lookup by name AND stage??
|
|
156
|
+
|
|
157
|
+
|
|
148
158
|
round_rec = if match.round
|
|
149
159
|
## query for round - allow string or round rec
|
|
150
160
|
round_name = match.round.is_a?( String ) ? match.round : match.round.name
|
|
@@ -184,9 +194,14 @@ module SportDb
|
|
|
184
194
|
### todo/check: what happens if there's more than one match? exception raised??
|
|
185
195
|
rec = if round_rec
|
|
186
196
|
## add match status too? allows [abandoned] and [replay] in same round
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
197
|
+
find_attributes = { round_id: round_rec.id,
|
|
198
|
+
team1_id: team1_rec.id,
|
|
199
|
+
team2_id: team2_rec.id }
|
|
200
|
+
|
|
201
|
+
## add stage if present to query
|
|
202
|
+
find_attributes[ :stage_id] = stage_rec.id if stage_rec
|
|
203
|
+
|
|
204
|
+
Model::Match.find_by( find_attributes )
|
|
190
205
|
else
|
|
191
206
|
## always assume new record for now
|
|
192
207
|
## check for date or such - why? why not?
|
data/lib/sportdb/sync/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sportdb-sync
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gerald Bauer
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-09-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sportdb-catalogs
|