Class: Backup::Features

Inherits:
Object
  • Object
show all
Defined in:
lib/backup-agent/features.rb

Instance Method Summary collapse

Constructor Details

#initializeFeatures

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_mongodbObject



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_mysqlObject



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

Returns:

  • (Boolean)


26
27
28
# File 'lib/backup-agent/features.rb', line 26

def mongodb_installed?
  !!@mongodb_check
end

#mysql_installed?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/backup-agent/features.rb', line 22

def mysql_installed?
  !!@mysql_check
end