sportdb-market 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +10 -10
- data/db/at/2012_13/{bl_quotes.rb → bl.rb} +0 -0
- data/db/at/2012_13/{bl_quotes_betathome.txt → bl_betathome.txt} +0 -0
- data/db/at/2012_13/{bl_quotes_tipp3.txt → bl_tipp3.txt} +0 -0
- data/db/at/2012_13/{cup_quotes.rb → cup.rb} +0 -0
- data/db/at/2012_13/{cup_quotes_betathome.txt → cup_betathome.txt} +0 -0
- data/db/at/2012_13/{cup_quotes_tipp3.txt → cup_tipp3.txt} +0 -0
- data/db/cl/2012_13/{cl_quotes.rb → cl.rb} +0 -0
- data/db/cl/2012_13/{cl_quotes_betathome.txt → cl_betathome.txt} +0 -0
- data/db/cl/2012_13/{cl_quotes_tipp3.txt → cl_tipp3.txt} +0 -0
- data/db/world/{quali_quotes_tipp3.txt → quali_tipp3.txt} +0 -0
- data/lib/sportdb/market/market.rb +44 -1
- data/lib/sportdb/market/version.rb +1 -1
- metadata +20 -20
data/Manifest.txt
CHANGED
@@ -2,17 +2,17 @@ GEM.HISTORY.md
|
|
2
2
|
GEM.README.md
|
3
3
|
Manifest.txt
|
4
4
|
Rakefile
|
5
|
-
db/at/2012_13/
|
6
|
-
db/at/2012_13/
|
7
|
-
db/at/2012_13/
|
8
|
-
db/at/2012_13/
|
9
|
-
db/at/2012_13/
|
10
|
-
db/at/2012_13/
|
11
|
-
db/cl/2012_13/
|
12
|
-
db/cl/2012_13/
|
13
|
-
db/cl/2012_13/
|
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
14
|
db/services.rb
|
15
|
-
db/world/
|
15
|
+
db/world/quali_tipp3.txt
|
16
16
|
lib/sportdb/market/loader.rb
|
17
17
|
lib/sportdb/market/market.rb
|
18
18
|
lib/sportdb/market/models/event_quote.rb
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -25,8 +25,51 @@ module SportDB::Market
|
|
25
25
|
def self.root
|
26
26
|
"#{File.expand_path( File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) )}"
|
27
27
|
end
|
28
|
+
|
29
|
+
# load built-in (that is, bundled within the gem) named seeds
|
30
|
+
# - pass in an array of seed names e.g. [ 'cl/teams', 'cl/2012_13/cl' ] etc.
|
31
|
+
|
32
|
+
def self.load( ary )
|
33
|
+
loader = Loader.new
|
34
|
+
ary.each do |name|
|
35
|
+
loader.load_builtin( name )
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# load built-in (that is, bundled within the gem) named plain text seeds
|
40
|
+
# - pass in an array of pairs of event/seed names e.g. [['at.2012/13', 'at/2012_13/bl'], ['cl.2012/13', 'cl/2012_13/cl']] etc.
|
41
|
+
|
42
|
+
def self.read( ary )
|
43
|
+
reader = Reader.new
|
44
|
+
ary.each do |rec|
|
45
|
+
reader.load_builtin( rec[0], rec[1], rec[2] ) # service_key, event_key, name
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
class Deleter
|
50
|
+
## todo: move into its own file???
|
51
|
+
|
52
|
+
## make models available in sportdb module by default with namespace
|
53
|
+
# e.g. lets you use Team instead of Models::Team
|
54
|
+
include SportDB::Models
|
55
|
+
|
56
|
+
def run( args=[] )
|
57
|
+
# for now delete all tables
|
58
|
+
|
59
|
+
Service.delete_all
|
60
|
+
Quote.delete_all
|
61
|
+
GroupQuote.delete_all
|
62
|
+
EventQuote.delete_all
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
# delete ALL records (use with care!)
|
68
|
+
def self.delete!
|
69
|
+
Deleter.new.run
|
70
|
+
end # method delete!
|
28
71
|
|
29
72
|
puts "SportDB::Market.banner: >>#{SportDB::Market.banner}<<"
|
30
73
|
puts "SportDB::Market.root: >>#{SportDB::Market.root}<<"
|
31
74
|
|
32
|
-
end
|
75
|
+
end # module SportDB::Market
|
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:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Gerald Bauer
|
@@ -55,29 +55,29 @@ extensions: []
|
|
55
55
|
|
56
56
|
extra_rdoc_files:
|
57
57
|
- Manifest.txt
|
58
|
-
- db/at/2012_13/
|
59
|
-
- db/at/2012_13/
|
60
|
-
- db/at/2012_13/
|
61
|
-
- db/at/2012_13/
|
62
|
-
- db/cl/2012_13/
|
63
|
-
- db/cl/2012_13/
|
64
|
-
- db/world/
|
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/world/quali_tipp3.txt
|
65
65
|
files:
|
66
66
|
- GEM.HISTORY.md
|
67
67
|
- GEM.README.md
|
68
68
|
- Manifest.txt
|
69
69
|
- Rakefile
|
70
|
-
- db/at/2012_13/
|
71
|
-
- db/at/2012_13/
|
72
|
-
- db/at/2012_13/
|
73
|
-
- db/at/2012_13/
|
74
|
-
- db/at/2012_13/
|
75
|
-
- db/at/2012_13/
|
76
|
-
- db/cl/2012_13/
|
77
|
-
- db/cl/2012_13/
|
78
|
-
- db/cl/2012_13/
|
70
|
+
- db/at/2012_13/bl.rb
|
71
|
+
- db/at/2012_13/bl_betathome.txt
|
72
|
+
- db/at/2012_13/bl_tipp3.txt
|
73
|
+
- db/at/2012_13/cup.rb
|
74
|
+
- db/at/2012_13/cup_betathome.txt
|
75
|
+
- db/at/2012_13/cup_tipp3.txt
|
76
|
+
- db/cl/2012_13/cl.rb
|
77
|
+
- db/cl/2012_13/cl_betathome.txt
|
78
|
+
- db/cl/2012_13/cl_tipp3.txt
|
79
79
|
- db/services.rb
|
80
|
-
- db/world/
|
80
|
+
- db/world/quali_tipp3.txt
|
81
81
|
- lib/sportdb/market/loader.rb
|
82
82
|
- lib/sportdb/market/market.rb
|
83
83
|
- lib/sportdb/market/models/event_quote.rb
|