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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d33c1d67c3bd9e033532f8d1cbc35496205d5893f45cb994a8979477cf27f98
4
- data.tar.gz: ba689181ec0c9891a9c19c2c863357982a2457bf49fcfb132371c6db6539bf66
3
+ metadata.gz: d4032ac46170ffc3f434ccc3682f94b8668bf0b64c7106fde1a07283ebc181a0
4
+ data.tar.gz: 65682e318410b6c3ca88814463e1650a18480a19de61c0b3cabd5b50ae30f9bc
5
5
  SHA512:
6
- metadata.gz: 1e15e6f286ff215fda7c30303acda75a5d142958602ac5860d59880717bd56677738e629c853af0932efd8cc76751b52051830e4b2a2e352ebca5720dd7d520f
7
- data.tar.gz: 4f5dbd8d358d9faffe627b058852ac4522b41dbb7b9aab22b47e52a22e1cf8c2d5e06e74917a3be6a46be914d4804e9d3b2e1e03025468762fad5231dabf2ef3
6
+ metadata.gz: cd189b4381573306de40eec4047288f6ee1b1ee560211759c68c91a6ad93c327bec54fc328922c1a182423184a895c59d3df881cc96a95fda190055490cd7a6d
7
+ data.tar.gz: f368f483bf43acb2faf2454008fdcc164d83948fdc286876c07888f1e2580d5f0c4b9d1eb5a20daec145a98c350200c46fdf588500ba6652e1c783570f7ccc03
data/CHANGELOG.md CHANGED
@@ -1,5 +1,4 @@
1
- ### 0.2.2
2
-
1
+ ### 0.2.3
3
2
  ### 0.0.1 / 2024-08-25
4
3
 
5
4
  * Everything is new. First release.
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ Hoe.spec 'sportdb-search' do
20
20
  self.licenses = ['Public Domain']
21
21
 
22
22
  self.extra_deps = [
23
- ['sportdb-catalogs', '>= 1.2.3'],
23
+ ['sportdb-catalogs', '>= 1.2.6'],
24
24
  ]
25
25
 
26
26
  self.spec_extras = {
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 = '../catalog/catalog.db'
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, country: nil )
118
- ## todo/fix upstream - remove "generic" match_by() - why? why not?
119
- ###
120
- if code && name.nil?
121
- _search.match_by_code( code, country: country )
122
- elsif name && code.nil?
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
- if league.intl? ## todo/fix: add intl? to ActiveRecord league!!!
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 )
@@ -3,7 +3,7 @@ module Module
3
3
  module Search
4
4
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
5
5
  MINOR = 2
6
- PATCH = 2
6
+ PATCH = 3
7
7
  VERSION = [MAJOR,MINOR,PATCH].join('.')
8
8
 
9
9
  def self.version
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.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: 2024-10-21 00:00:00.000000000 Z
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.3
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.3
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.1'
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.1'
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.4.10
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