Class: Muck::Config
- Inherits:
-
Object
- Object
- Muck::Config
- Defined in:
- lib/muck/config.rb
Instance Attribute Summary collapse
-
#defaults ⇒ Object
readonly
Returns the value of attribute defaults.
-
#servers ⇒ Object
readonly
Returns the value of attribute servers.
Instance Method Summary collapse
-
#initialize(directory) ⇒ Config
constructor
A new instance of Config.
- #run(options = {}) ⇒ Object
Constructor Details
#initialize(directory) ⇒ Config
Returns a new instance of Config.
7 8 9 10 11 12 |
# File 'lib/muck/config.rb', line 7 def initialize(directory) @directory = directory @defaults = {} @servers = [] parse end |
Instance Attribute Details
#defaults ⇒ Object (readonly)
Returns the value of attribute defaults.
14 15 16 |
# File 'lib/muck/config.rb', line 14 def defaults @defaults end |
#servers ⇒ Object (readonly)
Returns the value of attribute servers.
15 16 17 |
# File 'lib/muck/config.rb', line 15 def servers @servers end |
Instance Method Details
#run(options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/muck/config.rb', line 17 def run( = {}) servers.each do |server| server.databases.each do |database| if database.backup_now? || [:force] database.backup database.archive_all end end end end |