Class: MySQL
Instance Method Summary
collapse
#initialize, #load_configuration, #save_configuration, #setup, #uninstall, #update
Constructor Details
This class inherits a constructor from SphinxModule
Instance Method Details
#check(quiet = false) ⇒ Object
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/modules/mysql.rb', line 2
def check(quiet = false)
result = true
unless mysql_installed?
result = false
puts "The MySQL server doesn't appear to be installed.'".red unless quiet
end
unless File.exists? "/etc/paths.d/mysql"
result = false
puts "MySQL paths.d file is not configured.".red unless quiet
end
unless File.exists? "/usr/lib/libmysqlclient.18.dylib"
result = false
puts "MySQL does not have a symbolic link set up for the libmysqlclient dynlib.".red unless quiet
end
unless File.exists? "/var/mysql/mysql.sock"
result = false
puts "MySQL socket does not exist.".red unless quiet
end
puts "MySQL is OK.".green if result
result
end
|
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/modules/mysql.rb', line 25
def configure
unless mysql_installed?
puts "\nOnce you have MySQL installed, you may return to this menu to setup root access\n"
end
exit = false
until exit do
choose do ||
. = "\nMySQL Configuration".cyan
.prompt = "Select an option: "
if mysql_installed?
.choice("Setup root access") { set_mysql_root_access }
end
.choice("Done") {
exit = true
}
end
end
end
|
#download ⇒ Object
44
45
46
47
48
49
|
# File 'lib/modules/mysql.rb', line 44
def download
url = "http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.29-osx10.6-x86_64.dmg"
puts "Downloading MySQL".cyan
puts url
result = Download.url(url, SphinxTv::download_path("mysql.dmg"))
end
|
#install ⇒ Object
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/modules/mysql.rb', line 51
def install
puts "Installing MySQL".cyan
unless check(true)
download
Download.mount(SphinxTv::download_path("mysql.dmg"), "mysql*") do |volume|
self.install_mysql_server volume
self.install_mysql_prefpane volume
self.install_mysql_startup volume
end
else
puts "MySQL is installed.".green
end
end
|