sportdb-formats 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sportdb/formats/match/match_parser.rb +2 -2
- data/lib/sportdb/formats/structs/team.rb +7 -0
- data/lib/sportdb/formats/version.rb +1 -1
- data/test/test_match_champs.rb +1 -1
- data/test/test_match_eng.rb +1 -1
- data/test/test_match_euro.rb +1 -1
- data/test/test_match_worldcup.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b1daae3f04961c06c34b98e84438ee39a80c5ca
|
4
|
+
data.tar.gz: 872154cb339bb6b6c8f440a392f250dc7d7387d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 853b0362fde6f9d8b17db7036ae954768500ab681acff7bf859b8cbf59b7d8bc4bec9d153f21e3c7ac069b6486b10386ce99fe151d4229df815c006a27dccbe0
|
7
|
+
data.tar.gz: e356061bfb0f15ff8274651ce107ec3be00818996d0c29a2ffb26bd5b71c385a3bd1464eea42e2e11ab60dc24ce96663a701e28fa6a8aebd27d434525c71a1f4
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module SportDb
|
4
4
|
|
5
|
-
class
|
5
|
+
class MatchParser ## simple match parser for team match schedules
|
6
6
|
|
7
7
|
def self.parse( lines, teams, start: )
|
8
8
|
## todo/fix: add support for txt and lines
|
@@ -655,5 +655,5 @@ class MatchParserSimpleV2 ## simple match parser for team match schedules
|
|
655
655
|
|
656
656
|
|
657
657
|
|
658
|
-
end # class
|
658
|
+
end # class MatchParser
|
659
659
|
end # module SportDb
|
@@ -21,6 +21,13 @@ class Team
|
|
21
21
|
[@name] + @alt_names
|
22
22
|
end ## all names
|
23
23
|
|
24
|
+
def key
|
25
|
+
## note: auto-generate key "on-the-fly" if missing for now - why? why not?
|
26
|
+
## note: quick hack - auto-generate key, that is, remove all non-ascii chars and downcase
|
27
|
+
@key || @name.downcase.gsub( /[^a-z]/, '' )
|
28
|
+
end
|
29
|
+
|
30
|
+
|
24
31
|
## special import only attribs
|
25
32
|
attr_accessor :alt_names_auto ## auto-generated alt names
|
26
33
|
attr_accessor :wikipedia # wikipedia page name (for english (en))
|
data/test/test_match_champs.rb
CHANGED
@@ -17,7 +17,7 @@ class TestMatchChamps < MiniTest::Test
|
|
17
17
|
|
18
18
|
SportDb::Import.config.lang = 'en'
|
19
19
|
|
20
|
-
parser = SportDb::
|
20
|
+
parser = SportDb::MatchParser.new( txt, teams, start )
|
21
21
|
matches, rounds, groups = parser.parse
|
22
22
|
|
23
23
|
pp rounds
|
data/test/test_match_eng.rb
CHANGED
data/test/test_match_euro.rb
CHANGED
@@ -17,7 +17,7 @@ class TestMatchEuro < MiniTest::Test
|
|
17
17
|
|
18
18
|
SportDb::Import.config.lang = 'en'
|
19
19
|
|
20
|
-
parser = SportDb::
|
20
|
+
parser = SportDb::MatchParser.new( txt, teams, start )
|
21
21
|
matches, rounds, groups = parser.parse
|
22
22
|
|
23
23
|
pp rounds
|
data/test/test_match_worldcup.rb
CHANGED
@@ -17,7 +17,7 @@ class TestMatchWorld < MiniTest::Test
|
|
17
17
|
|
18
18
|
SportDb::Import.config.lang = 'en'
|
19
19
|
|
20
|
-
parser = SportDb::
|
20
|
+
parser = SportDb::MatchParser.new( txt, teams, start )
|
21
21
|
matches, rounds, groups = parser.parse
|
22
22
|
|
23
23
|
pp rounds
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sportdb-formats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.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-05-
|
11
|
+
date: 2020-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: alphabets
|