Class: Datafile::Dataset
- Inherits:
-
Object
show all
- Includes:
- LogUtils::Logging
- Defined in:
- lib/datafile/datasets/dataset.rb
Instance Method Summary
collapse
Constructor Details
#initialize(name, opts = {}) ⇒ Dataset
Returns a new instance of Dataset.
8
9
10
11
|
# File 'lib/datafile/datasets/dataset.rb', line 8
def initialize( name, opts={} )
@name = name
@opts = opts
end
|
Instance Method Details
#download ⇒ Object
39
40
41
42
43
44
45
|
# File 'lib/datafile/datasets/dataset.rb', line 39
def download()
logger.info( "download dataset '#{@name}'" )
logger.info( " from '#{remote_zip_url}'" )
logger.info( " to '#{local_zip_path}'..." )
download_blob( remote_zip_url, local_zip_path )
end
|
#local_zip_name ⇒ Object
24
25
26
27
28
|
# File 'lib/datafile/datasets/dataset.rb', line 24
def local_zip_name()
@name.gsub('/', '--I--') end
|
#local_zip_path ⇒ Object
34
35
36
|
# File 'lib/datafile/datasets/dataset.rb', line 34
def local_zip_path() "#{local_zip_root}/#{local_zip_name}.zip"
end
|
#local_zip_root ⇒ Object
30
31
32
|
# File 'lib/datafile/datasets/dataset.rb', line 30
def local_zip_root()
"./tmp"
end
|
#remote_zip_url ⇒ Object
18
19
20
21
22
|
# File 'lib/datafile/datasets/dataset.rb', line 18
def remote_zip_url() "http://github.com/#{@name}/archive/master.zip"
end
|
#setup ⇒ Object
13
14
15
16
|
# File 'lib/datafile/datasets/dataset.rb', line 13
def setup()
value = @opts[:setup] || 'all'
"setups/#{value}"
end
|