Class: Unschema::Base

Inherits:
Struct
  • Object
show all
Defined in:
lib/unschema/base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#migrations_pathObject

Returns the value of attribute migrations_path

Returns:

  • (Object)

    the current value of migrations_path



2
3
4
# File 'lib/unschema/base.rb', line 2

def migrations_path
  @migrations_path
end

#schema_fileObject

Returns the value of attribute schema_file

Returns:

  • (Object)

    the current value of schema_file



2
3
4
# File 'lib/unschema/base.rb', line 2

def schema_file
  @schema_file
end

#verboseObject

Returns the value of attribute verbose

Returns:

  • (Object)

    the current value of verbose



2
3
4
# File 'lib/unschema/base.rb', line 2

def verbose
  @verbose
end

Class Method Details

.process!(*args) ⇒ Object



3
4
5
# File 'lib/unschema/base.rb', line 3

def self.process!(*args)
  new(*args).process
end

Instance Method Details

#processObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/unschema/base.rb', line 11

def process
  load schema_file
  preset_version

  calls_for_tables = collect_calls(intermediator.calls)
  log "Found #{calls_for_tables.size} tables"

  calls_for_tables.sort.each do |table_name, calls|
    log "  Dumping #{table_name.inspect}"
    dump_table_calls table_name, calls
  end

  log "Done"
end

#verbose?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/unschema/base.rb', line 7

def verbose?
  !!verbose
end