class CropDuster::CLI

Public Instance Methods

import() click to toggle source
# File lib/crop_duster/cli.rb, line 23
def import
  set_configs(options[:db], options[:aws_secret], options[:aws_key], options[:aws_billing_bucket], options[:tmp_dir])
  CropDuster::Importer.import
end
import_billing() click to toggle source
# File lib/crop_duster/cli.rb, line 34
def import_billing
  set_configs(options[:db], options[:aws_secret], options[:aws_key], options[:aws_billing_bucket], options[:tmp_dir])
  CropDuster::Importer.import_billing
end
migrate() click to toggle source
# File lib/crop_duster/cli.rb, line 8
def migrate
  CropDuster.configure do |config|
    config.db = options[:db]
  end

  ActiveRecord::Migration.verbose = true
  ActiveRecord::Migrator.migrate File.join(File.dirname(__FILE__), "..", "..", "db", "migrate")
end

Private Instance Methods

set_configs(db_url, aws_secret, aws_key, aws_billing_bucket = nil, tmp_dir = "/tmp") click to toggle source
# File lib/crop_duster/cli.rb, line 40
def set_configs(db_url, aws_secret, aws_key, aws_billing_bucket = nil, tmp_dir = "/tmp")
  CropDuster.configure do |config|
    config.db                 = db_url
    config.aws_secret         = aws_secret
    config.aws_key            = aws_key
    config.aws_billing_bucket = aws_billing_bucket
    config.tmp_dir            = tmp_dir
  end
end