Class: Chicago::ETL::RakeTasks

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/chicago/etl/tasks.rb

Overview

ETL Rake tasks for a Chicago project.

To use, simply include:

Chicago::ETL::RakeTasks.new(schema, :staging_db => db)

in your project’s Rakefile.

Provides the following tasks:

db:create_etl_tables

defines the tables used for ETL batches and the like

Instance Method Summary collapse

Constructor Details

#initialize(schema, options) ⇒ RakeTasks

Returns a new instance of RakeTasks.



18
19
20
21
22
23
# File 'lib/chicago/etl/tasks.rb', line 18

def initialize(schema, options)
  @schema = schema
  @db = options[:staging_db]

  define
end

Instance Method Details

#defineObject



25
26
27
28
29
30
31
32
# File 'lib/chicago/etl/tasks.rb', line 25

def define
  namespace :db do
    desc "Creates the etl tables"
    task :create_etl_tables do
      Chicago::ETL::TableBuilder.build(@db)
    end
  end
end