Sha256: 1645a1b9f8a0e8ff937c8844a474a360265928c2b7c3b81756f0376e09a52ca8

Contents?: true

Size: 1.99 KB

Versions: 7

Compression:

Stored size: 1.99 KB

Contents

require 'flare_up'

host_name = 'flare-up-test.cskjnp4xvaje.us-west-2.redshift.amazonaws.com'
db_name = 'dev'
table_name = 'hearthstone_cards'
data_source = 's3://slif-redshift/hearthstone_cards_short_list.csv'

conn = FlareUp::Connection.new(host_name, db_name, ENV['REDSHIFT_USERNAME'], ENV['REDSHIFT_PASSWORD'])

copy = FlareUp::CopyCommand.new(table_name, data_source, ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'])
copy.columns = %w(name cost attack health description)
copy.options = "REGION 'us-east-1' CSV"

result = copy.execute(conn)

good_command = <<-COMMAND
flare-up copy \
  s3://slif-redshift/hearthstone_cards_short_list.csv \
  flare-up-test.cskjnp4xvaje.us-west-2.redshift.amazonaws.com \
  dev \
  hearthstone_cards \
  --column-list name cost attack health description \
  --copy_options "REGION 'us-east-1' CSV"
COMMAND

bad_data_source_command = <<-COMMAND
flare-up copy \
  s3://slif-redshift/hearthstone_cards_short_lissdsdsdsdsdsdsd.csv \
  flare-up-test.cskjnp4xvaje.us-west-2.redshift.amazonaws.com \
  dev \
  hearthstone_cards \
  --column-list name cost attack health description \
  --copy_options "REGION 'us-east-1' CSV"
COMMAND

bad_data_command = <<-COMMAND
flare-up copy \
  s3://slif-redshift/hearthstone_cards_broken.csv \
  flare-up-test.cskjnp4xvaje.us-west-2.redshift.amazonaws.com \
  dev \
  hearthstone_cards \
  --column-list name cost attack health description \
  --copy_options "REGION 'us-east-1' CSV"
COMMAND

other_zone_bucket = <<-COMMAND
flare-up copy \
  s3://slif-redshift/hearthstone_cards_short_list.csv \
  flare-up-test.cskjnp4xvaje.us-west-2.redshift.amazonaws.com \
  dev \
  hearthstone_cards \
  --column-list name cost attack health description \
  --copy_options CSV
COMMAND

busted_options = <<-COMMAND
flare-up copy \
  s3://slif-redshift/hearthstone_cards_short_list.csv \
  flare-up-test.cskjnp4xvaje.us-west-2.redshift.amazonaws.com \
  dev \
  hearthstone_cards \
  --column-list name cost attack health description \
  --copy_options "CSV ;lmlkmlk3"
COMMAND

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
flare-up-0.8 resources/load_hearthstone_cards.rb
flare-up-0.7 resources/load_hearthstone_cards.rb
flare-up-0.6 resources/load_hearthstone_cards.rb
flare-up-0.5 resources/load_hearthstone_cards.rb
flare-up-0.4 resources/load_hearthstone_cards.rb
flare-up-0.3 resources/load_hearthstone_cards.rb
flare-up-0.2 resources/load_hearthstone_cards.rb