sportdb-formats 1.0.6 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Manifest.txt +6 -33
- data/Rakefile +2 -5
- data/lib/sportdb/formats.rb +54 -70
- data/lib/sportdb/formats/country/country_index.rb +2 -2
- data/lib/sportdb/formats/event/event_index.rb +141 -0
- data/lib/sportdb/formats/event/event_reader.rb +183 -0
- data/lib/sportdb/formats/league/league_index.rb +22 -18
- data/lib/sportdb/formats/league/league_outline_reader.rb +45 -13
- data/lib/sportdb/formats/league/league_reader.rb +7 -1
- data/lib/sportdb/formats/match/match_parser.rb +101 -111
- data/lib/sportdb/formats/package.rb +59 -11
- data/lib/sportdb/formats/parser_helper.rb +11 -2
- data/lib/sportdb/formats/team/club_index.rb +13 -11
- data/lib/sportdb/formats/team/club_index_history.rb +134 -0
- data/lib/sportdb/formats/team/club_reader_history.rb +203 -0
- data/lib/sportdb/formats/team/club_reader_props.rb +20 -5
- data/lib/sportdb/formats/version.rb +2 -2
- data/test/helper.rb +51 -81
- data/test/test_club_index_history.rb +107 -0
- data/test/test_club_reader_history.rb +212 -0
- data/test/test_datafile_package.rb +1 -1
- data/test/test_regex.rb +25 -7
- metadata +9 -78
- data/lib/sportdb/formats/config.rb +0 -40
- data/lib/sportdb/formats/match/match_parser_csv.rb +0 -314
- data/lib/sportdb/formats/name_helper.rb +0 -84
- data/lib/sportdb/formats/score/score_formats.rb +0 -220
- data/lib/sportdb/formats/score/score_parser.rb +0 -202
- data/lib/sportdb/formats/season_utils.rb +0 -27
- data/lib/sportdb/formats/structs/country.rb +0 -31
- data/lib/sportdb/formats/structs/group.rb +0 -18
- data/lib/sportdb/formats/structs/league.rb +0 -37
- data/lib/sportdb/formats/structs/match.rb +0 -151
- data/lib/sportdb/formats/structs/matchlist.rb +0 -220
- data/lib/sportdb/formats/structs/round.rb +0 -25
- data/lib/sportdb/formats/structs/season.rb +0 -123
- data/lib/sportdb/formats/structs/standings.rb +0 -247
- data/lib/sportdb/formats/structs/team.rb +0 -150
- data/lib/sportdb/formats/structs/team_usage.rb +0 -88
- data/test/test_clubs.rb +0 -40
- data/test/test_conf.rb +0 -65
- data/test/test_csv_match_parser.rb +0 -114
- data/test/test_csv_match_parser_utils.rb +0 -20
- data/test/test_csv_reader.rb +0 -31
- data/test/test_match.rb +0 -30
- data/test/test_match_auto.rb +0 -72
- data/test/test_match_auto_champs.rb +0 -45
- data/test/test_match_auto_euro.rb +0 -37
- data/test/test_match_auto_worldcup.rb +0 -61
- data/test/test_match_champs.rb +0 -27
- data/test/test_match_eng.rb +0 -26
- data/test/test_match_euro.rb +0 -27
- data/test/test_match_worldcup.rb +0 -27
- data/test/test_name_helper.rb +0 -67
- data/test/test_scores.rb +0 -122
- data/test/test_season.rb +0 -62
data/test/test_season.rb
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
###
|
4
|
-
# to run use
|
5
|
-
# ruby -I ./lib -I ./test test/test_season.rb
|
6
|
-
|
7
|
-
|
8
|
-
require 'helper'
|
9
|
-
|
10
|
-
class TestSeason < MiniTest::Test
|
11
|
-
|
12
|
-
Season = SportDb::Import::Season
|
13
|
-
|
14
|
-
def test_path
|
15
|
-
assert_equal '2010-11', Season.new( '2010-11' ).path
|
16
|
-
assert_equal '2010-11', Season.new( '2010-2011' ).path
|
17
|
-
assert_equal '2010-11', Season.new( '2010/11' ).path
|
18
|
-
assert_equal '2010-11', Season.new( '2010/1' ).path
|
19
|
-
assert_equal '2010-11', Season.new( '2010/2011' ).path
|
20
|
-
assert_equal '2010', Season.new( '2010' ).path
|
21
|
-
|
22
|
-
assert_equal '2010s/2010-11', Season.new( '2010-11' ).path( format: 'long' )
|
23
|
-
assert_equal '2010s/2010-11', Season.new( '2010-2011' ).path( format: 'long' )
|
24
|
-
assert_equal '2010s/2010', Season.new( '2010' ).path( format: 'long' )
|
25
|
-
|
26
|
-
assert_equal '1999-00', Season.new( '1999-00' ).path
|
27
|
-
assert_equal '1999-00', Season.new( '1999-2000' ).path
|
28
|
-
assert_equal '1990s/1999-00', Season.new( '1999-00' ).path( format: 'long' )
|
29
|
-
assert_equal '1990s/1999-00', Season.new( '1999-2000' ).path( format: 'long' )
|
30
|
-
end # method test_path
|
31
|
-
|
32
|
-
def test_key
|
33
|
-
assert_equal '2010/11', Season.new( '2010-11' ).key
|
34
|
-
assert_equal '2010/11', Season.new( '2010-2011' ).key
|
35
|
-
assert_equal '2010/11', Season.new( '2010/11' ).key
|
36
|
-
assert_equal '2010/11', Season.new( '2010/1' ).key
|
37
|
-
assert_equal '2010/11', Season.new( '2010/2011' ).key
|
38
|
-
assert_equal '2010', Season.new( '2010' ).key
|
39
|
-
|
40
|
-
assert_equal '1999/00', Season.new( '1999-00' ).key
|
41
|
-
assert_equal '1999/00', Season.new( '1999-2000' ).key
|
42
|
-
end # method test_key
|
43
|
-
|
44
|
-
def test_years
|
45
|
-
season = Season.new( '1999-00' )
|
46
|
-
assert_equal 1999, season.start_year
|
47
|
-
assert_equal 2000, season.end_year
|
48
|
-
|
49
|
-
season = Season.new( '2010/1' )
|
50
|
-
assert_equal 2010, season.start_year
|
51
|
-
assert_equal 2011, season.end_year
|
52
|
-
end
|
53
|
-
|
54
|
-
def test_prev
|
55
|
-
assert_equal '2009/10', Season.new( '2010-11' ).prev.key
|
56
|
-
assert_equal '2009/10', Season.new( '2010-2011' ).prev.key
|
57
|
-
assert_equal '2009', Season.new( '2010' ).prev.key
|
58
|
-
|
59
|
-
assert_equal '1998/99', Season.new( '1999-00' ).prev.key
|
60
|
-
assert_equal '1998/99', Season.new( '1999-2000' ).prev.key
|
61
|
-
end
|
62
|
-
end # class TestSeason
|