Module: Egis

Defined in:
lib/egis.rb,
lib/egis/table.rb,
lib/egis/types.rb,
lib/egis/client.rb,
lib/egis/errors.rb,
lib/egis/testing.rb,
lib/egis/version.rb,
lib/egis/database.rb,
lib/egis/s3_cleaner.rb,
lib/egis/query_status.rb,
lib/egis/table_schema.rb,
lib/egis/configuration.rb,
lib/egis/output_parser.rb,
lib/egis/standard_mode.rb,
lib/egis/table_data_wiper.rb,
lib/egis/output_downloader.rb,
lib/egis/s3_location_parser.rb,
lib/egis/aws_client_provider.rb,
lib/egis/table_ddl_generator.rb,
lib/egis/partitions_generator.rb,
lib/egis/testing/testing_mode.rb,
lib/egis/query_output_location.rb,
lib/egis/types/null_serializer.rb,
lib/egis/types/string_serializer.rb,
lib/egis/types/boolean_serializer.rb,
lib/egis/types/default_serializer.rb,
lib/egis/types/integer_serializer.rb,
lib/egis/types/timestamp_serializer.rb,
lib/egis/cartesian_product_generator.rb

Overview

rubocop:disable Style/Documentation

Defined Under Namespace

Modules: Errors Classes: Client, Database, QueryOutputLocation, QueryStatus, Table, TableSchema

Constant Summary collapse

VERSION =
'1.1.0'

Class Method Summary collapse

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:

  • (configuration)

48
49
50
# File 'lib/egis.rb', line 48

def configure
  yield(configuration)
end

.testingvoid

This method returns an undefined value.

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.

Examples:

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

37
38
39
40
41
42
43
44
45
46
47
# 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