Class: SimpleBackup::DSL
- Inherits:
-
Object
- Object
- SimpleBackup::DSL
- Defined in:
- lib/simple_backup/dsl.rb
Constant Summary collapse
- @@logger =
Utils::Logger.instance
Instance Method Summary collapse
- #backends(&block) ⇒ Object
- #check_disk_path(path) ⇒ Object
- #default_keep_last(value) ⇒ Object
- #high_usage_treshold(value) ⇒ Object
-
#initialize(engine) ⇒ DSL
constructor
A new instance of DSL.
- #log_level(level) ⇒ Object
- #mailer(&block) ⇒ Object
- #mysql(&block) ⇒ Object
- #sources(&block) ⇒ Object
Constructor Details
#initialize(engine) ⇒ DSL
Returns a new instance of DSL.
5 6 7 |
# File 'lib/simple_backup/dsl.rb', line 5 def initialize(engine) @engine = engine end |
Instance Method Details
#backends(&block) ⇒ Object
34 35 36 37 |
# File 'lib/simple_backup/dsl.rb', line 34 def backends(&block) backends = Backends.instance backends.instance_eval(&block) end |
#check_disk_path(path) ⇒ Object
19 20 21 22 23 |
# File 'lib/simple_backup/dsl.rb', line 19 def check_disk_path(path) @@logger.info "Adding disk path '#{path}' to usage check" Utils::Disk.add_path(path) end |
#default_keep_last(value) ⇒ Object
25 26 27 |
# File 'lib/simple_backup/dsl.rb', line 25 def default_keep_last(value) Sources.instance.default_keep_last = value end |
#high_usage_treshold(value) ⇒ Object
13 14 15 16 17 |
# File 'lib/simple_backup/dsl.rb', line 13 def high_usage_treshold(value) @@logger.info "Setting high_usage_treshold to #{value}" Utils::Disk.high_usage_treshold = value end |
#log_level(level) ⇒ Object
9 10 11 |
# File 'lib/simple_backup/dsl.rb', line 9 def log_level(level) @@logger.level = level end |
#mailer(&block) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/simple_backup/dsl.rb', line 45 def mailer(&block) @@logger.info "Configuring Mailer Util" @mailer = Utils::Mailer.new @mailer.instance_eval(&block) @engine.mailer = @mailer end |
#mysql(&block) ⇒ Object
39 40 41 42 43 |
# File 'lib/simple_backup/dsl.rb', line 39 def mysql(&block) @@logger.info "Configuring MySQL Util" Utils::MySQL.instance.instance_eval(&block) end |
#sources(&block) ⇒ Object
29 30 31 32 |
# File 'lib/simple_backup/dsl.rb', line 29 def sources(&block) sources = Sources.instance sources.instance_eval(&block) end |