datafile 0.2.1 → 0.2.2

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: 8afa4e20859ba348f32a1d45f7d385623146099d
4
- data.tar.gz: 276cbc2838cd98a227af23ae3bced081b584ed05
3
+ metadata.gz: 42277d01f83ab3de43b42c67bd360d8e33a4ec96
4
+ data.tar.gz: 0dbac9ee1f7dd981b82c661846b99fa4870fffb0
5
5
  SHA512:
6
- metadata.gz: 6c59a27aa7fc14e30cc48cc0a16252eac83d08ccbea25e2008aa4f8bcf9c06fcff3a918ca3f831334532e55cda699466acb8e3d513ef5d41b2a973d9d001f2cb
7
- data.tar.gz: a7ab8bf94cc1e1feb28ecdb3d2bb9e6a9de90c948a092501650726f18b08e8eaa1874e920fc966a6ea298c9b2bb4470110400f4b22e7f521f2d713497041e42b
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( name, opts={} )
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( name, opts={} )
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
 
@@ -4,7 +4,7 @@ module Datafile
4
4
 
5
5
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
6
6
  MINOR = 2
7
- PATCH = 1
7
+ PATCH = 2
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
10
10
  def self.version
@@ -1,6 +1,6 @@
1
1
  #####################
2
2
  # national teams
3
3
 
4
- football 'openfootball/national-teams'
5
- football 'openfootball/euro-cup'
4
+ football 'national-teams'
5
+ football 'euro-cup'
6
6
 
@@ -1,2 +1,3 @@
1
1
 
2
- football 'openfootball/stadiums' ## NOTE: default is setup: 'all'
2
+ football 'stadiums' ## NOTE: default is setup: 'all'
3
+
@@ -1,3 +1,3 @@
1
1
 
2
- world 'openmundi/world.db', setup: 'countries'
2
+ world 'world.db', setup: 'countries'
3
3
 
data/test/test_builder.rb CHANGED
@@ -13,7 +13,7 @@ class TestBuilder < MiniTest::Test
13
13
  code =<<EOS
14
14
  ## comments
15
15
 
16
- world 'openmundi/world.db', setup: 'countries'
16
+ world 'world.db', setup: 'countries'
17
17
 
18
18
  football 'national-teams' ## NOTE: default is setup: 'all'
19
19
 
@@ -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.1
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-13 00:00:00.000000000 Z
11
+ date: 2015-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logutils