Class: Backup::Features
- Inherits:
-
Object
- Object
- Backup::Features
- Defined in:
- lib/backup-agent/features.rb
Instance Method Summary collapse
- #check_mongodb ⇒ Object
- #check_mysql ⇒ Object
-
#initialize ⇒ Features
constructor
A new instance of Features.
- #mongodb_installed? ⇒ Boolean
- #mysql_installed? ⇒ Boolean
Constructor Details
#initialize ⇒ Features
Returns a new instance of Features.
3 4 5 6 |
# File 'lib/backup-agent/features.rb', line 3 def initialize check_mysql check_mongodb end |
Instance Method Details
#check_mongodb ⇒ Object
15 16 17 18 19 20 |
# File 'lib/backup-agent/features.rb', line 15 def check_mongodb if @mongodb_check.nil? @mongodb_check = system('/usr/bin/env mongod --version') ? true : (puts('MongoDB is not installed')) end @mongodb_check end |
#check_mysql ⇒ Object
8 9 10 11 12 13 |
# File 'lib/backup-agent/features.rb', line 8 def check_mysql if @mysql_check.nil? @mysql_check = system('/usr/bin/env mysql --version') ? true : (puts('MySQL is not installed'); false) end @mysql_check end |
#mongodb_installed? ⇒ Boolean
26 27 28 |
# File 'lib/backup-agent/features.rb', line 26 def mongodb_installed? !!@mongodb_check end |
#mysql_installed? ⇒ Boolean
22 23 24 |
# File 'lib/backup-agent/features.rb', line 22 def mysql_installed? !!@mysql_check end |