Class: Lynx::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/lynx/config.rb

Constant Summary collapse

MYSQL =
['mysql', '/usr/local/bin/mysql', '/usr/local/mysql/bin/mysql']
DUMP =
['mysqldump']

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Config

Returns a new instance of Config.



7
8
9
# File 'lib/lynx/config.rb', line 7

def initialize(config = {})
  @config = config
end

Instance Method Details

#dumpObject



19
20
21
# File 'lib/lynx/config.rb', line 19

def dump
  @dump ||= self[:dump] || detect(DUMP) || raise(Lynx::Error, 'Failed to detect a valid version of mysqldump')
end

#mysqlObject



15
16
17
# File 'lib/lynx/config.rb', line 15

def mysql
  @mysql ||= self[:mysql] || detect(MYSQL) || raise(Lynx::Error, 'Failed to detect a valid version of mysql')
end