sportdb 2.0.0 → 2.1.0

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: 2822d777bf115f37ad952b7af8df4e6ef32f9606
4
- data.tar.gz: cc7c85d6f3abeb13274c889b6700d5c66bce1107
3
+ metadata.gz: 462f64e48cea18e67436574ea602fb33b00c233f
4
+ data.tar.gz: 547a07bb677135cbc245e317ddc2c30d619e5346
5
5
  SHA512:
6
- metadata.gz: 363740f98a77fc813dc763db17c28f955404285438f6ca33158c2d5da1a07b89df1f30be837577fdcb2735329aea7b1b4377da11c5248a5134836ff04c3a7fd3
7
- data.tar.gz: 57b53de7d5550722eb3da670cff255fd2a940e97a268787cc5ef294056bd5b61a52647b9834211595cb6ddf71315d27af87ccdbc270c5674e6713214f421b8ab
6
+ metadata.gz: 2640177ec4c7f3c9ff4743f365755adddaf915cb4b05772b2885e5c878c3a2fc70e375ba328226581c664efa0ee26cfcd4c4df05ada239a2608166337da8c440
7
+ data.tar.gz: 4874fa7df01d41799af5ac192ba362f3136712e5ff594b2c0601fbf68d5bb4348f49e79c7842972d7d3f90d667b071f9eb554f32b433d148e5ef8b57b3582a20
data/README.md CHANGED
@@ -14,7 +14,8 @@
14
14
 
15
15
  ## Usage
16
16
 
17
- The sportdb gem lets you read datasets in plain text into your sports database
17
+ The sportdb tool lets you read in (parse) datasets (e.g. leagues, clubs, match schedules, etc.)
18
+ in plain text into your sports SQL database of choice (e.g. SQLite, PostgreSQL, etc.)
18
19
 
19
20
  ```
20
21
  SYNOPSIS
@@ -95,6 +96,18 @@ Just install the gem:
95
96
  $ gem install sportdb
96
97
 
97
98
 
99
+
100
+ ## More Documentation / Getting Started Guides
101
+
102
+ See the **[football.db League Starter Sample - Mauritius Premier League](https://github.com/openfootball/league-starter)**
103
+ if you want to start from scratch (zero) with your very own league.
104
+
105
+ See the **[football.db Quick Starter Datafile Templates](https://github.com/openfootball/quick-starter)** if you want to read in ready-to-use /
106
+ ready-to-fork dataset packages incl. the English Premier League, the German
107
+ Bundesliga, the Spanish Primera División and some more.
108
+
109
+
110
+
98
111
  ## License
99
112
 
100
113
  ![](https://publicdomainworks.github.io/buttons/zero88x31.png)
data/Rakefile CHANGED
@@ -20,11 +20,13 @@ Hoe.spec 'sportdb' do
20
20
  self.history_file = 'CHANGELOG.md'
21
21
 
22
22
  self.extra_deps = [
23
- ['sportdb-models', '>= 1.18.2'],
24
- ['sportdb-readers', '>= 0.3.3'],
23
+ ['sportdb-models', '>= 1.18.2'],
24
+ ['sportdb-readers', '>= 0.3.6'],
25
+ ['footballdb-leagues', '>= 2019.11.22' ], ## add minimum for datasets
26
+ ['footballdb-clubs', '>= 2019.11.22' ],
25
27
 
26
- ['fetcher', '>= 0.4.5'], ## check if included already in datafil ??
27
- ['datafile', '>= 0.3.0'],
28
+ ['fetcher', '>= 0.4.5'], ## check if included already in datafil ??
29
+ ['datafile', '>= 0.3.1'],
28
30
 
29
31
  ### sportdb addons
30
32
  ## ['sportdb-keys'],
@@ -44,13 +46,13 @@ Hoe.spec 'sportdb' do
44
46
  required_ruby_version: '>= 2.2.2'
45
47
  }
46
48
 
47
- self.post_install_message =<<EOS
49
+ self.post_install_message =<<TXT
48
50
  ******************************************************************************
49
51
 
50
52
  Questions? Comments? Send them along to the mailing list.
51
53
  https://groups.google.com/group/opensport
52
54
 
53
55
  ******************************************************************************
54
- EOS
56
+ TXT
55
57
 
56
58
  end
@@ -47,26 +47,9 @@ program_desc 'sport.db command line tool'
47
47
  version SportDbCli::VERSION
48
48
 
49
49
 
50
- =begin
51
- ### add to help use new sections
52
-
53
- Examples:
54
- sportdb cl/teams cl/2012_13/cl # import champions league (cl)
55
- sportdb --create # create database schema
56
-
57
- More Examples:
58
- sportdb # show stats (table counts, table props)
59
- sportdb -i ../sport.db/db cl/teams cl/2012_13/cl # import champions league (cl) in db folder
60
-
61
- Further information:
62
- http://geraldb.github.com/sport.db
63
- =end
64
-
65
-
66
50
  ### global option (required)
67
51
  ## todo: add check that path is valid?? possible?
68
52
 
69
-
70
53
  desc 'Database path'
71
54
  arg_name 'PATH'
72
55
  default_value opts.db_path
@@ -103,14 +86,25 @@ command [:build,:b] do |c|
103
86
 
104
87
  c.action do |g,o,args|
105
88
 
106
- datafile = Datafile::Datafile.load_file( './Datafile' )
107
- datafile.download # datafile step 1 - download all datasets/zips
89
+ ## check if datafile exists, if NOT assume working dir (./) is a package
90
+ if File.file?( './Datafile' ) ## note use file? (exist? will also check for directory/folder!!)
91
+ datafile = Datafile::Datafile.load_file( './Datafile' )
92
+ datafile.download # datafile step 1 - download all datasets/zips
108
93
 
109
- connect_to_db( opts )
94
+ connect_to_db( opts )
110
95
 
111
- SportDb.create_all
96
+ SportDb.create_all
112
97
 
113
- datafile.read # datafile step 2 - read all datasets
98
+ datafile.read # datafile step 2 - read all datasets
99
+ else
100
+ puts "no ./Datafile found; try local build in >#{Dir.pwd}<"
101
+
102
+ connect_to_db( opts )
103
+
104
+ SportDb.create_all
105
+ pack = SportDb::DirPackage.new( Dir.pwd ) ## note: pass in full path for now (and NOT ./) - why? why not?
106
+ pack.read # read all datasets
107
+ end
114
108
 
115
109
  puts 'Done.'
116
110
  end # action
@@ -122,15 +116,26 @@ command [:read,:r] do |c|
122
116
 
123
117
  c.action do |g,o,args|
124
118
 
125
- connect_to_db( opts )
119
+ ## check if datafile exists, if NOT assume working dir (./) is a package
120
+ if File.file?( './Datafile' ) ## note use file? (exist? will also check for directory/folder!!)
121
+ connect_to_db( opts )
126
122
 
127
- datafile = Datafile::Datafile.load_file( './Datafile' )
128
- datafile.read
123
+ datafile = Datafile::Datafile.load_file( './Datafile' )
124
+ datafile.read
125
+ else
126
+ puts "no ./Datafile found; try local read in >#{Dir.pwd}<"
127
+
128
+ connect_to_db( opts )
129
+
130
+ pack = SportDb::DirPackage.new( Dir.pwd ) ## note: pass in full path for now (and NOT ./) - why? why not?
131
+ pack.read # read all datasets
132
+ end
129
133
 
130
134
  puts 'Done.'
131
135
  end # action
132
136
  end # command setup
133
137
 
138
+
134
139
  desc "Download datasets; use ./Datafile - zips get downloaded to ./tmp"
135
140
  command [:download,:dl] do |c|
136
141
 
@@ -2,11 +2,11 @@
2
2
 
3
3
  # Note: SportDb::VERSION gets used by core, that is, sportdb-models
4
4
 
5
-
5
+ ## todo/fix: yes, rename to SportDbTool
6
6
  module SportDbCli # todo/check - rename to SportDbTool or SportDbCommands or SportDbShell ??
7
7
 
8
8
  MAJOR = 2 ## todo: namespace inside version or something - why? why not??
9
- MINOR = 0
9
+ MINOR = 1
10
10
  PATCH = 0
11
11
  VERSION = [MAJOR,MINOR,PATCH].join('.')
12
12
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-21 00:00:00.000000000 Z
11
+ date: 2019-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sportdb-models
@@ -30,14 +30,42 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.3.3
33
+ version: 0.3.6
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.3.3
40
+ version: 0.3.6
41
+ - !ruby/object:Gem::Dependency
42
+ name: footballdb-leagues
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 2019.11.22
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 2019.11.22
55
+ - !ruby/object:Gem::Dependency
56
+ name: footballdb-clubs
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 2019.11.22
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 2019.11.22
41
69
  - !ruby/object:Gem::Dependency
42
70
  name: fetcher
43
71
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +86,14 @@ dependencies:
58
86
  requirements:
59
87
  - - ">="
60
88
  - !ruby/object:Gem::Version
61
- version: 0.3.0
89
+ version: 0.3.1
62
90
  type: :runtime
63
91
  prerelease: false
64
92
  version_requirements: !ruby/object:Gem::Requirement
65
93
  requirements:
66
94
  - - ">="
67
95
  - !ruby/object:Gem::Version
68
- version: 0.3.0
96
+ version: 0.3.1
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: sportdb-service
71
99
  requirement: !ruby/object:Gem::Requirement