Module: OrientdbSchemaMigrator
- Defined in:
- lib/orientdb-schema-migrator.rb,
lib/orientdb_schema_migrator/proxy.rb,
lib/orientdb_schema_migrator/railtie.rb,
lib/orientdb_schema_migrator/version.rb,
lib/orientdb_schema_migrator/migrator.rb,
lib/orientdb_schema_migrator/migration.rb,
lib/orientdb_schema_migrator/migration_generator.rb
Defined Under Namespace
Classes: InvalidMigrationName, Migration, MigrationError, MigrationGenerator, Migrator, MigratorConflictError, Proxy, Railtie
Constant Summary
collapse
- VERSION =
"0.0.3"
Class Method Summary
collapse
Class Method Details
.client ⇒ Object
35
36
37
|
# File 'lib/orientdb-schema-migrator.rb', line 35
def self.client
@client ||= Orientdb4r.client(:host => get_config["host"])
end
|
.get_config ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/orientdb-schema-migrator.rb', line 12
def self.get_config
config_file =
if defined?(Rails)
Rails.root.to_s + '/config/orientdb.yml'
elsif ENV['ODB_TEST']
File.expand_path('../../spec/support/config.yml', __FILE__)
elsif ENV['odb_config_path']
ENV['odb_config_path']
else
raise "No odb config path defined"
end
env =
if defined?(Rails)
Rails.env
elsif ENV['ODB_TEST']
'test'
else
raise "No environment specified to load database connection config"
end
YAML.load_file(config_file)[env]
end
|