Module: CsvPack

Defined in:
lib/csvpack/pack.rb,
lib/csvpack.rb,
lib/csvpack/version.rb,
lib/csvpack/downloader.rb

Overview

note: for now use in-memory sqlite3 db

Defined Under Namespace

Classes: Downloader, Meta, Pack, Tab

Constant Summary collapse

MAJOR =

todo: namespace inside version or something - why? why not??

0
MINOR =
2
PATCH =
0
VERSION =
[MAJOR,MINOR,PATCH].join('.')

Class Method Summary collapse

Class Method Details



14
15
16
# File 'lib/csvpack/version.rb', line 14

def self.banner
  "csvpack/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
end

.import(*args) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/csvpack.rb', line 30

def self.import( *args )
  ## step 1: download
  dl = Downloader.new
  args.each do |arg|
    dl.fetch( arg )
  end

  ## step 2: up 'n' import
  args.each do |arg|
    pack = Pack.new( "./pack/#{arg}/datapackage.json" )
    pack.tables.each do |table|
      table.up!
      table.import!
    end
  end
end

.rootObject



18
19
20
# File 'lib/csvpack/version.rb', line 18

def self.root
  File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
end

.versionObject



10
11
12
# File 'lib/csvpack/version.rb', line 10

def self.version
  VERSION
end