Module: DataTaster

Defined in:
lib/data_taster.rb,
lib/data_taster/helper.rb,
lib/data_taster/flavors.rb,
lib/data_taster/version.rb,
lib/data_taster/detergent.rb,
lib/data_taster/sanitizer.rb,
lib/data_taster/collection.rb,
lib/data_taster/confection.rb,
lib/data_taster/sql_literal.rb,
lib/data_taster/export_context.rb,
lib/data_taster/adapters/output.rb,
lib/data_taster/sanitizer_exporter.rb,
lib/data_taster/adapters/file_output.rb,
lib/data_taster/adapters/mysql_source.rb,
lib/data_taster/adapters/database_output.rb,
sig/data_taster.rbs

Defined Under Namespace

Modules: Helper, SqlLiteral Classes: Collection, Confection, Config, DatabaseOutput, Detergent, ExportContext, FileOutput, Flavors, MysqlSource, Output, Sanitizer, SanitizerExporter

Constant Summary collapse

SKIP_CODE =

Returns:

  • (String)
"skip_processing"
VERSION =

Returns:

  • (String)
"0.5.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configConfig

Returns the value of attribute config.

Returns:



22
23
24
# File 'lib/data_taster.rb', line 22

def config
  @config
end

Class Method Details

.confectionHash[String, untyped]

Returns:

  • (Hash[String, untyped])


49
50
51
# File 'lib/data_taster.rb', line 49

def self.confection
  @confection ||= DataTaster::Confection.new.assemble
end

.default_listObject



57
58
59
60
61
62
63
# File 'lib/data_taster.rb', line 57

def self.default_list
  if defined?(Rails) && Rails.respond_to?(:root)
    Rails.root.glob("**/data_taster_export_tables.yml")
  else
    []
  end
end

.logger::Logger

Returns:

  • (::Logger)


29
30
31
# File 'lib/data_taster.rb', line 29

def self.logger
  @logger ||= Logger.new($stdout)
end

.logger=(logger) ⇒ void

This method returns an undefined value.

Parameters:

  • (::Logger)


25
26
27
# File 'lib/data_taster.rb', line 25

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

.reset!void

This method returns an undefined value.



33
34
35
36
37
# File 'lib/data_taster.rb', line 33

def self.reset!
  # TODO: Turn this into objects
  self.config = nil
  @confection = nil
end

.sample!void

This method returns an undefined value.



53
54
55
# File 'lib/data_taster.rb', line 53

def self.sample!
  config.output.sample!
end

.setup(source:, output:, months: nil, list: nil) ⇒ void

This method returns an undefined value.

Parameters:

  • source: (MysqlSource)
  • output: (Output)
  • months: (Integer, nil) (defaults to: nil)
  • list: (Array[String], nil) (defaults to: nil)


39
40
41
42
43
44
45
46
47
# File 'lib/data_taster.rb', line 39

def self.setup(source:, output:, months: nil, list: nil)
  @confection = nil
  self.config = Config.new(
    source,
    output,
    months,
    Array.wrap(list || default_list)
  )
end