Module: Databasion

Defined in:
lib/databasion.rb,
lib/databasion/migrate.rb,
lib/databasion/load_data.rb,
lib/databasion/application.rb,
lib/databasion/cron_system.rb,
lib/databasion/yaml_builder.rb,
lib/databasion/git_committer.rb,
lib/databasion/google_loader.rb,
lib/databasion/svn_committer.rb,
lib/databasion/build_migration.rb

Defined Under Namespace

Classes: Application, BuildMigration, BuildMigrationError, CronSystem, CronSystemError, DatabasionError, GitCommitter, GoogleLoader, GoogleLoaderError, LoadData, Migrate, SvnCommitter, YamlBuilder, YamlBuilderError

Constant Summary collapse

LOGGER =
Logger.new $stderr
@@config =
nil

Class Method Summary collapse

Class Method Details

.run(system, opts = nil) ⇒ Object

Raises:



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/databasion.rb', line 18

def self.run(system, opts=nil)
  LOGGER.level = Logger::INFO
  
  raise DatabasionError, 'Databasion requires a YAML config file path.' if opts[:config].nil?
  @@config = YAML.load(File.open(opts[:config]))
  
  case system
  when "google"
    run_google(opts)
  when "migrate"
    run_migrate(opts)
  when "load"
    run_load(opts)
  when "svn"
    run_svn(opts)
  when "git"
    run_git(opts)
  when "cron"
    run_cron(opts)
  end
end