Class: RedshiftSimpleMigrator::Configuration
- Inherits:
-
Object
- Object
- RedshiftSimpleMigrator::Configuration
- Includes:
- ActiveSupport::Configurable, Singleton
- Defined in:
- lib/redshift_simple_migrator/configuration.rb
Instance Method Summary collapse
Instance Method Details
#database_config ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/redshift_simple_migrator/configuration.rb', line 27 def database_config { host: host, port: port, dbname: dbname, user: user, password: password, connect_timeout: connect_timeout } end |
#load(config_file, default_env = "development") ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/redshift_simple_migrator/configuration.rb', line 19 def load(config_file, default_env = "development") env = ENV["REDSHIFT_ENV"] || ENV["RAILS_ENV"] || ENV["RACK_ENV"] || default_env config = YAML.load_file(config_file)[env] config.each do |k, v| send("#{k}=", v) end end |