sportdb 1.7.8 → 1.7.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,6 +13,14 @@ module Matcher
13
13
  def match_teams_for_country( name, &blk )
14
14
  match_xxx_for_country( name, 'teams', blk )
15
15
  end
16
+
17
+ def match_tracks_for_country( name, &blk )
18
+ match_xxx_for_country( name, 'tracks', blk )
19
+ end
20
+
21
+ def match_skiers_for_country( name, &blk )
22
+ match_xxx_for_country( name, 'skiers', blk )
23
+ end
16
24
 
17
25
  end # module Matcher
18
26
 
@@ -53,8 +61,24 @@ class Reader
53
61
 
54
62
  if name =~ /^circuits/ # e.g. circuits.txt in formula1.db
55
63
  load_tracks( name )
64
+ elsif match_tracks_for_country( name ) do |country_key| # name =~ /^([a-z]{2})\/tracks/
65
+ # auto-add country code (from folder structure) for country-specific tracks
66
+ # e.g. at/tracks or at-austria/tracks
67
+ country = Country.find_by_key!( country_key )
68
+ load_tracks( name, country_id: country.id )
69
+ end
70
+ elsif name =~ /^tracks/ # e.g. tracks.txt in ski.db
71
+ load_tracks( name )
56
72
  elsif name =~ /^drivers/ # e.g. drivers.txt in formula1.db
57
73
  load_persons( name )
74
+ elsif match_skiers_for_country( name ) do |country_key| # name =~ /^([a-z]{2})\/skiers/
75
+ # auto-add country code (from folder structure) for country-specific skiers (persons)
76
+ # e.g. at/skiers or at-austria/skiers.men
77
+ country = Country.find_by_key!( country_key )
78
+ load_persons( name, country_id: country.id )
79
+ end
80
+ elsif name =~ /^skiers/ # e.g. skiers.men.txt in ski.db
81
+ load_persons( name )
58
82
  elsif name =~ /^teams/ # e.g. teams.txt in formula1.db
59
83
  load_teams( name )
60
84
  elsif name =~ /\/races/ # e.g. 2013/races.txt in formula1.db
@@ -1,6 +1,6 @@
1
1
 
2
2
  module SportDb
3
- VERSION = '1.7.8'
3
+ VERSION = '1.7.9'
4
4
  end
5
5
 
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.8
4
+ version: 1.7.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-17 00:00:00.000000000 Z
12
+ date: 2013-12-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: worlddb
16
- requirement: &22578024 !ruby/object:Gem::Requirement
16
+ requirement: &20495628 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.7'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *22578024
24
+ version_requirements: *20495628
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: fetcher
27
- requirement: &22577724 !ruby/object:Gem::Requirement
27
+ requirement: &20492676 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0.3'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *22577724
35
+ version_requirements: *20492676
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: gli
38
- requirement: &22577412 !ruby/object:Gem::Requirement
38
+ requirement: &20491188 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.5.6
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *22577412
46
+ version_requirements: *20491188
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rdoc
49
- requirement: &22577124 !ruby/object:Gem::Requirement
49
+ requirement: &20506020 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '4.0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *22577124
57
+ version_requirements: *20506020
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: hoe
60
- requirement: &22576836 !ruby/object:Gem::Requirement
60
+ requirement: &20504928 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '3.7'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *22576836
68
+ version_requirements: *20504928
69
69
  description: sportdb - sport.db command line tool
70
70
  email: opensport@googlegroups.com
71
71
  executables: