sportdb-market 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
File without changes
data/Manifest.txt CHANGED
@@ -1,21 +1,21 @@
1
- GEM.HISTORY.md
2
- GEM.README.md
1
+ History.md
3
2
  Manifest.txt
3
+ README.md
4
4
  Rakefile
5
- db/at/2012_13/bl.rb
6
- db/at/2012_13/bl_betathome.txt
7
- db/at/2012_13/bl_tipp3.txt
8
- db/at/2012_13/cup.rb
9
- db/at/2012_13/cup_betathome.txt
10
- db/at/2012_13/cup_tipp3.txt
11
- db/cl/2012_13/cl.rb
12
- db/cl/2012_13/cl_betathome.txt
13
- db/cl/2012_13/cl_tipp3.txt
14
- db/euro/2012.rb
15
- db/euro/2012_tipico.txt
16
- db/euro/2012_tipp3.txt
17
- db/services.rb
18
- db/world/quali_tipp3.txt
5
+ data/at/2012_13/bl.rb
6
+ data/at/2012_13/bl_betathome.txt
7
+ data/at/2012_13/bl_tipp3.txt
8
+ data/at/2012_13/cup.rb
9
+ data/at/2012_13/cup_betathome.txt
10
+ data/at/2012_13/cup_tipp3.txt
11
+ data/cl/2012_13/cl.rb
12
+ data/cl/2012_13/cl_betathome.txt
13
+ data/cl/2012_13/cl_tipp3.txt
14
+ data/euro/2012.rb
15
+ data/euro/2012_tipico.txt
16
+ data/euro/2012_tipp3.txt
17
+ data/services.rb
18
+ data/world/quali_tipp3.txt
19
19
  lib/sportdb/market.rb
20
20
  lib/sportdb/market/loader.rb
21
21
  lib/sportdb/market/models/event_quote.rb
File without changes
data/Rakefile CHANGED
@@ -1,6 +1,15 @@
1
+ require 'pp'
1
2
  require 'hoe'
2
3
  require './lib/sportdb/market/version.rb'
3
4
 
5
+ ## NB: plugin (hoe-manifest) not required; just used for future testing/development
6
+ Hoe::plugin :manifest # more options for manifests (in the future; not yet)
7
+
8
+ ###########
9
+ #### NB: if you try this script at home
10
+ # you need to create a (symbolic) link to the sport.db-market fixtures
11
+ # e.g. use ln -s ../sport.db-market data or similar
12
+
4
13
  Hoe.spec 'sportdb-market' do
5
14
 
6
15
  self.version = SportDB::Market::VERSION
@@ -8,16 +17,81 @@ Hoe.spec 'sportdb-market' do
8
17
  self.summary = 'sportdb plugin for market quotes (odds, etc)'
9
18
  self.description = summary
10
19
 
11
- self.urls = ['http://geraldb.github.com/sport.db']
20
+ self.urls = ['https://github.com/geraldb/sport.db.ruby-market']
12
21
 
13
22
  self.author = 'Gerald Bauer'
14
23
  self.email = 'opensport@googlegroups.com'
15
24
 
16
- # switch extension to .markdown for gihub formatting
17
- self.readme_file = 'GEM.README.md'
18
- self.history_file = 'GEM.HISTORY.md'
19
25
 
20
26
  ## soft deps (dependencies)
21
27
  ## -- sportdb gem must be installed already
22
28
 
23
- end
29
+ self.licenses = ['Public Domain']
30
+
31
+ self.spec_extras = {
32
+ :required_ruby_version => '>= 1.9.2'
33
+ }
34
+
35
+ end
36
+
37
+
38
+ namespace :dev do
39
+
40
+
41
+ ### NB: use rake -I ./lib dev:test # fresh import (starts w/ clean wipe out)
42
+ ### NB: use rake -I ./lib dev:update # just update quotes
43
+
44
+ BUILD_DIR = "./build"
45
+
46
+ SPORT_DB_PATH = "#{BUILD_DIR}/sport.db"
47
+
48
+ DB_CONFIG = {
49
+ :adapter => 'sqlite3',
50
+ :database => SPORT_DB_PATH
51
+ }
52
+
53
+ directory BUILD_DIR
54
+
55
+ task :clean do
56
+ rm SPORT_DB_PATH if File.exists?( SPORT_DB_PATH )
57
+ end
58
+
59
+ task :env => BUILD_DIR do
60
+ require 'sportdb'
61
+ require './lib/sportdb/market.rb'
62
+
63
+ pp DB_CONFIG
64
+ ActiveRecord::Base.establish_connection( DB_CONFIG )
65
+ end
66
+
67
+ task :create => :env do
68
+ WorldDB.create
69
+ SportDB.create
70
+ SportDB::Market.create
71
+ end
72
+
73
+ task :import => :env do
74
+ WorldDB.read_all # populate world tables
75
+
76
+ SportDB.load_all
77
+ SportDB.read_all
78
+
79
+ SportDB.stats
80
+ end
81
+
82
+
83
+ desc 'sportdb-market - test loading of builtin fixtures'
84
+ task :test => [:clean, :create, :import] do
85
+ SportDB::Market.load_all
86
+ SportDB::Market.read_all
87
+ end
88
+
89
+ desc 'sportdb-market - test loading of builtin fixtures (just update)'
90
+ task :update => :env do
91
+ SportDB::Market.delete!
92
+ SportDB::Market.load_all
93
+ SportDB::Market.read_all
94
+ end
95
+
96
+
97
+ end # namespace :dev
File without changes
@@ -14,8 +14,6 @@ admira innsbruck 1.45 4.3 5.9
14
14
 
15
15
 
16
16
 
17
-
18
-
19
17
  13. Runde // 27+28 Okt
20
18
 
21
19
  SV Josko Fenster Ried - SC Wiener Neustadt 1,55 3,55 6,00
@@ -26,11 +24,21 @@ SK Rapid Wien - Red Bull Salzburg 2,75 3,20 2,40
26
24
 
27
25
 
28
26
 
29
-
30
27
  16. Runde // 17+18 Nov
31
28
 
32
29
  FK Austria Wien - SC Wiener Neustadt 1,20 6,00 11,00
33
30
  SK Sturm Graz - SV Josko Fenster Ried 1,75 3,50 4,25
34
31
  SV Mattersburg - SK Rapid Wien 3,75 3,35 1,90
35
32
  Wolfsberger AC - FC Admira Wacker Mödling 2,25 3,20 3,00
36
- Red Bull Salzburg - FC Wacker Innsbruck 1,20 6,00 11,00
33
+ Red Bull Salzburg - FC Wacker Innsbruck 1,20 6,00 11,00
34
+
35
+
36
+
37
+ 19. Runde // 8+9 Dez
38
+
39
+ FC Admira Wacker Mödling - SV Josko Fenster Ried 2,25 3,15 3,05
40
+ SK Sturm Graz - Red Bull Salzburg 2,90 3,00 2,40
41
+ SV Mattersburg - SC Wiener Neustadt 1,90 3,30 3,80
42
+ Wolfsberger AC - FK Austria Wien 5,00 3,50 1,65
43
+ SK Rapid Wien - FC Wacker Innsbruck 1,35 4,50 7,75
44
+
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -88,3 +88,24 @@ FC Schalke 04 - Olympiakos Piraeus 1,45 4,25 6,75
88
88
  RSC Anderlecht - AC Milan 2,75 3,40 2,40
89
89
  Ajax Amsterdam - Borussia Dortmund 3,65 3,50 1,95
90
90
  Manchester City - Real Madrid 3,00 3,50 2,20
91
+
92
+
93
+ 6. Spieltag // 4+5 Dec
94
+
95
+ NK Dinamo Zagreb - Dynamo Kiev 3,70 3,45 1,95
96
+ Paris Saint Germain - FC Porto 2,10 3,30 3,40
97
+ HSC Montpellier - FC Schalke 04 3,70 3,45 1,95
98
+ Olympiakos Piraeus - Arsenal FC 2,20 3,40 3,10
99
+ AC Milan - FC Zenit St. Petersburg 2,50 3,25 2,75
100
+ CF Malaga - RSC Anderlecht 2,00 3,45 3,50
101
+ Borussia Dortmund - Manchester City 2,00 3,60 3,40
102
+ Real Madrid - Ajax Amsterdam 1,30 5,40 8,50
103
+
104
+ Chelsea FC - FC Nordsjaelland 1,08 9,50 25,00
105
+ Shakhtar Donetsk - Juventus Turin 3,25 1,85 4,30
106
+ FC Bayern München - Bate Borisov 1,10 8,50 22,00
107
+ OSC Lille - CF Valencia 3,00 3,30 2,30
108
+ Celtic Glasgow - Spartak Moscow 1,50 4,20 6,00
109
+ FC Barcelona - Benfica Lissabon 1,50 4,30 5,75
110
+ Manchester United - CFR Cluj 1,55 4,05 5,50
111
+ Sporting Braga - Galatasaray 3,20 3,25 2,20
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -2,9 +2,6 @@
2
2
  ## NB: do NOT require sportdb (avoid circular loading)
3
3
  #### require 'sportdb'
4
4
 
5
-
6
- ## todo: how to include 'sportdb/market/version' - does it work? ?
7
-
8
5
  require 'sportdb/market/version'
9
6
 
10
7
  require 'sportdb/market/schema'
@@ -28,6 +25,10 @@ module SportDB::Market
28
25
  "#{File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )}"
29
26
  end
30
27
 
28
+ ## builtin path to fixture data
29
+ def self.data_path
30
+ "#{root}/data"
31
+ end
31
32
 
32
33
  def self.create
33
34
  CreateDB.up
@@ -38,7 +39,8 @@ module SportDB::Market
38
39
  'at/2012_13/bl',
39
40
  'at/2012_13/cup',
40
41
  'cl/2012_13/cl',
41
- 'euro/2012']
42
+ ## 'euro/2012'
43
+ ]
42
44
  end
43
45
 
44
46
  def self.load_all
@@ -52,8 +54,8 @@ module SportDB::Market
52
54
  ['tipp3', 'at.cup.2012/13', 'at/2012_13/cup_tipp3'],
53
55
  ['betathome', 'cl.2012/13', 'cl/2012_13/cl_betathome'],
54
56
  ['tipp3', 'cl.2012/13', 'cl/2012_13/cl_tipp3'],
55
- ['tipico', 'euro.2012', 'euro/2012_tipico'],
56
- ['tipp3', 'euro.2012', 'euro/2012_tipp3' ],
57
+ ## ['tipico', 'euro.2012', 'euro/2012_tipico'],
58
+ ## ['tipp3', 'euro.2012', 'euro/2012_tipp3' ],
57
59
  ['tipp3', 'world.quali.euro.2012/13', 'world/quali_tipp3']]
58
60
  end
59
61
 
@@ -19,7 +19,7 @@ class Loader
19
19
  attr_reader :logger
20
20
 
21
21
  def load_builtin( name ) # load from gem (built-in)
22
- path = "#{SportDB::Market.root}/db/#{name}.rb"
22
+ path = "#{SportDB::Market.data_path}/#{name}.rb"
23
23
 
24
24
  puts "*** loading data '#{name}' (#{path})..."
25
25
 
@@ -30,7 +30,7 @@ class Reader
30
30
  end
31
31
 
32
32
  def load_builtin( service_key, event_key, name ) # load from gem (built-in)
33
- path = "#{SportDB::Market.root}/db/#{name}.txt"
33
+ path = "#{SportDB::Market.data_path}/#{name}.txt"
34
34
 
35
35
  puts "*** parsing data '#{name}' (#{path})..."
36
36
 
@@ -2,5 +2,5 @@
2
2
  module SportDB ; end # forward reference (for hoe require)
3
3
 
4
4
  module SportDB::Market
5
- VERSION = '0.2.0'
5
+ VERSION = '0.3.0'
6
6
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportdb-market
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 0.2.0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gerald Bauer
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-11-21 00:00:00 Z
18
+ date: 2012-12-04 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rdoc
@@ -40,11 +40,11 @@ dependencies:
40
40
  requirements:
41
41
  - - ~>
42
42
  - !ruby/object:Gem::Version
43
- hash: 7
43
+ hash: 1
44
44
  segments:
45
45
  - 3
46
- - 0
47
- version: "3.0"
46
+ - 3
47
+ version: "3.3"
48
48
  type: :development
49
49
  version_requirements: *id002
50
50
  description: sportdb plugin for market quotes (odds, etc)
@@ -55,34 +55,25 @@ extensions: []
55
55
 
56
56
  extra_rdoc_files:
57
57
  - Manifest.txt
58
- - db/at/2012_13/bl_betathome.txt
59
- - db/at/2012_13/bl_tipp3.txt
60
- - db/at/2012_13/cup_betathome.txt
61
- - db/at/2012_13/cup_tipp3.txt
62
- - db/cl/2012_13/cl_betathome.txt
63
- - db/cl/2012_13/cl_tipp3.txt
64
- - db/euro/2012_tipico.txt
65
- - db/euro/2012_tipp3.txt
66
- - db/world/quali_tipp3.txt
67
58
  files:
68
- - GEM.HISTORY.md
69
- - GEM.README.md
59
+ - History.md
70
60
  - Manifest.txt
61
+ - README.md
71
62
  - Rakefile
72
- - db/at/2012_13/bl.rb
73
- - db/at/2012_13/bl_betathome.txt
74
- - db/at/2012_13/bl_tipp3.txt
75
- - db/at/2012_13/cup.rb
76
- - db/at/2012_13/cup_betathome.txt
77
- - db/at/2012_13/cup_tipp3.txt
78
- - db/cl/2012_13/cl.rb
79
- - db/cl/2012_13/cl_betathome.txt
80
- - db/cl/2012_13/cl_tipp3.txt
81
- - db/euro/2012.rb
82
- - db/euro/2012_tipico.txt
83
- - db/euro/2012_tipp3.txt
84
- - db/services.rb
85
- - db/world/quali_tipp3.txt
63
+ - data/at/2012_13/bl.rb
64
+ - data/at/2012_13/bl_betathome.txt
65
+ - data/at/2012_13/bl_tipp3.txt
66
+ - data/at/2012_13/cup.rb
67
+ - data/at/2012_13/cup_betathome.txt
68
+ - data/at/2012_13/cup_tipp3.txt
69
+ - data/cl/2012_13/cl.rb
70
+ - data/cl/2012_13/cl_betathome.txt
71
+ - data/cl/2012_13/cl_tipp3.txt
72
+ - data/euro/2012.rb
73
+ - data/euro/2012_tipico.txt
74
+ - data/euro/2012_tipp3.txt
75
+ - data/services.rb
76
+ - data/world/quali_tipp3.txt
86
77
  - lib/sportdb/market.rb
87
78
  - lib/sportdb/market/loader.rb
88
79
  - lib/sportdb/market/models/event_quote.rb
@@ -94,13 +85,13 @@ files:
94
85
  - lib/sportdb/market/schema.rb
95
86
  - lib/sportdb/market/version.rb
96
87
  - lib/sportdb_plugin.rb
97
- homepage: http://geraldb.github.com/sport.db
98
- licenses: []
99
-
88
+ homepage: https://github.com/geraldb/sport.db.ruby-market
89
+ licenses:
90
+ - Public Domain
100
91
  post_install_message:
101
92
  rdoc_options:
102
93
  - --main
103
- - GEM.README.md
94
+ - README.md
104
95
  require_paths:
105
96
  - lib
106
97
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -108,10 +99,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
99
  requirements:
109
100
  - - ">="
110
101
  - !ruby/object:Gem::Version
111
- hash: 3
102
+ hash: 55
112
103
  segments:
113
- - 0
114
- version: "0"
104
+ - 1
105
+ - 9
106
+ - 2
107
+ version: 1.9.2
115
108
  required_rubygems_version: !ruby/object:Gem::Requirement
116
109
  none: false
117
110
  requirements: