sportdb-formats 0.1.1 → 0.1.2
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 +4 -4
- data/Manifest.txt +11 -0
- data/Rakefile +1 -0
- data/config/fixtures/de.yml +46 -0
- data/config/fixtures/en.yml +54 -0
- data/config/fixtures/es.yml +48 -0
- data/config/fixtures/fr.yml +53 -0
- data/config/fixtures/it.yml +55 -0
- data/config/fixtures/pt.yml +46 -0
- data/config/fixtures/ro.yml +55 -0
- data/lib/sportdb/formats/datafile.rb +10 -4
- data/lib/sportdb/formats/date.rb +446 -0
- data/lib/sportdb/formats/lang.rb +216 -0
- data/lib/sportdb/formats/version.rb +6 -1
- data/lib/sportdb/formats.rb +17 -5
- data/test/test_datafile_match.rb +4 -4
- data/test/test_date.rb +100 -0
- data/test/test_lang.rb +130 -0
- metadata +27 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 268dcbbc6a6406aeba7cd67e96d353157aac8193
|
4
|
+
data.tar.gz: 6a3d098d6e4f6dadd1d995127f4cc79588c5b900
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 977c372feb715497cf80a3246a6bc1ed861189f104550af33c771e05205e5de31d234812884f2d88ba298858ea5e6fd1776fdde5b2a29eeca47fc195a6b43f05
|
7
|
+
data.tar.gz: c1c422f192ef4dd5bedcff217f32cbb8b986665a986ccf6800d8bf42ae8cbcf8d68313baec251d3510d773a048fc779350fefa0038536e4e53256079843c01cb
|
data/Manifest.txt
CHANGED
@@ -2,8 +2,17 @@ CHANGELOG.md
|
|
2
2
|
Manifest.txt
|
3
3
|
README.md
|
4
4
|
Rakefile
|
5
|
+
config/fixtures/de.yml
|
6
|
+
config/fixtures/en.yml
|
7
|
+
config/fixtures/es.yml
|
8
|
+
config/fixtures/fr.yml
|
9
|
+
config/fixtures/it.yml
|
10
|
+
config/fixtures/pt.yml
|
11
|
+
config/fixtures/ro.yml
|
5
12
|
lib/sportdb/formats.rb
|
6
13
|
lib/sportdb/formats/datafile.rb
|
14
|
+
lib/sportdb/formats/date.rb
|
15
|
+
lib/sportdb/formats/lang.rb
|
7
16
|
lib/sportdb/formats/outline_reader.rb
|
8
17
|
lib/sportdb/formats/season_utils.rb
|
9
18
|
lib/sportdb/formats/version.rb
|
@@ -11,5 +20,7 @@ test/helper.rb
|
|
11
20
|
test/test_csv_reader.rb
|
12
21
|
test/test_datafile.rb
|
13
22
|
test/test_datafile_match.rb
|
23
|
+
test/test_date.rb
|
24
|
+
test/test_lang.rb
|
14
25
|
test/test_outline_reader.rb
|
15
26
|
test/test_season_utils.rb
|
data/Rakefile
CHANGED
@@ -0,0 +1,46 @@
|
|
1
|
+
###########################
|
2
|
+
# known keywords for fixtures
|
3
|
+
|
4
|
+
|
5
|
+
group: Gruppe
|
6
|
+
|
7
|
+
round: Spieltag|Runde
|
8
|
+
|
9
|
+
|
10
|
+
stage: Gruppenphase|Qualifikation|Play-off|Finalrunde|K.-o.-Phase
|
11
|
+
|
12
|
+
|
13
|
+
### Knock out rounds
|
14
|
+
|
15
|
+
## fix: add playoffs:
|
16
|
+
round32: Sechzehntelfinale|1/16 Finale
|
17
|
+
round16: Achtelfinale|1/8 Finale
|
18
|
+
quarterfinals: Viertelfinale|1/4 Finale
|
19
|
+
semifinals: Halbfinale|Semifinale|1/2 Finale
|
20
|
+
fifthplace: Spiel um Platz 5
|
21
|
+
thirdplace: Spiel um Platz 3
|
22
|
+
final: Finale|Endspiel
|
23
|
+
|
24
|
+
### Pair matches/games if marked with leg1 n leg2
|
25
|
+
|
26
|
+
leg1: Hin|Hinspiel|Hinspiele
|
27
|
+
leg2: Rück|Rückspiel|Rückspiele
|
28
|
+
|
29
|
+
|
30
|
+
#######################
|
31
|
+
# months of year
|
32
|
+
|
33
|
+
january: Jänner|Januar
|
34
|
+
february: Feber|Februar
|
35
|
+
march: März
|
36
|
+
april: April
|
37
|
+
may: Mai
|
38
|
+
june: Juni
|
39
|
+
july: Juli
|
40
|
+
august: August
|
41
|
+
september: September
|
42
|
+
october: Oktober
|
43
|
+
november: November
|
44
|
+
december: Dezember
|
45
|
+
|
46
|
+
|
@@ -0,0 +1,54 @@
|
|
1
|
+
###########################
|
2
|
+
# known keywords for fixtures
|
3
|
+
|
4
|
+
|
5
|
+
group: Group
|
6
|
+
|
7
|
+
round: Round|Matchday|Week
|
8
|
+
|
9
|
+
stage: Stage|Phase|Rounds
|
10
|
+
# e.g.
|
11
|
+
# Group stage
|
12
|
+
# Play off stage|Play-off stage
|
13
|
+
# Knockout stage|Knockout stages
|
14
|
+
# First stage
|
15
|
+
# Second stage
|
16
|
+
# Qualifying rounds
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
### Knockout rounds
|
21
|
+
|
22
|
+
playoffs: Playoff|Playoffs|Play-off|Play-offs|Play-off for quarter-finals
|
23
|
+
round32: Round of 32|Last 32
|
24
|
+
round16: Round of 16|Last 16|8th finals
|
25
|
+
quarterfinals: Quarterfinals|Quarter-finals|Quarters|Quarterfinal|Last 8
|
26
|
+
semifinals: Semifinals|Semi-finals|Semis|Last 4
|
27
|
+
fifthplace: Fifth place match|Fifth place|5th place match|5th place final|5th place|Match for fifth place|Match for 5th place
|
28
|
+
thirdplace: Third place match|Third-place match|Third place|3rd place match|3rd place final|3rd place|Match for third place|Match for 3rd place|Third-place play-off|Third place play-off
|
29
|
+
final: Final|Finals
|
30
|
+
|
31
|
+
|
32
|
+
### Pair matches/games if marked with leg1 n leg2
|
33
|
+
|
34
|
+
leg1: 1st leg|First leg
|
35
|
+
leg2: 2nd leg|Second leg
|
36
|
+
|
37
|
+
|
38
|
+
#######################
|
39
|
+
# months of year
|
40
|
+
|
41
|
+
january: January
|
42
|
+
february: February
|
43
|
+
march: March
|
44
|
+
april: April
|
45
|
+
may: May
|
46
|
+
june: June
|
47
|
+
july: July
|
48
|
+
august: August
|
49
|
+
september: September
|
50
|
+
october: October
|
51
|
+
november: November
|
52
|
+
december: December
|
53
|
+
|
54
|
+
|
@@ -0,0 +1,48 @@
|
|
1
|
+
###########################
|
2
|
+
# known keywords for fixtures
|
3
|
+
|
4
|
+
|
5
|
+
group: Grupo
|
6
|
+
|
7
|
+
round: Fecha|Jornada
|
8
|
+
|
9
|
+
|
10
|
+
stage: Primera fase|Segunda fase|Fase de grupos|Fase final
|
11
|
+
|
12
|
+
|
13
|
+
### Knock out rounds
|
14
|
+
|
15
|
+
## fix: add playoffs + fifthplace
|
16
|
+
|
17
|
+
|
18
|
+
round32: Dieciseisavos de final|16vos de final
|
19
|
+
round16: Octavos|Octavos de final|8vos de final
|
20
|
+
quarterfinals: Cuartos|Cuartos de final|4tos de final
|
21
|
+
semifinals: Semifinales|Semifinal
|
22
|
+
thirdplace: Tercer lugar
|
23
|
+
final: Final
|
24
|
+
|
25
|
+
### Pair matches/games if marked with leg1 n leg2
|
26
|
+
|
27
|
+
leg1: Ida
|
28
|
+
leg2: Vuelta
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
#######################
|
33
|
+
# months of year
|
34
|
+
|
35
|
+
january: enero
|
36
|
+
february: febrero
|
37
|
+
march: marzo
|
38
|
+
april: abril
|
39
|
+
may: mayo
|
40
|
+
june: junio
|
41
|
+
july: julio
|
42
|
+
august: agosto
|
43
|
+
september: septiembre
|
44
|
+
october: octubre
|
45
|
+
november: noviembre
|
46
|
+
december: diciembre
|
47
|
+
|
48
|
+
|
@@ -0,0 +1,53 @@
|
|
1
|
+
###########################
|
2
|
+
# known keywords for fixtures
|
3
|
+
|
4
|
+
|
5
|
+
group: Groupe
|
6
|
+
|
7
|
+
round: Journée
|
8
|
+
|
9
|
+
stage: Phase de groupes|Phase à élimination directe|Phase finale
|
10
|
+
# e.g.
|
11
|
+
# Group stage
|
12
|
+
# Play off stage|Play-off stage
|
13
|
+
# Knockout stage|Knockout stages
|
14
|
+
# First stage
|
15
|
+
# Second stage
|
16
|
+
# Qualifying rounds
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
### Knockout rounds
|
22
|
+
|
23
|
+
## fix: add playoffs + fifthplace
|
24
|
+
|
25
|
+
|
26
|
+
round32: Seizièmes de finale
|
27
|
+
round16: Huitièmes de finale
|
28
|
+
quarterfinals: Quarts de finale
|
29
|
+
semifinals: Demi-finales
|
30
|
+
thirdplace: Match pour la troisième place
|
31
|
+
final: Finale
|
32
|
+
|
33
|
+
### Pair matches/games if marked with leg1 n leg2
|
34
|
+
|
35
|
+
leg1: Match aller
|
36
|
+
leg2: Match retour
|
37
|
+
|
38
|
+
|
39
|
+
#######################
|
40
|
+
# months of year
|
41
|
+
|
42
|
+
january: janvier
|
43
|
+
february: février
|
44
|
+
march: mars
|
45
|
+
april: avril
|
46
|
+
may: mai
|
47
|
+
june: juin
|
48
|
+
july: juillet
|
49
|
+
august: août
|
50
|
+
september: septembre
|
51
|
+
october: octobre
|
52
|
+
november: novembre
|
53
|
+
december: décembre
|
@@ -0,0 +1,55 @@
|
|
1
|
+
###########################
|
2
|
+
# known keywords for fixtures
|
3
|
+
|
4
|
+
|
5
|
+
group: Gruppo
|
6
|
+
|
7
|
+
|
8
|
+
round: Giornata
|
9
|
+
|
10
|
+
stage: Fase a gironi|Fase a eliminazione diretta
|
11
|
+
# e.g.
|
12
|
+
# Group stage
|
13
|
+
# Play off stage|Play-off stage
|
14
|
+
# Knockout stage|Knockout stages
|
15
|
+
# First stage
|
16
|
+
# Second stage
|
17
|
+
# Qualifying rounds
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
### Knockout rounds
|
23
|
+
|
24
|
+
## fix: add playoffs + fifthplace
|
25
|
+
|
26
|
+
|
27
|
+
round32: Sedicesimi di finale
|
28
|
+
round16: Ottavi di finale
|
29
|
+
quarterfinals: Quarti di finale
|
30
|
+
semifinals: Semifinali
|
31
|
+
thirdplace: Finale 3º posto
|
32
|
+
final: Finale
|
33
|
+
|
34
|
+
### Pair matches/games if marked with leg1 n leg2
|
35
|
+
|
36
|
+
leg1: Andata
|
37
|
+
leg2: Ritorno
|
38
|
+
|
39
|
+
|
40
|
+
#######################
|
41
|
+
# months of year
|
42
|
+
|
43
|
+
january: gennaio
|
44
|
+
february: febbraio
|
45
|
+
march: marzo
|
46
|
+
april: aprile
|
47
|
+
may: maggio
|
48
|
+
june: giugno
|
49
|
+
july: luglio
|
50
|
+
august: agosto
|
51
|
+
september: settembre
|
52
|
+
october: ottobre
|
53
|
+
november: novembre
|
54
|
+
december: dicembre
|
55
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
###########################
|
2
|
+
# known keywords for fixtures
|
3
|
+
|
4
|
+
|
5
|
+
group: Grupo
|
6
|
+
|
7
|
+
round: Rodada
|
8
|
+
|
9
|
+
stage: Fase de grupos|Fase final|Primeira Fase|Segunda Fase
|
10
|
+
|
11
|
+
|
12
|
+
### Knock out rounds
|
13
|
+
|
14
|
+
## fix: add playoffs + fifthplace
|
15
|
+
|
16
|
+
round32: 16-avos de final
|
17
|
+
round16: Oitavos de final|Oitavas-de-final
|
18
|
+
quarterfinals: Quartos de final|Quartas-de-final
|
19
|
+
semifinals: Semifinais
|
20
|
+
thirdplace: Terceiro lugar
|
21
|
+
final: Final
|
22
|
+
|
23
|
+
|
24
|
+
### Pair matches/games if marked with leg1 n leg2
|
25
|
+
|
26
|
+
leg1: 1º jogo # Ida -- exists ??
|
27
|
+
leg2: 2º jogo # Volta -- exists ??
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
#######################
|
32
|
+
# months of year
|
33
|
+
|
34
|
+
january: janeiro
|
35
|
+
february: fevereiro
|
36
|
+
march: março
|
37
|
+
april: abril
|
38
|
+
may: maio
|
39
|
+
june: junho
|
40
|
+
july: julho
|
41
|
+
august: agosto
|
42
|
+
september: setembro
|
43
|
+
october: outubro
|
44
|
+
november: novembro
|
45
|
+
december: dezembro
|
46
|
+
|
@@ -0,0 +1,55 @@
|
|
1
|
+
###########################
|
2
|
+
# known keywords for fixtures
|
3
|
+
|
4
|
+
|
5
|
+
group: Grupa
|
6
|
+
|
7
|
+
round: Runda|Etapa
|
8
|
+
|
9
|
+
|
10
|
+
stage: Faza grupelor|Faza eliminatorie
|
11
|
+
# e.g.
|
12
|
+
# Group stage
|
13
|
+
# Play off stage|Play-off stage
|
14
|
+
# Knockout stage|Knockout stages
|
15
|
+
# First stage
|
16
|
+
# Second stage
|
17
|
+
# Qualifying rounds
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
### Knockout rounds
|
23
|
+
|
24
|
+
## fix: add playoffs + fifthplace
|
25
|
+
|
26
|
+
|
27
|
+
round32: 1/16 de finală
|
28
|
+
round16: Optimi de finală
|
29
|
+
quarterfinals: Sferturi de finală
|
30
|
+
semifinals: Semifinale
|
31
|
+
thirdplace: Meciul pentru locul 3
|
32
|
+
final: Finala
|
33
|
+
|
34
|
+
### Pair matches/games if marked with leg1 n leg2
|
35
|
+
|
36
|
+
leg1: Tur ## Prima manșă - use too ??
|
37
|
+
leg2: Retur ## Manșa secundă - use too ??
|
38
|
+
|
39
|
+
|
40
|
+
#######################
|
41
|
+
# months of year
|
42
|
+
|
43
|
+
january: ianuarie
|
44
|
+
february: februarie
|
45
|
+
march: martie
|
46
|
+
april: aprilie
|
47
|
+
may: mai
|
48
|
+
june: iunie
|
49
|
+
july: iulie
|
50
|
+
august: august
|
51
|
+
september: septembrie
|
52
|
+
october: octombrie
|
53
|
+
november: noiembrie
|
54
|
+
december: decembrie
|
55
|
+
|
@@ -6,7 +6,8 @@ module Datafile # note: keep Datafile in its own top-level module/namespace
|
|
6
6
|
def self.find( path, pattern )
|
7
7
|
datafiles = []
|
8
8
|
|
9
|
-
## check all txt files
|
9
|
+
## check all txt files
|
10
|
+
## note: incl. files starting with dot (.)) as candidates (normally excluded with just *)
|
10
11
|
candidates = Dir.glob( "#{path}/**/{*,.*}.txt" )
|
11
12
|
pp candidates
|
12
13
|
candidates.each do |candidate|
|
@@ -32,20 +33,25 @@ module Datafile # note: keep Datafile in its own top-level module/namespace
|
|
32
33
|
def self.find_clubs( path, pattern: CLUBS_REGEX ) find( path, pattern ); end
|
33
34
|
def self.find_clubs_wiki( path, pattern: CLUBS_WIKI_REGEX ) find( path, pattern ); end
|
34
35
|
|
36
|
+
def self.match_clubs( path ) CLUBS_REGEX.match( path ); end
|
37
|
+
def self.match_clubs_wiki( path ) CLUBS_WIKI_REGEX.match( path ); end
|
38
|
+
|
39
|
+
|
35
40
|
|
36
41
|
LEAGUES_REGEX = %r{ (?:^|/) # beginning (^) or beginning of path (/)
|
37
42
|
leagues\.txt$
|
38
43
|
}x
|
39
44
|
|
40
|
-
def self.find_leagues( path, pattern: LEAGUES_REGEX )
|
45
|
+
def self.find_leagues( path, pattern: LEAGUES_REGEX ) find( path, pattern ); end
|
46
|
+
def self.match_leagues( path ) LEAGUES_REGEX.match( path ); end
|
41
47
|
|
42
48
|
|
43
49
|
CONF_REGEX = %r{ (?:^|/) # beginning (^) or beginning of path (/)
|
44
50
|
\.conf\.txt$
|
45
51
|
}x
|
46
52
|
|
47
|
-
def self.find_conf( path, pattern: CONF_REGEX )
|
48
|
-
|
53
|
+
def self.find_conf( path, pattern: CONF_REGEX ) find( path, pattern ); end
|
54
|
+
def self.match_conf( path ) CONF_REGEX.match( path ); end
|
49
55
|
|
50
56
|
|
51
57
|
|