sportdb-writers 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +6 -4
- data/Manifest.txt +2 -4
- data/README.md +26 -28
- data/Rakefile +32 -30
- data/lib/sportdb/leagues/leagues_at.rb +35 -39
- data/lib/sportdb/leagues/leagues_de.rb +21 -29
- data/lib/sportdb/leagues/leagues_eng.rb +58 -70
- data/lib/sportdb/leagues/leagues_es.rb +15 -19
- data/lib/sportdb/leagues/leagues_europe.rb +178 -213
- data/lib/sportdb/leagues/leagues_it.rb +16 -20
- data/lib/sportdb/leagues/leagues_mx.rb +23 -25
- data/lib/sportdb/leagues/leagues_south_america.rb +17 -21
- data/lib/sportdb/leagues/leagues_world.rb +14 -16
- data/lib/sportdb/writers/github.rb +195 -0
- data/lib/sportdb/writers/goals.rb +57 -0
- data/lib/sportdb/writers/txt_writer.rb +218 -407
- data/lib/sportdb/writers/version.rb +24 -24
- data/lib/sportdb/writers/write.rb +269 -367
- data/lib/sportdb/writers.rb +97 -31
- metadata +42 -17
- data/lib/sportdb/writers/config.rb +0 -18
- data/test/helper.rb +0 -19
- data/test/test_txt_writer.rb +0 -124
- data/test/test_version.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dd53f29e4c9fc243e9a5c5ba34f0e603931317de512fd5e6c397525e49c5b773
|
4
|
+
data.tar.gz: 5d1a596224394e46ec4ad8b8466e925c1a916f5aeb4bc29fba1db55cd5bb7822
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c22afc771f1dc08681bb6a201c870b5e9688cf132a2b8d7d789fcefa1748569fdc6701e1f6b2d83f1da8c55c23bc6b7a0ba56903c2e881a65087a99f493181bb
|
7
|
+
data.tar.gz: ee81dcb5964247503b0d484889b12a122416fb3d0fd8f42cb712065d75501bf1cd18715e3d4b57b202a31a0ec9f6f5624a536b45552d3a64b29e9baffd65d9db
|
data/CHANGELOG.md
CHANGED
data/Manifest.txt
CHANGED
@@ -12,10 +12,8 @@ lib/sportdb/leagues/leagues_mx.rb
|
|
12
12
|
lib/sportdb/leagues/leagues_south_america.rb
|
13
13
|
lib/sportdb/leagues/leagues_world.rb
|
14
14
|
lib/sportdb/writers.rb
|
15
|
-
lib/sportdb/writers/
|
15
|
+
lib/sportdb/writers/github.rb
|
16
|
+
lib/sportdb/writers/goals.rb
|
16
17
|
lib/sportdb/writers/txt_writer.rb
|
17
18
|
lib/sportdb/writers/version.rb
|
18
19
|
lib/sportdb/writers/write.rb
|
19
|
-
test/helper.rb
|
20
|
-
test/test_txt_writer.rb
|
21
|
-
test/test_version.rb
|
data/README.md
CHANGED
@@ -1,28 +1,26 @@
|
|
1
|
-
# sportdb-writers - sport.db writers for match schedules and results, and more
|
2
|
-
|
3
|
-
* home :: [github.com/sportdb/sport.db](https://github.com/sportdb/sport.db)
|
4
|
-
* bugs :: [github.com/sportdb/sport.db/issues](https://github.com/sportdb/sport.db/issues)
|
5
|
-
* gem :: [rubygems.org/gems/sportdb-writers](https://rubygems.org/gems/sportdb-writers)
|
6
|
-
* rdoc :: [rubydoc.info/gems/sportdb-writers](http://rubydoc.info/gems/sportdb-writers)
|
7
|
-
* forum :: [groups.google.com/group/opensport](https://groups.google.com/group/opensport)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
## Usage
|
12
|
-
|
13
|
-
To be done
|
14
|
-
|
15
|
-
|
16
|
-
## License
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
[Open Sports & Friends Forum/Mailing List](http://groups.google.com/group/opensport).
|
28
|
-
Thanks!
|
1
|
+
# sportdb-writers - sport.db writers for match schedules and results, and more
|
2
|
+
|
3
|
+
* home :: [github.com/sportdb/sport.db](https://github.com/sportdb/sport.db)
|
4
|
+
* bugs :: [github.com/sportdb/sport.db/issues](https://github.com/sportdb/sport.db/issues)
|
5
|
+
* gem :: [rubygems.org/gems/sportdb-writers](https://rubygems.org/gems/sportdb-writers)
|
6
|
+
* rdoc :: [rubydoc.info/gems/sportdb-writers](http://rubydoc.info/gems/sportdb-writers)
|
7
|
+
* forum :: [groups.google.com/group/opensport](https://groups.google.com/group/opensport)
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
To be done
|
14
|
+
|
15
|
+
|
16
|
+
## License
|
17
|
+
|
18
|
+
The `sportdb-writers` scripts are dedicated to the public domain.
|
19
|
+
Use it as you please with no restrictions whatsoever.
|
20
|
+
|
21
|
+
|
22
|
+
## Questions? Comments?
|
23
|
+
|
24
|
+
Yes, you can. More than welcome.
|
25
|
+
See [Help & Support »](https://github.com/openfootball/help)
|
26
|
+
|
data/Rakefile
CHANGED
@@ -1,30 +1,32 @@
|
|
1
|
-
require 'hoe'
|
2
|
-
require './lib/sportdb/writers/version.rb'
|
3
|
-
|
4
|
-
Hoe.spec 'sportdb-writers' do
|
5
|
-
|
6
|
-
self.version = SportDb::Module::Writers::VERSION
|
7
|
-
|
8
|
-
self.summary = 'sportdb-writers - sport.db writers for match schedules and results, and more'
|
9
|
-
self.description = summary
|
10
|
-
|
11
|
-
self.urls = { home: 'https://github.com/sportdb/sport.db' }
|
12
|
-
|
13
|
-
self.author = 'Gerald Bauer'
|
14
|
-
self.email = '
|
15
|
-
|
16
|
-
# switch extension to .markdown for gihub formatting
|
17
|
-
self.readme_file = 'README.md'
|
18
|
-
self.history_file = 'CHANGELOG.md'
|
19
|
-
|
20
|
-
self.extra_deps = [
|
21
|
-
['sportdb-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
self.
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
1
|
+
require 'hoe'
|
2
|
+
require './lib/sportdb/writers/version.rb'
|
3
|
+
|
4
|
+
Hoe.spec 'sportdb-writers' do
|
5
|
+
|
6
|
+
self.version = SportDb::Module::Writers::VERSION
|
7
|
+
|
8
|
+
self.summary = 'sportdb-writers - sport.db writers for match schedules and results, and more'
|
9
|
+
self.description = summary
|
10
|
+
|
11
|
+
self.urls = { home: 'https://github.com/sportdb/sport.db' }
|
12
|
+
|
13
|
+
self.author = 'Gerald Bauer'
|
14
|
+
self.email = 'gerald.bauer@gmail.com'
|
15
|
+
|
16
|
+
# switch extension to .markdown for gihub formatting
|
17
|
+
self.readme_file = 'README.md'
|
18
|
+
self.history_file = 'CHANGELOG.md'
|
19
|
+
|
20
|
+
self.extra_deps = [
|
21
|
+
['sportdb-formats'], # , '>= 1.0.0'],
|
22
|
+
['gitti'],
|
23
|
+
['cocos'], ### fix - move upstream (incl. in sportdb-format)
|
24
|
+
]
|
25
|
+
|
26
|
+
self.licenses = ['Public Domain']
|
27
|
+
|
28
|
+
self.spec_extras = {
|
29
|
+
required_ruby_version: '>= 2.2.2'
|
30
|
+
}
|
31
|
+
|
32
|
+
end
|
@@ -1,39 +1,35 @@
|
|
1
|
-
module Writer
|
2
|
-
|
3
|
-
########################
|
4
|
-
# Austria
|
5
|
-
|
6
|
-
LEAGUES.merge!(
|
7
|
-
'at.1' => { name: 'Österr. Bundesliga',
|
8
|
-
basename: '1-bundesliga',
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
basename: ->(season) { season.start_year >= 2018 ?
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
'at.3.o' => { name: 'Österr. Regionalliga Ost',
|
28
|
-
basename: '3-regionalliga-ost',
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
}
|
37
|
-
)
|
38
|
-
|
39
|
-
end # module Writer
|
1
|
+
module Writer
|
2
|
+
|
3
|
+
########################
|
4
|
+
# Austria
|
5
|
+
|
6
|
+
LEAGUES.merge!(
|
7
|
+
'at.1' => { name: 'Österr. Bundesliga',
|
8
|
+
basename: '1-bundesliga',
|
9
|
+
stages: ->(season) {
|
10
|
+
if season.start_year >= 2018
|
11
|
+
[['Grunddurchgang'],
|
12
|
+
['Finaldurchgang - Meister',
|
13
|
+
'Finaldurchgang - Qualifikation',
|
14
|
+
'Europa League Play-off']]
|
15
|
+
else
|
16
|
+
nil
|
17
|
+
end
|
18
|
+
},
|
19
|
+
},
|
20
|
+
'at.2' => { name: ->(season) { season.start_year >= 2018 ?
|
21
|
+
'Österr. 2. Liga' :
|
22
|
+
'Österr. Erste Liga' },
|
23
|
+
basename: ->(season) { season.start_year >= 2018 ?
|
24
|
+
'2-liga2' :
|
25
|
+
'2-liga1' },
|
26
|
+
},
|
27
|
+
'at.3.o' => { name: 'Österr. Regionalliga Ost',
|
28
|
+
basename: '3-regionalliga-ost',
|
29
|
+
},
|
30
|
+
'at.cup' => { name: 'ÖFB Cup',
|
31
|
+
basename: 'cup',
|
32
|
+
}
|
33
|
+
)
|
34
|
+
|
35
|
+
end # module Writer
|
@@ -1,29 +1,21 @@
|
|
1
|
-
module Writer
|
2
|
-
|
3
|
-
############################
|
4
|
-
# Germany / Deutschland
|
5
|
-
|
6
|
-
LEAGUES.merge!(
|
7
|
-
'de.1' => { name: 'Deutsche Bundesliga',
|
8
|
-
basename: '1-bundesliga',
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
'de.cup' => { name: 'DFB Pokal',
|
23
|
-
basename: 'cup',
|
24
|
-
path: 'deutschland',
|
25
|
-
lang: 'de_DE',
|
26
|
-
}
|
27
|
-
)
|
28
|
-
|
29
|
-
end # module Writer
|
1
|
+
module Writer
|
2
|
+
|
3
|
+
############################
|
4
|
+
# Germany / Deutschland
|
5
|
+
|
6
|
+
LEAGUES.merge!(
|
7
|
+
'de.1' => { name: 'Deutsche Bundesliga',
|
8
|
+
basename: '1-bundesliga',
|
9
|
+
},
|
10
|
+
'de.2' => { name: 'Deutsche 2. Bundesliga',
|
11
|
+
basename: '2-bundesliga2',
|
12
|
+
},
|
13
|
+
'de.3' => { name: 'Deutsche 3. Liga',
|
14
|
+
basename: '3-liga3',
|
15
|
+
},
|
16
|
+
'de.cup' => { name: 'DFB Pokal',
|
17
|
+
basename: 'cup',
|
18
|
+
}
|
19
|
+
)
|
20
|
+
|
21
|
+
end # module Writer
|
@@ -1,70 +1,58 @@
|
|
1
|
-
module Writer
|
2
|
-
|
3
|
-
####################
|
4
|
-
# England
|
5
|
-
|
6
|
-
|
7
|
-
def self.eng1( season )
|
8
|
-
case season ## todo/fix: - use cast e.g. Season(season) - make sure it's a season obj
|
9
|
-
when Season('1888/89')..Season('1891/92') ## single league (no divisions)
|
10
|
-
{name: 'English Football League',
|
11
|
-
basename: '1-footballleague'}
|
12
|
-
when Season('1892/93')..Season('1991/92') ## start of division 1 & 2
|
13
|
-
{name: 'English Division One',
|
14
|
-
basename: '1-division1'}
|
15
|
-
else ## starts in season 1992/93
|
16
|
-
{name: 'English Premier League',
|
17
|
-
basename: '1-premierleague'}
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.eng2( season )
|
22
|
-
case season
|
23
|
-
when Season('1892/93')..Season('1991/92')
|
24
|
-
{name: 'English Division Two', ## or use English Football League Second Division ???
|
25
|
-
basename: '2-division2'}
|
26
|
-
when Season('1992/93')..Season('2003/04') ## start of premier league
|
27
|
-
{name: 'English Division One',
|
28
|
-
basename: '2-division1'}
|
29
|
-
else # starts in 2004/05
|
30
|
-
{name: 'English Championship', ## rebranding divsion 1 => championship
|
31
|
-
basename: '2-championship'}
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
|
36
|
-
LEAGUES.merge!(
|
37
|
-
'eng.1' => { name: ->(season) { eng1( season )[ :name ] },
|
38
|
-
basename: ->(season) { eng1( season )[ :basename ] },
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
'eng.
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
path: 'england',
|
60
|
-
lang: 'en',
|
61
|
-
},
|
62
|
-
'eng.cup' => { name: 'English FA Cup',
|
63
|
-
basename: 'facup',
|
64
|
-
path: 'england',
|
65
|
-
lang: 'en',
|
66
|
-
}
|
67
|
-
)
|
68
|
-
|
69
|
-
end # module Writer
|
70
|
-
|
1
|
+
module Writer
|
2
|
+
|
3
|
+
####################
|
4
|
+
# England
|
5
|
+
|
6
|
+
|
7
|
+
def self.eng1( season )
|
8
|
+
case season ## todo/fix: - use cast e.g. Season(season) - make sure it's a season obj
|
9
|
+
when Season('1888/89')..Season('1891/92') ## single league (no divisions)
|
10
|
+
{name: 'English Football League',
|
11
|
+
basename: '1-footballleague'}
|
12
|
+
when Season('1892/93')..Season('1991/92') ## start of division 1 & 2
|
13
|
+
{name: 'English Division One',
|
14
|
+
basename: '1-division1'}
|
15
|
+
else ## starts in season 1992/93
|
16
|
+
{name: 'English Premier League',
|
17
|
+
basename: '1-premierleague'}
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.eng2( season )
|
22
|
+
case season
|
23
|
+
when Season('1892/93')..Season('1991/92')
|
24
|
+
{name: 'English Division Two', ## or use English Football League Second Division ???
|
25
|
+
basename: '2-division2'}
|
26
|
+
when Season('1992/93')..Season('2003/04') ## start of premier league
|
27
|
+
{name: 'English Division One',
|
28
|
+
basename: '2-division1'}
|
29
|
+
else # starts in 2004/05
|
30
|
+
{name: 'English Championship', ## rebranding divsion 1 => championship
|
31
|
+
basename: '2-championship'}
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
LEAGUES.merge!(
|
37
|
+
'eng.1' => { name: ->(season) { eng1( season )[ :name ] },
|
38
|
+
basename: ->(season) { eng1( season )[ :basename ] },
|
39
|
+
},
|
40
|
+
'eng.2' => { name: ->(season) { eng2( season )[ :name ] },
|
41
|
+
basename: ->(season) { eng2( season )[ :basename ] },
|
42
|
+
},
|
43
|
+
'eng.3' => { name: 'English League One',
|
44
|
+
basename: '3-league1',
|
45
|
+
},
|
46
|
+
'eng.4' => { name: 'English League Two',
|
47
|
+
basename: '4-league2',
|
48
|
+
},
|
49
|
+
'eng.5' => { name: 'English National League',
|
50
|
+
basename: '5-nationalleague',
|
51
|
+
},
|
52
|
+
'eng.cup' => { name: 'English FA Cup',
|
53
|
+
basename: 'facup',
|
54
|
+
}
|
55
|
+
)
|
56
|
+
|
57
|
+
end # module Writer
|
58
|
+
|
@@ -1,19 +1,15 @@
|
|
1
|
-
module Writer
|
2
|
-
|
3
|
-
LEAGUES.merge!(
|
4
|
-
###################
|
5
|
-
# Spain / Espana
|
6
|
-
'es.1' => { name: 'Primera División de España',
|
7
|
-
basename: '1-liga',
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
)
|
17
|
-
|
18
|
-
end # module Writer
|
19
|
-
|
1
|
+
module Writer
|
2
|
+
|
3
|
+
LEAGUES.merge!(
|
4
|
+
###################
|
5
|
+
# Spain / Espana
|
6
|
+
'es.1' => { name: 'Primera División de España',
|
7
|
+
basename: '1-liga',
|
8
|
+
},
|
9
|
+
'es.2' => { name: 'Segunda División de España',
|
10
|
+
basename: '2-liga2',
|
11
|
+
},
|
12
|
+
)
|
13
|
+
|
14
|
+
end # module Writer
|
15
|
+
|