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.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/Manifest.txt +6 -33
  3. data/Rakefile +2 -5
  4. data/lib/sportdb/formats.rb +54 -70
  5. data/lib/sportdb/formats/country/country_index.rb +2 -2
  6. data/lib/sportdb/formats/event/event_index.rb +141 -0
  7. data/lib/sportdb/formats/event/event_reader.rb +183 -0
  8. data/lib/sportdb/formats/league/league_index.rb +22 -18
  9. data/lib/sportdb/formats/league/league_outline_reader.rb +45 -13
  10. data/lib/sportdb/formats/league/league_reader.rb +7 -1
  11. data/lib/sportdb/formats/match/match_parser.rb +101 -111
  12. data/lib/sportdb/formats/package.rb +59 -11
  13. data/lib/sportdb/formats/parser_helper.rb +11 -2
  14. data/lib/sportdb/formats/team/club_index.rb +13 -11
  15. data/lib/sportdb/formats/team/club_index_history.rb +134 -0
  16. data/lib/sportdb/formats/team/club_reader_history.rb +203 -0
  17. data/lib/sportdb/formats/team/club_reader_props.rb +20 -5
  18. data/lib/sportdb/formats/version.rb +2 -2
  19. data/test/helper.rb +51 -81
  20. data/test/test_club_index_history.rb +107 -0
  21. data/test/test_club_reader_history.rb +212 -0
  22. data/test/test_datafile_package.rb +1 -1
  23. data/test/test_regex.rb +25 -7
  24. metadata +9 -78
  25. data/lib/sportdb/formats/config.rb +0 -40
  26. data/lib/sportdb/formats/match/match_parser_csv.rb +0 -314
  27. data/lib/sportdb/formats/name_helper.rb +0 -84
  28. data/lib/sportdb/formats/score/score_formats.rb +0 -220
  29. data/lib/sportdb/formats/score/score_parser.rb +0 -202
  30. data/lib/sportdb/formats/season_utils.rb +0 -27
  31. data/lib/sportdb/formats/structs/country.rb +0 -31
  32. data/lib/sportdb/formats/structs/group.rb +0 -18
  33. data/lib/sportdb/formats/structs/league.rb +0 -37
  34. data/lib/sportdb/formats/structs/match.rb +0 -151
  35. data/lib/sportdb/formats/structs/matchlist.rb +0 -220
  36. data/lib/sportdb/formats/structs/round.rb +0 -25
  37. data/lib/sportdb/formats/structs/season.rb +0 -123
  38. data/lib/sportdb/formats/structs/standings.rb +0 -247
  39. data/lib/sportdb/formats/structs/team.rb +0 -150
  40. data/lib/sportdb/formats/structs/team_usage.rb +0 -88
  41. data/test/test_clubs.rb +0 -40
  42. data/test/test_conf.rb +0 -65
  43. data/test/test_csv_match_parser.rb +0 -114
  44. data/test/test_csv_match_parser_utils.rb +0 -20
  45. data/test/test_csv_reader.rb +0 -31
  46. data/test/test_match.rb +0 -30
  47. data/test/test_match_auto.rb +0 -72
  48. data/test/test_match_auto_champs.rb +0 -45
  49. data/test/test_match_auto_euro.rb +0 -37
  50. data/test/test_match_auto_worldcup.rb +0 -61
  51. data/test/test_match_champs.rb +0 -27
  52. data/test/test_match_eng.rb +0 -26
  53. data/test/test_match_euro.rb +0 -27
  54. data/test/test_match_worldcup.rb +0 -27
  55. data/test/test_name_helper.rb +0 -67
  56. data/test/test_scores.rb +0 -122
  57. data/test/test_season.rb +0 -62
@@ -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