Sha256: aa86c0e55b24ce3a6adf187e66e8e914254ffd3deb6c280688196e772f8bbcd6

Contents?: true

Size: 1.16 KB

Versions: 1

Compression:

Stored size: 1.16 KB

Contents

require 'yaml'
require 'active_support'
require 'active_support/core_ext/string/inflections'
require 'active_record'
require "brillo/version"

require 'brillo/errors'
require 'brillo/helpers/exec_helper'
require 'brillo/logger'

require 'brillo/adapter/base'
require 'brillo/adapter/mysql'
require 'brillo/adapter/postgres'

require 'brillo/transferrer/config'
require 'brillo/transferrer/s3'

require 'brillo/dumper/mysql_dumper'
require 'brillo/railtie'
require 'brillo/config'
require 'brillo/scrubber'
require 'brillo/loader'
require 'polo'

module Brillo
  def self.configure
    yield config
    begin
      config.verify!
    rescue ConfigParseError => e
      puts "Brillo config contains errors: #{e}"
    end
  end

  def self.scrub!(logger: ::Logger.new(STDOUT))
    Brillo::Logger.logger = logger
    Scrubber.new(config).scrub!
  end

  def self.load!(logger: ::Logger.new(STDOUT))
    Brillo::Logger.logger = logger
    Loader.new(config).load!
  end

  def self.config
    @config ||= begin
      static_config = YAML.load_file("#{Rails.root.to_s}/config/brillo.yml")
      Config.new(static_config)
    end
  end

  def self.config=(config)
    @config = config
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
brillo-1.1.0 lib/brillo.rb