sportdb-readers 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 618fca12af08a963b2d86cbb61b377751e365092
4
- data.tar.gz: fdddea7cb85f4ff6581f11f897bd1f087d9bdd4b
3
+ metadata.gz: 8ad28dd6a155d56025a5c8297b5935a78c09748b
4
+ data.tar.gz: d48c720fc7cc7eebe3e55a566479371171444aba
5
5
  SHA512:
6
- metadata.gz: 5b1a5174887fd02e6f95f1574766dde03102b034175eb610cd8b28ab30d4cba890f256ac657af15e4129355807dada2294c2b101101d861bfccef71f4fd7f40e
7
- data.tar.gz: 3e200b894e12bcfa8f0b44ae1efb2e4e123b06e6fbaac920be88a99aacbb68db5ce705b5c7f9c944ec91214b1b4f8f77096e7bf3af574a2ed54f62f25abed2de
6
+ metadata.gz: 4033742a85c0b67ffb321e7fa53e5bf16857b148c9d8ecda7393116d1286483f4c05fc93fbb0df42d4739880b8578889da462eb5afd328d9a788cf1610c21e88
7
+ data.tar.gz: cfa373de5f5f6f516e001022f6ab664e1993babd74b4213316225d2046726f0342109e11d7bdce9c53b68f720221ec6c12694e146efd67140dc1ac222e75c72f
data/README.md CHANGED
@@ -53,16 +53,18 @@ Matchday 1
53
53
  ...
54
54
  ```
55
55
 
56
+ (Source: [england/2015-16/1-premierleague-i.txt](https://github.com/openfootball/england/blob/master/2015-16/1-premierleague-i.txt))
57
+
56
58
  and let's try:
57
59
 
58
60
  ``` ruby
59
61
  ## assumes football.db datasets for England in ./england directory
60
62
  ## see github.com/openfootball/england
61
- SportDb::MatchReader.read( './england/2015-16/1-premierleague-i.txt' )
62
- SportDb::MatchReader.read( './england/2015-16/1-premierleague-ii.txt' )
63
+ SportDb.read( './england/2015-16/1-premierleague-i.txt' )
64
+ SportDb.read( './england/2015-16/1-premierleague-ii.txt' )
63
65
 
64
66
  ## let's try another season
65
- SportDb::MatchReader.read( './england/2019-20/1-premierleague.txt' )
67
+ SportDb.read( './england/2019-20/1-premierleague.txt' )
66
68
  ```
67
69
 
68
70
  All leagues, seasons, clubs, match days and rounds, match fixtures and results,
@@ -103,22 +105,8 @@ pl.seasons.count #=> 2
103
105
  # and so on and so forth.
104
106
  ```
105
107
 
106
-
107
-
108
- Or as an alternative use the `read` convenience all-in-one shortcut helper:
109
-
110
- ``` ruby
111
- ## assumes football.db datasets for England in ./england directory
112
- ## see github.com/openfootball/england
113
- SportDb.read( './england/2015-16/1-premierleague-i.txt' )
114
- SportDb.read( './england/2015-16/1-premierleague-ii.txt' )
115
-
116
- ## let's try another season
117
- SportDb.read( './england/2019-20/1-premierleague.txt' )
118
- ```
119
-
120
- Bonus: Or as an alternative pass in the "package" directory or a zip archive and let `read` figure
121
- out what datafiles to read:
108
+ Bonus: As an alternative pass in the "package" directory or a zip archive and let `read` figure
109
+ out what datafiles to read in:
122
110
 
123
111
  ``` ruby
124
112
  ## assumes football.db datasets for England in ./england directory
@@ -130,6 +118,29 @@ SportDb.read( './england.zip' )
130
118
 
131
119
  That's it.
132
120
 
121
+ ## Frequently Asked Questions (F.A.Q.s) and Answers
122
+
123
+ Q: What about reading in datasets in comma-separated values (CSV) format?
124
+ Example:
125
+
126
+ ```
127
+ Round, Date, Team 1, FT, HT, Team 2
128
+ 1, (Fri) 9 Aug 2019, Liverpool FC, 4-1, 4-0, Norwich City FC
129
+ 1, (Sat) 10 Aug 2019, West Ham United FC, 0-5, 0-1, Manchester City FC
130
+ 1, (Sat) 10 Aug 2019, AFC Bournemouth, 1-1, 0-0, Sheffield United FC
131
+ 1, (Sat) 10 Aug 2019, Burnley FC, 3-0, 0-0, Southampton FC
132
+ 1, (Sat) 10 Aug 2019, Crystal Palace FC, 0-0, 0-0, Everton FC
133
+ 1, (Sat) 10 Aug 2019, Watford FC, 0-3, 0-1, Brighton & Hove Albion FC
134
+ 1, (Sat) 10 Aug 2019, Tottenham Hotspur FC, 3-1, 0-1, Aston Villa FC
135
+ 1, (Sun) 11 Aug 2019, Leicester City FC, 0-0, 0-0, Wolverhampton Wanderers FC
136
+ 1, (Sun) 11 Aug 2019, Newcastle United FC, 0-1, 0-0, Arsenal FC
137
+ 1, (Sun) 11 Aug 2019, Manchester United FC, 4-0, 1-0, Chelsea FC
138
+ ...
139
+ ```
140
+ (Source: [england/2019-20/eng.1.csv](https://github.com/footballcsv/england/blob/master/2010s/2019-20/eng.1.csv))
141
+
142
+ Yes, you can. See the [sportdb-importers library / gem »](https://github.com/sportdb/sport.db/tree/master/sportdb-importers)
143
+
133
144
 
134
145
 
135
146
  ## License
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ Hoe.spec 'sportdb-readers' do
20
20
  self.licenses = ['Public Domain']
21
21
 
22
22
  self.extra_deps = [
23
- ['sportdb-sync', '>= 1.0.0'],
23
+ ['sportdb-sync', '>= 1.0.3'],
24
24
  ]
25
25
 
26
26
  self.spec_extras = {
@@ -125,8 +125,6 @@ class MatchReader ## todo/check: rename to MatchReaderV2 (use plural?) why? w
125
125
 
126
126
 
127
127
  rounds.each do |round|
128
- ## quick hack: if pos missing fill with dummy 999 for now
129
- round.pos = 999 if round.pos.nil?
130
128
  round_rec = Sync::Round.find_or_create( round, event: event_rec ) ## check: use/rename to EventRound why? why not?
131
129
  end
132
130
 
@@ -6,7 +6,7 @@ module Readers
6
6
 
7
7
  MAJOR = 1 ## todo: namespace inside version or something - why? why not??
8
8
  MINOR = 0
9
- PATCH = 2
9
+ PATCH = 3
10
10
  VERSION = [MAJOR,MINOR,PATCH].join('.')
11
11
 
12
12
  def self.version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportdb-readers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-12 00:00:00.000000000 Z
11
+ date: 2020-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sportdb-sync
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.0
19
+ version: 1.0.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.0
26
+ version: 1.0.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rdoc
29
29
  requirement: !ruby/object:Gem::Requirement