Class: UffDbLoader::Configuration
- Inherits:
-
Object
- Object
- UffDbLoader::Configuration
- Defined in:
- lib/configuration.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
Returns the value of attribute app_name.
-
#container_name ⇒ Object
Returns the value of attribute container_name.
-
#database_config_file ⇒ Object
Returns the value of attribute database_config_file.
-
#db_name ⇒ Object
Returns the value of attribute db_name.
-
#db_system ⇒ Object
Returns the value of attribute db_system.
-
#dumps_directory ⇒ Object
Returns the value of attribute dumps_directory.
-
#environments ⇒ Object
Returns the value of attribute environments.
-
#local_restore_command_path ⇒ Object
Returns the value of attribute local_restore_command_path.
-
#ssh_host ⇒ Object
Returns the value of attribute ssh_host.
-
#ssh_user ⇒ Object
Returns the value of attribute ssh_user.
Instance Method Summary collapse
- #database ⇒ Object
- #database_system ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/configuration.rb', line 21 def initialize @environments = nil @ssh_host = nil @ssh_user = nil @db_name = nil @db_system = nil @app_name = Dir.pwd.split("/").last @dumps_directory = File.join(Dir.pwd, "dumps") @database_config_file = File.join(Dir.pwd, "config", "database.yml") @container_name = nil @local_restore_command_path = nil end |
Instance Attribute Details
#app_name ⇒ Object
Returns the value of attribute app_name.
8 9 10 |
# File 'lib/configuration.rb', line 8 def app_name @app_name end |
#container_name ⇒ Object
Returns the value of attribute container_name.
8 9 10 |
# File 'lib/configuration.rb', line 8 def container_name @container_name end |
#database_config_file ⇒ Object
Returns the value of attribute database_config_file.
8 9 10 |
# File 'lib/configuration.rb', line 8 def database_config_file @database_config_file end |
#db_name ⇒ Object
Returns the value of attribute db_name.
8 9 10 |
# File 'lib/configuration.rb', line 8 def db_name @db_name end |
#db_system ⇒ Object
Returns the value of attribute db_system.
8 9 10 |
# File 'lib/configuration.rb', line 8 def db_system @db_system end |
#dumps_directory ⇒ Object
Returns the value of attribute dumps_directory.
8 9 10 |
# File 'lib/configuration.rb', line 8 def dumps_directory @dumps_directory end |
#environments ⇒ Object
Returns the value of attribute environments.
8 9 10 |
# File 'lib/configuration.rb', line 8 def environments @environments end |
#local_restore_command_path ⇒ Object
Returns the value of attribute local_restore_command_path.
8 9 10 |
# File 'lib/configuration.rb', line 8 def local_restore_command_path @local_restore_command_path end |
#ssh_host ⇒ Object
Returns the value of attribute ssh_host.
8 9 10 |
# File 'lib/configuration.rb', line 8 def ssh_host @ssh_host end |
#ssh_user ⇒ Object
Returns the value of attribute ssh_user.
8 9 10 |
# File 'lib/configuration.rb', line 8 def ssh_user @ssh_user end |
Instance Method Details
#database ⇒ Object
34 35 36 |
# File 'lib/configuration.rb', line 34 def database db_name || ssh_user end |
#database_system ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/configuration.rb', line 38 def database_system case db_system.to_sym when :postgresql UffDbLoader::Postgresql when :mysql UffDbLoader::Mysql else raise UnknownDatabaseSystem, "Could not identify database system. Use `config.db_system` to configure it." end end |