datafile 0.1.0 → 0.1.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: 650b215a771b6d6b984f2a65e187a08803c383ad
4
- data.tar.gz: 15512a5c171fea567372ed5983599330ad6312cb
3
+ metadata.gz: 8782dd8b936ebd15c057be430754b81935000a53
4
+ data.tar.gz: 6761a2f36be11909f9caf6ffbbe4645e2e30f440
5
5
  SHA512:
6
- metadata.gz: ee1d067e74de8bc1d6ba85cb1cc235b30954d7b0e88254d487ab40a4050143439aa0d994eb34e5801cbb61a1a8c2a28da974878d43a56615118d2bae1a31fd80
7
- data.tar.gz: 1c019e305e059a04d3cd7a25909d5616e9d13c5bdbb8a4c360eb042f04484476655e701411c2ecc24e255647c8567171607c58532bb4dd684d90a941cc38c1b1
6
+ metadata.gz: df27e034db8d08fc858bef78b83c6ae42b702879d1bb86edadd3fc514e43db4b0152b29a8fc48a4e8759fa2fb059189f61500f80edc1722cb1ef29ce3fb97c6e
7
+ data.tar.gz: 8b59c770f07f82a022c17b9b291ed09321db17a2b0a3f59ecd22683ba16b01adaa406e27d5051c5f7c2e91e0b72da267dc02cb986c3ef5ff12f3d589c2321fe6
@@ -5,6 +5,7 @@ Rakefile
5
5
  lib/datafile.rb
6
6
  lib/datafile/builder.rb
7
7
  lib/datafile/datafile.rb
8
+ lib/datafile/datasets/beer.rb
8
9
  lib/datafile/datasets/dataset.rb
9
10
  lib/datafile/datasets/football.rb
10
11
  lib/datafile/datasets/world.rb
@@ -9,6 +9,7 @@ require 'datafile/version' # let it always go first
9
9
 
10
10
  require 'datafile/datasets/dataset'
11
11
  require 'datafile/datasets/football'
12
+ require 'datafile/datasets/beer'
12
13
  require 'datafile/datasets/world'
13
14
  require 'datafile/datafile'
14
15
  require 'datafile/builder'
@@ -24,6 +24,11 @@ class Builder
24
24
  end
25
25
 
26
26
 
27
+ def beer( name, opts={} )
28
+ logger.info( "[builder] add beer-dataset '#{name}'" )
29
+ @datafile.datasets << BeerDataset.new( name, opts )
30
+ end
31
+
27
32
  def football( name, opts={} )
28
33
  logger.info( "[builder] add football-dataset '#{name}'" )
29
34
  @datafile.datasets << FootballDataset.new( name, opts )
@@ -8,6 +8,21 @@ class Datafile
8
8
 
9
9
  attr_reader :datasets
10
10
 
11
+
12
+ ## convenience method - use like Datafile.load_file()
13
+ def self.load_file( path='./Datafile' )
14
+ code = File.read_utf8( path )
15
+ self.load( code )
16
+ end
17
+
18
+ ## another convenience method - use like Datafile.load()
19
+ def self.load( code )
20
+ builder = Builder.new
21
+ builder.instance_eval( code )
22
+ builder.datafile # note: return datafile (of course, NOT the builder)
23
+ end
24
+
25
+
11
26
  def initialize()
12
27
  @datasets = []
13
28
  end
@@ -0,0 +1,18 @@
1
+ # encoding: utf-8
2
+
3
+ module Datafile
4
+
5
+ class BeerDataset < Dataset
6
+
7
+ def initialize( name, opts={} )
8
+ super( name, opts )
9
+ end
10
+
11
+ def read()
12
+ logger.info( "read beer-dataset '#{@name}', '#{setup}'" )
13
+
14
+ BeerDb.read_setup_from_zip( local_zip_name(), setup(), local_zip_root() )
15
+ end
16
+ end # class BeerDataset
17
+
18
+ end # module Datafile
@@ -16,7 +16,9 @@ class Dataset
16
16
  end
17
17
 
18
18
  def remote_zip_url() # remote zip url
19
- "https://github.com/#{@name}/archive/master.zip"
19
+ ### note: use http:// for now - lets us use (personal proxy NOT working w/ https) for now
20
+ ## "https://github.com/#{@name}/archive/master.zip"
21
+ "http://github.com/#{@name}/archive/master.zip"
20
22
  end
21
23
 
22
24
  def local_zip_name()
@@ -4,7 +4,7 @@ module Datafile
4
4
 
5
5
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
6
6
  MINOR = 1
7
- PATCH = 0
7
+ PATCH = 1
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
10
10
  def self.version
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.1.0
4
+ version: 0.1.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: 2014-11-27 00:00:00.000000000 Z
11
+ date: 2014-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logutils
@@ -97,6 +97,7 @@ files:
97
97
  - lib/datafile.rb
98
98
  - lib/datafile/builder.rb
99
99
  - lib/datafile/datafile.rb
100
+ - lib/datafile/datasets/beer.rb
100
101
  - lib/datafile/datasets/dataset.rb
101
102
  - lib/datafile/datasets/football.rb
102
103
  - lib/datafile/datasets/world.rb