sportdb-config 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sportdb/config/config.rb +17 -2
- data/lib/sportdb/config/version.rb +1 -1
- data/test/test_config.rb +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e1c949ddbf113fbfc92ac6b49c642efea51cf1e
|
4
|
+
data.tar.gz: 9bbcf4c6f00c08453267110fd79937999eabaed1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
95
|
-
|
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
|
|
data/test/test_config.rb
CHANGED