module Egis

Egis is configured using Egis.configure block.

@example Configuration using AWS access key ID and secret

Egis.configure do |config|
  config.aws_region = 'AWS region'
  config.aws_access_key_id = 'AWS key ID'
  config.aws_secret_access_key = 'AWS secret key'
  config.work_group = 'egis-integration-testing'
end

If you don't specify credentials they will be looked up in the default locations. For more information see {docs.aws.amazon.com/sdk-for-ruby/v3/developer-guide/setup-config.html}

@example Use specific credentials profile from `~/.aws/credentials`

Egis.configure do |config|
  config.aws_profile = 'my-profile'
end

@example Configure logger

Egis.configure do |config|
  config.logger = Logger.new('athena.log', level: :debug)
end

@yield [Egis::Configuration] @return [void]

Constants

QueryOutputLocation

@!attribute [r] url

@return [String] Query output file's URL

@!attribute [r] bucket

@return [String] Query output's S3 bucket

@!attribute [r] key

@return [String] Query output's S3 path
VERSION

Public Class Methods

configuration() click to toggle source

@!visibility private

# File lib/egis.rb, line 58
def configuration
  @configuration ||= Configuration.new
end
configure(&block) click to toggle source
# File lib/egis.rb, line 53
def configure(&block)
  configuration.configure(&block)
end
logger() click to toggle source

@!visibility private

# File lib/egis.rb, line 68
def logger
  @configuration.logger
end
mode() click to toggle source

@!visibility private

# File lib/egis.rb, line 63
def mode
  @mode ||= Egis::StandardMode.new
end
testing() { || ... } click to toggle source

Egis testing mode. Every table and created within method's block is mapped to a “virtual” table space in your testing S3 bucket. Using it, you can insert test data to your production tables and they will be simulated within the testing bucket, not touching actual locations.

@example RSpec configuration

# spec_helper.rb

require 'egis/testing'

Egis.configure do |config|
  config.testing_s3_bucket = 'testing-bucket'
end

RSpec.configure do |config|
  config.around(:each) do |example|
    Egis.testing do
      example.run
    end
  end
end

@return [void]

# File lib/egis/testing.rb, line 37
def self.testing
  test_id = SecureRandom.hex
  test_mode = Egis::Testing::TestingMode.new(test_id, Egis.configuration.testing_s3_bucket)

  previous_mode = Egis.mode
  @mode = test_mode
  yield
ensure
  @mode = previous_mode
  test_mode&.cleanup
end