sportdb-search 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -2
- data/Rakefile +1 -1
- data/bin/fbq +1 -1
- data/lib/sportdb/search/sport-leagues.rb +19 -6
- data/lib/sportdb/search/sport-teams.rb +14 -3
- data/lib/sportdb/search/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4032ac46170ffc3f434ccc3682f94b8668bf0b64c7106fde1a07283ebc181a0
|
4
|
+
data.tar.gz: 65682e318410b6c3ca88814463e1650a18480a19de61c0b3cabd5b50ae30f9bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd189b4381573306de40eec4047288f6ee1b1ee560211759c68c91a6ad93c327bec54fc328922c1a182423184a895c59d3df881cc96a95fda190055490cd7a6d
|
7
|
+
data.tar.gz: f368f483bf43acb2faf2454008fdcc164d83948fdc286876c07888f1e2580d5f0c4b9d1eb5a20daec145a98c350200c46fdf588500ba6652e1c783570f7ccc03
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
data/bin/fbq
CHANGED
@@ -14,7 +14,7 @@ require 'optparse'
|
|
14
14
|
|
15
15
|
## local hack
|
16
16
|
## if exists up-to-date catalog db (use local version NOT built-in)
|
17
|
-
catalog_path = '
|
17
|
+
catalog_path = '/sports/sportdb/sport.db/catalog/catalog.db'
|
18
18
|
if File.exist?( catalog_path )
|
19
19
|
SportDb::Import.config.catalog_path = catalog_path
|
20
20
|
end
|
@@ -114,12 +114,25 @@ class League
|
|
114
114
|
|
115
115
|
###################
|
116
116
|
## core required delegates - use delegate generator - why? why not?
|
117
|
-
def self.match_by( name: nil, code: nil,
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
117
|
+
def self.match_by( name: nil, code: nil,
|
118
|
+
country: nil,
|
119
|
+
season: nil )
|
120
|
+
## todo/fix upstream - remove "generic" match_by() - why? why not?
|
121
|
+
##
|
122
|
+
if code && name.nil?
|
123
|
+
### todo/fix - simplify - why? why not?
|
124
|
+
## remove country from code match query
|
125
|
+
## assume use country prefixes or are unique
|
126
|
+
## e.g. Premier Leaguge is eng.1 or eng.pl etc. not just pl
|
127
|
+
## Bundesliga is de.1 or de.bl etc not just bl
|
128
|
+
## and so on
|
129
|
+
if country
|
130
|
+
## add deprecated warning - why? why not?
|
131
|
+
puts "[deprecated] do NOT use country param for League.match_by_code; will get reomved"
|
132
|
+
end
|
133
|
+
_search.match_by_code( code, country: country,
|
134
|
+
season: season )
|
135
|
+
elsif name && code.nil? && season.nil? # note - season only supported for code for now
|
123
136
|
_search.match_by_name( name, country: country )
|
124
137
|
else
|
125
138
|
raise ArgumentError, "League.match_by - one (and only one arg) required - code: or name:"
|
@@ -55,8 +55,18 @@ end # class NationalTeam
|
|
55
55
|
if mods && mods[ league.key ] && mods[ league.key ][ name ]
|
56
56
|
mods[ league.key ][ name ]
|
57
57
|
else
|
58
|
+
### quick hack
|
59
|
+
## rename more placeholder teams to N.N.
|
60
|
+
name = 'N.N.' if ['Verlierer HF 1',
|
61
|
+
'Verlierer HF 2'].include?(name)
|
62
|
+
|
58
63
|
if league.clubs?
|
59
|
-
|
64
|
+
|
65
|
+
## check for placeholder/global dummy clubs first
|
66
|
+
if ['N.N.', 'N. N.'].include?( name )
|
67
|
+
Club.find!( name )
|
68
|
+
else
|
69
|
+
if league.intl? ## todo/fix: add intl? to ActiveRecord league!!!
|
60
70
|
###
|
61
71
|
## get country code from name
|
62
72
|
## e.g. Liverpool FC (ENG) or
|
@@ -72,7 +82,7 @@ end # class NationalTeam
|
|
72
82
|
## todo/fix: add auto flag!!!!
|
73
83
|
### like in rounds!!!
|
74
84
|
## to track auto-created clubs
|
75
|
-
rec = Club.new( name: m[:name] )
|
85
|
+
rec = Club.new( name: m[:name], auto: true )
|
76
86
|
rec.country = Country.find_by( code: m[:code] ) ## fix: country kwarg not yet supported!!
|
77
87
|
pp rec
|
78
88
|
end
|
@@ -93,11 +103,12 @@ end # class NationalTeam
|
|
93
103
|
## todo/fix: add auto flag!!!!
|
94
104
|
### like in rounds!!!
|
95
105
|
## to track auto-created clubs
|
96
|
-
rec = Club.new( name: name )
|
106
|
+
rec = Club.new( name: name, auto: true )
|
97
107
|
rec.country = league.country ## fix: country kwarg not yet supported!!
|
98
108
|
pp rec
|
99
109
|
end
|
100
110
|
rec
|
111
|
+
end
|
101
112
|
end
|
102
113
|
else ## assume national teams (not clubs)
|
103
114
|
NationalTeam.find!( name )
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sportdb-search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sportdb-catalogs
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.2.
|
19
|
+
version: 1.2.6
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.2.
|
26
|
+
version: 1.2.6
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rdoc
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,14 +50,14 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '4.
|
53
|
+
version: '4.2'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '4.
|
60
|
+
version: '4.2'
|
61
61
|
description: sportdb-search - find national teams, clubs, leagues & more
|
62
62
|
email: gerald.bauer@gmail.com
|
63
63
|
executables:
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
106
|
+
rubygems_version: 3.5.22
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: sportdb-search - find national teams, clubs, leagues & more
|