sportdb-models 1.18.0 → 1.18.1

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: 8222b8d66c000dbd1e891ea4bc7aad1c43fdb25c
4
- data.tar.gz: 5a1cf9608b78f92bde855509e2690025f6604b27
3
+ metadata.gz: 77ac65c3b4cbd22f7a45a5c1a3fe0397f7ddf41a
4
+ data.tar.gz: b9f9c90af5b5b65cb4c5ab5bbb7cff38805f84c1
5
5
  SHA512:
6
- metadata.gz: 99a04b1b354c0655e28a6124f473106792e03d4d5eb7eb5af22a8c4d7b7c48cffdbf0c533fcf83458ae13e9ff524be6d2d18ba689027b46735bd793e8b57f578
7
- data.tar.gz: 38ca6f564cc5b228264e1933df462e8dc5aa82739d7b43be4e9bdfe18e2bbfacea2f506168e1788ded408a12c94686f83b5baccfe5ae7e2726b700b97c8eb864
6
+ metadata.gz: e3b4ef1698e08a54c84c2139a0c025578677a41487ab1a267dce27ac684b033fa0fcc407652631749d21af5f8233c1e70fbf81c33ce71249e7be405030401849
7
+ data.tar.gz: 83f8c56ad5052e664e8c62d5c48c253c75dfb3c1c68e96155a902a22323c42fd4b5ec05ac1b36a28a06746a69798cfaabf58afd0c68cd8d8ecfd46fb2bd97b9a
File without changes
@@ -1,24 +1,12 @@
1
- HISTORY.md
1
+ CHANGELOG.md
2
2
  Manifest.txt
3
3
  README.md
4
4
  Rakefile
5
- config/fixtures/de.yml
6
- config/fixtures/en.yml
7
- config/fixtures/es.yml
8
- config/fixtures/fr.yml
9
- config/fixtures/it.yml
10
- config/fixtures/pt.yml
11
- config/fixtures/ro.yml
12
- data/seasons.txt
13
- data/setups/all.txt
14
5
  lib/sportdb/calc.rb
15
- lib/sportdb/csv_reader.rb
16
6
  lib/sportdb/deleter.rb
17
- lib/sportdb/finders/date.rb
18
7
  lib/sportdb/finders/goals.rb
19
8
  lib/sportdb/finders/scores.rb
20
9
  lib/sportdb/indexers/team.rb
21
- lib/sportdb/lang.rb
22
10
  lib/sportdb/mapper_teams.rb
23
11
  lib/sportdb/matcher.rb
24
12
  lib/sportdb/models.rb
@@ -145,15 +133,12 @@ test/data/world-cup/teams_1974.txt
145
133
  test/helper.rb
146
134
  test/test_assoc_reader.rb
147
135
  test/test_changes.rb
148
- test/test_csv_reader.rb
149
136
  test/test_cursor.rb
150
- test/test_date.rb
151
137
  test/test_event_meta_reader.rb
152
138
  test/test_event_reader.rb
153
139
  test/test_event_table_reader.rb
154
140
  test/test_goals.rb
155
141
  test/test_indexer_team.rb
156
- test/test_lang.rb
157
142
  test/test_load.rb
158
143
  test/test_pp.rb
159
144
  test/test_reader.rb
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ Hoe.spec 'sportdb-models' do
9
9
  self.summary = "sportdb-models - sport.db schema 'n' models for easy (re)use"
10
10
  self.description = summary
11
11
 
12
- self.urls = ['https://github.com/sportdb/sport.db.models']
12
+ self.urls = ['https://github.com/sportdb/sport.db']
13
13
 
14
14
  self.author = 'Gerald Bauer'
15
15
  self.email = 'opensport@googlegroups.com'
@@ -17,18 +17,17 @@ Hoe.spec 'sportdb-models' do
17
17
  # switch extension to .markdown for gihub formatting
18
18
  # -- NB: auto-changed when included in manifest
19
19
  self.readme_file = 'README.md'
20
- self.history_file = 'HISTORY.md'
20
+ self.history_file = 'CHANGELOG.md'
21
21
 
22
22
  self.extra_deps = [
23
- ['worlddb-models', '>= 2.1.0'], # Note: pull in all (extra) dependencies va worlddb-models
24
- ['persondb-models', '>= 0.4.2'], # persons (people) table
23
+ ['worlddb-models', '>= 2.4.0'], # Note: pull in all (extra) dependencies va worlddb-models
24
+ ['persondb-models', '>= 0.5.0'], # persons (people) table
25
+ ['sportdb-formats', '>= 0.1.2'],
25
26
  ]
26
27
 
27
28
  self.licenses = ['Public Domain']
28
29
 
29
30
  self.spec_extras = {
30
- required_ruby_version: '>= 1.9.2'
31
+ required_ruby_version: '>= 2.2.2'
31
32
  }
32
-
33
33
  end
34
-
@@ -2,13 +2,14 @@
2
2
 
3
3
 
4
4
  # core and stlibs (note: get included via worlddb-models gem; see worlddb-models gem/lib)
5
- require 'csv' # used by CsvGameReader
6
-
7
-
8
5
  require 'worlddb/models' # NOTE: include worlddb-models gem (not cli tools gem, that is, worlddb)
9
6
  require 'persondb/models'
10
7
 
11
8
 
9
+ require 'sportdb/formats' ## todo/fix: move all readers out-of-models AND than (finally) remove sportdb/formats dependency
10
+
11
+
12
+
12
13
  # our own code
13
14
 
14
15
  require 'sportdb/version' # let version always go first
@@ -51,7 +52,6 @@ require 'sportdb/models/utils' # e.g. GameCursor
51
52
 
52
53
  require 'sportdb/schema' # NB: requires sportdb/models (include SportDB::Models)
53
54
 
54
- require 'sportdb/finders/date'
55
55
  require 'sportdb/finders/scores'
56
56
 
57
57
  require 'sportdb/utils'
@@ -71,7 +71,7 @@ require 'sportdb/mapper_teams'
71
71
  require 'sportdb/finders/goals' # no: requires FixturesHelpers
72
72
 
73
73
  require 'sportdb/readers/assoc'
74
- require 'sportdb/readers/event' ## old event reader (remove later??)
74
+ require 'sportdb/readers/event' ## old event reader (remove later??)
75
75
  require 'sportdb/readers/event_table' ## new "standard" event reader
76
76
  require 'sportdb/readers/event_meta' ## new "standard" event reader for meta data
77
77
  require 'sportdb/readers/game'
@@ -88,8 +88,6 @@ require 'sportdb/reader_zip'
88
88
  require 'sportdb/indexers/team'
89
89
 
90
90
 
91
- require 'sportdb/lang'
92
-
93
91
  require 'sportdb/deleter'
94
92
  require 'sportdb/stats'
95
93
 
@@ -97,35 +95,15 @@ require 'sportdb/pretty_printer'
97
95
 
98
96
  ## "simplified" match reader for rsssf-formated/style leagues
99
97
  require 'sportdb/rsssf_reader'
100
- require 'sportdb/csv_reader'
101
98
 
102
99
 
103
100
  module SportDb
104
101
 
105
- def self.config_path
106
- "#{root}/config"
107
- end
108
-
109
- def self.data_path
110
- "#{root}/data"
111
- end
112
-
113
102
  def self.test_data_path
114
103
  "#{root}/test/data"
115
104
  end
116
105
 
117
106
 
118
- def self.lang
119
- # todo/fix: find a better way for single instance ??
120
- # will get us ruby warning: instance variable @lang not initialized => find a better way!!!
121
- # just use @lang w/o .nil? e.g.
122
- # @lang =|| Lang.new why? why not?? or better use @@lang =|| Lang.new for class variable!!!
123
- if @lang.nil?
124
- @lang = Lang.new
125
- end
126
- @lang
127
- end
128
-
129
107
 
130
108
  def self.create
131
109
  CreateDb.new.up
@@ -159,7 +137,7 @@ module SportDb
159
137
  end
160
138
 
161
139
  def self.read_builtin
162
- read_setup( 'setups/all', data_path )
140
+ puts "!! WARN - deprecated SportDb.read_builtin call - remove!! no longer in use; will get removed soon"
163
141
  end
164
142
 
165
143
 
@@ -221,7 +199,7 @@ module SportDb
221
199
  end
222
200
 
223
201
  ## todo/check: use if defined?( JRUBY_VERSION ) instead ??
224
- if RUBY_PLATFORM =~ /java/ && config[:adapter] == 'sqlite3'
202
+ if RUBY_PLATFORM =~ /java/ && config[:adapter] == 'sqlite3'
225
203
  # quick hack for JRuby sqlite3 support via jdbc
226
204
  puts "jruby quick hack - adding jdbc libs for jruby sqlite3 database support"
227
205
  require 'jdbc/sqlite3'
@@ -234,7 +212,7 @@ module SportDb
234
212
  ActiveRecord::Base.establish_connection( config )
235
213
  # ActiveRecord::Base.logger = Logger.new( STDOUT )
236
214
 
237
- ## if sqlite3 add (use) some pragmas for speedups
215
+ ## if sqlite3 add (use) some pragmas for speedups
238
216
  if config[:adapter] == 'sqlite3'
239
217
  ## check/todo: if in memory e.g. ':memory:' no pragma needed!!
240
218
  con = ActiveRecord::Base.connection
@@ -4,7 +4,7 @@ module SportDb
4
4
 
5
5
  MAJOR = 1 ## todo: namespace inside version or something - why? why not??
6
6
  MINOR = 18
7
- PATCH = 0
7
+ PATCH = 1
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
10
10
  def self.version
@@ -3,8 +3,6 @@
3
3
  ###
4
4
  # to run use
5
5
  # ruby -I ./lib -I ./test test/test_assoc_reader.rb
6
- # or better
7
- # rake -I ./lib test
8
6
 
9
7
 
10
8
  require 'helper'
@@ -153,7 +151,7 @@ class TestAssocReaderXX < MiniTest::Test # note: TestAssocReader alreay defin
153
151
  assocreader.read()
154
152
 
155
153
  assert_equal 20, Assoc.count
156
-
154
+
157
155
  ## add countries
158
156
  countries = [['mx', 'Mexico', 'MEX'],
159
157
  ['us', 'United States', 'USA'],
@@ -1,5 +1,9 @@
1
1
  # encoding: utf-8
2
2
 
3
+ ###
4
+ # to run use
5
+ # ruby -I ./lib -I ./test test/test_changes.rb
6
+
3
7
  require 'helper'
4
8
 
5
9
  class TestChanges < MiniTest::Test
@@ -23,11 +27,11 @@ class TestChanges < MiniTest::Test
23
27
  score1p: nil,
24
28
  score2p: nil
25
29
  }
26
-
30
+
27
31
  assert_equal false, game1.check_for_changes( game_attribs )
28
32
  assert_equal true, game2.check_for_changes( game_attribs )
29
33
  end
30
-
34
+
31
35
  def test_play_at
32
36
  game1 = Game.new
33
37
  game1.score1 = 1
@@ -44,7 +48,7 @@ class TestChanges < MiniTest::Test
44
48
  score2: 2,
45
49
  play_at: DateTime.new( 2012, 11, 5 )
46
50
  }
47
-
51
+
48
52
  assert_equal false, game1.check_for_changes( game_attribs )
49
53
  assert_equal true, game2.check_for_changes( game_attribs )
50
54
  end
@@ -65,10 +69,10 @@ class TestChanges < MiniTest::Test
65
69
  score2: 2,
66
70
  group_id: 1
67
71
  }
68
-
72
+
69
73
  assert_equal false, game1.check_for_changes( game_attribs )
70
74
  assert_equal true, game2.check_for_changes( game_attribs )
71
75
  end
72
76
 
73
-
77
+
74
78
  end # class TestChanges
@@ -1,12 +1,17 @@
1
1
  # encoding: utf-8
2
2
 
3
+ ###
4
+ # to run use
5
+ # ruby -I ./lib -I ./test test/test_cursor.rb
6
+
7
+
3
8
  require 'helper'
4
9
 
5
10
  class TestCursor < MiniTest::Test
6
11
 
7
12
  def test_games
8
13
  games = []
9
-
14
+
10
15
  games << Game.new( score1: 3, score2: 1, play_at: DateTime.new(2013, 8, 9) )
11
16
  games << Game.new( score1: 1, score2: 3, play_at: DateTime.new(2013, 8, 10) )
12
17
  games << Game.new( score1: 2, score2: 0, play_at: DateTime.new(2013, 8, 10) )
@@ -3,8 +3,6 @@
3
3
  ###
4
4
  # to run use
5
5
  # ruby -I ./lib -I ./test test/test_event_meta_reader.rb
6
- # or better
7
- # rake -I ./lib test
8
6
 
9
7
 
10
8
  require 'helper'
@@ -47,4 +45,3 @@ class TestEventMetaReaderXX < MiniTest::Test # note: TestEventMetaReader alreay
47
45
  end
48
46
 
49
47
  end # class TestEventMetaReader
50
-
@@ -3,8 +3,6 @@
3
3
  ###
4
4
  # to run use
5
5
  # ruby -I ./lib -I ./test test/test_event_reader.rb
6
- # or better
7
- # rake -I ./lib test
8
6
 
9
7
 
10
8
  require 'helper'
@@ -31,7 +29,7 @@ class TestEventReaderXX < MiniTest::Test # note: TestEventReader alreay defined
31
29
  def test_bl
32
30
  r = TestEventReader.from_file( 'at-austria/2015_16/1-bundesliga' )
33
31
  r.read
34
-
32
+
35
33
  pp r.fixtures
36
34
 
37
35
  assert_equal ['1-bundesliga-i', '1-bundesliga-ii'], r.fixtures
@@ -59,10 +57,8 @@ class TestEventReaderXX < MiniTest::Test # note: TestEventReader alreay defined
59
57
 
60
58
  r = TestEventReader.from_file( 'at-austria/2015_16/cup' )
61
59
  r.read
62
-
60
+
63
61
  assert true ## if we get here; assume everything ok
64
62
  end
65
63
 
66
64
  end # class TestEventReader
67
-
68
-
@@ -3,8 +3,6 @@
3
3
  ###
4
4
  # to run use
5
5
  # ruby -I ./lib -I ./test test/test_event_table_reader.rb
6
- # or better
7
- # rake -I ./lib test
8
6
 
9
7
 
10
8
  require 'helper'
@@ -52,10 +50,8 @@ class TestEventTableReaderXX < MiniTest::Test # note: TestEventTableReader alre
52
50
 
53
51
  r = TestEventReader.from_file( 'at-austria/2015_16/cup' )
54
52
  r.read
55
-
53
+
56
54
  assert true ## if we get here; assume everything ok
57
55
  end
58
56
 
59
57
  end # class TestEventReader
60
-
61
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportdb-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.0
4
+ version: 1.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-13 00:00:00.000000000 Z
11
+ date: 2019-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: worlddb-models
@@ -16,28 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 2.1.0
19
+ version: 2.4.0
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: 2.1.0
26
+ version: 2.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: persondb-models
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.4.2
33
+ version: 0.5.0
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.4.2
40
+ version: 0.5.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: sportdb-formats
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 0.1.2
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 0.1.2
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rdoc
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -71,31 +85,19 @@ email: opensport@googlegroups.com
71
85
  executables: []
72
86
  extensions: []
73
87
  extra_rdoc_files:
74
- - HISTORY.md
88
+ - CHANGELOG.md
75
89
  - Manifest.txt
76
90
  - README.md
77
91
  files:
78
- - HISTORY.md
92
+ - CHANGELOG.md
79
93
  - Manifest.txt
80
94
  - README.md
81
95
  - Rakefile
82
- - config/fixtures/de.yml
83
- - config/fixtures/en.yml
84
- - config/fixtures/es.yml
85
- - config/fixtures/fr.yml
86
- - config/fixtures/it.yml
87
- - config/fixtures/pt.yml
88
- - config/fixtures/ro.yml
89
- - data/seasons.txt
90
- - data/setups/all.txt
91
96
  - lib/sportdb/calc.rb
92
- - lib/sportdb/csv_reader.rb
93
97
  - lib/sportdb/deleter.rb
94
- - lib/sportdb/finders/date.rb
95
98
  - lib/sportdb/finders/goals.rb
96
99
  - lib/sportdb/finders/scores.rb
97
100
  - lib/sportdb/indexers/team.rb
98
- - lib/sportdb/lang.rb
99
101
  - lib/sportdb/mapper_teams.rb
100
102
  - lib/sportdb/matcher.rb
101
103
  - lib/sportdb/models.rb
@@ -222,15 +224,12 @@ files:
222
224
  - test/helper.rb
223
225
  - test/test_assoc_reader.rb
224
226
  - test/test_changes.rb
225
- - test/test_csv_reader.rb
226
227
  - test/test_cursor.rb
227
- - test/test_date.rb
228
228
  - test/test_event_meta_reader.rb
229
229
  - test/test_event_reader.rb
230
230
  - test/test_event_table_reader.rb
231
231
  - test/test_goals.rb
232
232
  - test/test_indexer_team.rb
233
- - test/test_lang.rb
234
233
  - test/test_load.rb
235
234
  - test/test_pp.rb
236
235
  - test/test_reader.rb
@@ -246,7 +245,7 @@ files:
246
245
  - test/test_standings_ii.rb
247
246
  - test/test_utils.rb
248
247
  - test/test_winner.rb
249
- homepage: https://github.com/sportdb/sport.db.models
248
+ homepage: https://github.com/sportdb/sport.db
250
249
  licenses:
251
250
  - Public Domain
252
251
  metadata: {}
@@ -260,7 +259,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
260
259
  requirements:
261
260
  - - ">="
262
261
  - !ruby/object:Gem::Version
263
- version: 1.9.2
262
+ version: 2.2.2
264
263
  required_rubygems_version: !ruby/object:Gem::Requirement
265
264
  requirements:
266
265
  - - ">="