datafile 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/datafile/datasets/dataset.rb +20 -2
- data/lib/datafile/version.rb +1 -1
- data/test/datafile/eurocup.rb +2 -2
- data/test/datafile/stadiums.rb +2 -1
- data/test/datafile/world.rb +1 -1
- data/test/test_builder.rb +1 -1
- data/test/test_football_dataset.rb +27 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42277d01f83ab3de43b42c67bd360d8e33a4ec96
|
4
|
+
data.tar.gz: 0dbac9ee1f7dd981b82c661846b99fa4870fffb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfdf41d1c6110b5581b50e46b215bee08a92f0fefb5fbcdc8c7730f2bfdb00cd0f2c4934083996aed2a60a823a0b545240487e08e4909f6eb3612513fffb06db
|
7
|
+
data.tar.gz: 8ab664e96b5fa743818a45c80411618dd5dd245cbaad81270a1b27471320b47cd4f0eb3181d33a0f98def76fb2c6ee8a264827b97acbbd4c0af148f44089738d
|
@@ -38,7 +38,16 @@ end # class Dataset
|
|
38
38
|
|
39
39
|
|
40
40
|
class WorldDataset < Dataset
|
41
|
-
def initialize(
|
41
|
+
def initialize( name_easy, opts={} )
|
42
|
+
|
43
|
+
## check if name include slash (e.g. /)
|
44
|
+
## - if not auto-add openmundi/ (default)
|
45
|
+
if name_easy.index( '/' ).nil?
|
46
|
+
name = "openmundi/#{name_easy}"
|
47
|
+
else
|
48
|
+
name = name_easy ## just pass through for now
|
49
|
+
end
|
50
|
+
|
42
51
|
super( name, opts ) ## todo/check: just juse super (e.g. pass along all params - why? why not?)
|
43
52
|
end
|
44
53
|
|
@@ -87,7 +96,16 @@ end # class FootballDataset
|
|
87
96
|
|
88
97
|
|
89
98
|
class BeerDataset < Dataset
|
90
|
-
def initialize(
|
99
|
+
def initialize( name_easy, opts={} )
|
100
|
+
|
101
|
+
## check if name include slash (e.g. /)
|
102
|
+
## - if not auto-add openbeer/ (default)
|
103
|
+
if name_easy.index( '/' ).nil?
|
104
|
+
name = "openbeer/#{name_easy}"
|
105
|
+
else
|
106
|
+
name = name_easy ## just pass through for now
|
107
|
+
end
|
108
|
+
|
91
109
|
super( name, opts )
|
92
110
|
end
|
93
111
|
|
data/lib/datafile/version.rb
CHANGED
data/test/datafile/eurocup.rb
CHANGED
data/test/datafile/stadiums.rb
CHANGED
data/test/datafile/world.rb
CHANGED
data/test/test_builder.rb
CHANGED
@@ -24,4 +24,31 @@ class TestFootballDataset < MiniTest::Test
|
|
24
24
|
assert_equal 'openfootball/xxx', xxx2.name
|
25
25
|
end
|
26
26
|
|
27
|
+
## move to test datasets - why, why not ??
|
28
|
+
def test_world
|
29
|
+
at = Datafile::WorldDataset.new( 'austria.db' )
|
30
|
+
at2 = Datafile::WorldDataset.new( 'openmundi/austria.db' )
|
31
|
+
xxx = Datafile::WorldDataset.new( 'xxx' )
|
32
|
+
xxx2 = Datafile::WorldDataset.new( 'openmundi/xxx' )
|
33
|
+
|
34
|
+
assert_equal 'openmundi/austria.db', at.name
|
35
|
+
assert_equal 'openmundi/austria.db', at2.name
|
36
|
+
|
37
|
+
assert_equal 'openmundi/xxx', xxx.name
|
38
|
+
assert_equal 'openmundi/xxx', xxx2.name
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_beer
|
42
|
+
at = Datafile::BeerDataset.new( 'at-austria' )
|
43
|
+
at2 = Datafile::BeerDataset.new( 'openbeer/at-austria' )
|
44
|
+
xxx = Datafile::BeerDataset.new( 'xxx' )
|
45
|
+
xxx2 = Datafile::BeerDataset.new( 'openbeer/xxx' )
|
46
|
+
|
47
|
+
assert_equal 'openbeer/at-austria', at.name
|
48
|
+
assert_equal 'openbeer/at-austria', at2.name
|
49
|
+
|
50
|
+
assert_equal 'openbeer/xxx', xxx.name
|
51
|
+
assert_equal 'openbeer/xxx', xxx2.name
|
52
|
+
end
|
53
|
+
|
27
54
|
end # class TestFootballDataset
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datafile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logutils
|