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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e69405f0f6aab33c299ed7479747f1adb6e90282
4
- data.tar.gz: ef45575530d5b0e899ff08f69089462486fd580a
3
+ metadata.gz: cdadfa4b00e61764c6b7b1f62ffb983f89c4a1ff
4
+ data.tar.gz: 3721087e4b6ff6bf0e604a00cce8658df1cb05bb
5
5
  SHA512:
6
- metadata.gz: f969dc99e13d4b5b98fddf63925e44f24e799cc5ae7d6ee8db34738e1140c9bbe8657199f389586a9ef6a16b895e39207f3e34e98b264c978934a853ee08800e
7
- data.tar.gz: 51a8e71e961fdd780561a038afe381026c5aca39838f210825b72f2aafc583bc85db62e5cf6190e32ec1256a983d410de26e1033b5ed9257020819e6894f4bd2
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 = ['https://github.com/sportdb/sport.db']
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'
@@ -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
- Model::Match.find_by( round_id: round_rec.id,
188
- team1_id: team1_rec.id,
189
- team2_id: team2_rec.id )
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?
@@ -7,7 +7,7 @@ module Sync
7
7
 
8
8
  MAJOR = 1 ## todo: namespace inside version or something - why? why not??
9
9
  MINOR = 1
10
- PATCH = 1
10
+ PATCH = 2
11
11
  VERSION = [MAJOR,MINOR,PATCH].join('.')
12
12
 
13
13
  def self.version
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.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-08-01 00:00:00.000000000 Z
11
+ date: 2020-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sportdb-catalogs