sportdb-config 0.2.0 → 0.2.1

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: 55fee2eb8f0f1a3d97024defcabe6d749f592172
4
- data.tar.gz: 4ceed1be167b9688f9e2f9c7b6e0fe02ab351078
3
+ metadata.gz: 6e1c949ddbf113fbfc92ac6b49c642efea51cf1e
4
+ data.tar.gz: 9bbcf4c6f00c08453267110fd79937999eabaed1
5
5
  SHA512:
6
- metadata.gz: d495289d9ba9f1cfe4ac5a9cc19d8d916067be3a3101e07657a80640e9ec8aa21c46c5f28bad661dd3be9846d1b91548e74b94105384eded3cbdfb95093f3917
7
- data.tar.gz: 44d015f48b75cfd062c94797405eaa064e3265c5dd155402b946aa8ab6c4a2eba13e20ea0b287ca69a6b06864fad89e91145e9e02d2bed11083dee59d2a9a1a7
6
+ metadata.gz: 76b550ec4e4b67425403284eb4cbb52888df3b9408ea56c6514f255509e03ba323610c38ae6caa41582b10279e50f8889fce69a855484ef070f58e79d20478fe
7
+ data.tar.gz: 5d2c9c90d4111df3e8d59381801e4db47fc6f3a5369f636fbf2248511debdfe0ac8eb5d47fe2bd2fbbd7397e9ac6af201ef6d03de408b7a16a6639c4a0c39f98
@@ -78,6 +78,7 @@ class Configuration
78
78
  ## unify team names; team (builtin/known/shared) name mappings
79
79
  ## cleanup team names - use local ("native") name with umlaut etc.
80
80
  recs = []
81
+ errors = []
81
82
 
82
83
  ## todo/fix: pass along / use country code too
83
84
  CLUBS_DATAFILES.each do |country, path|
@@ -91,8 +92,14 @@ class Configuration
91
92
 
92
93
  recs.each do |rec|
93
94
  rec.alt_names.each do |alt_name|
94
- ## todo/fix: warn about duplicates (if key exits) ???????
95
- @team_mappings[ alt_name ] = rec.name
95
+ name = @team_mappings[ alt_name ]
96
+ if name ## todo/fix: add better warn about duplicates (if key exits) ???????
97
+ msg = "** !!! WARN !!! - alt name conflict/duplicate - >#{alt_name}< will overwrite >#{name}< with >#{rec.name}<"
98
+ puts msg
99
+ errors << msg
100
+ else
101
+ @team_mappings[ alt_name ] = rec.name
102
+ end
96
103
  end
97
104
  end
98
105
 
@@ -109,6 +116,14 @@ class Configuration
109
116
  @teams[ rec.name ] = rec
110
117
  end
111
118
 
119
+ if errors.size > 0
120
+ puts ""
121
+ puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
122
+ puts " #{errors.size} errors:"
123
+ pp errors
124
+ ## exit 1
125
+ end
126
+
112
127
  self ## return self for chaining
113
128
  end
114
129
 
@@ -8,7 +8,7 @@ module Boot ## note: use a different module than Config to avoid confusion
8
8
 
9
9
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
10
10
  MINOR = 2
11
- PATCH = 0
11
+ PATCH = 1
12
12
  VERSION = [MAJOR,MINOR,PATCH].join('.')
13
13
 
14
14
  def self.version
data/test/test_config.rb CHANGED
@@ -10,7 +10,6 @@ require 'helper'
10
10
  class TestConfig < MiniTest::Test
11
11
 
12
12
  def test_teams
13
-
14
13
  SportDb::Import.config.clubs_dir = '../../../openfootball/clubs'
15
14
 
16
15
  pp SportDb::Import.config.teams
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportdb-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer