Factor out MySQL and Postgres requirements
This commit is contained in:
parent
1cb59ea5fd
commit
1c56cda4f1
@ -72,6 +72,10 @@ private
|
|||||||
X11Dependency.new(tag)
|
X11Dependency.new(tag)
|
||||||
when :xcode
|
when :xcode
|
||||||
XcodeDependency.new(tag)
|
XcodeDependency.new(tag)
|
||||||
|
when :mysql
|
||||||
|
MysqlInstalled.new(tag)
|
||||||
|
when :postgresql
|
||||||
|
PostgresqlInstalled.new(tag)
|
||||||
else
|
else
|
||||||
raise "Unsupported special dependency #{spec}"
|
raise "Unsupported special dependency #{spec}"
|
||||||
end
|
end
|
||||||
|
@ -219,3 +219,46 @@ class XcodeDependency < Requirement
|
|||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class MysqlInstalled < Requirement
|
||||||
|
def fatal?; true; end
|
||||||
|
|
||||||
|
def satisfied?
|
||||||
|
which 'mysql_config'
|
||||||
|
end
|
||||||
|
|
||||||
|
def message; <<-EOS.undent
|
||||||
|
MySQL is required to install.
|
||||||
|
|
||||||
|
You can install this with Homebrew using:
|
||||||
|
brew install mysql-connector-c
|
||||||
|
For MySQL client libraries only.
|
||||||
|
|
||||||
|
brew install mysql
|
||||||
|
For MySQL server.
|
||||||
|
|
||||||
|
Or you can use an official installer from:
|
||||||
|
http://dev.mysql.com/downloads/mysql/
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class PostgresInstalled < Requirement
|
||||||
|
def fatal?; true; end
|
||||||
|
|
||||||
|
def satisfied?
|
||||||
|
which 'pg_config'
|
||||||
|
end
|
||||||
|
|
||||||
|
def message
|
||||||
|
<<-EOS.undent
|
||||||
|
Postgres is required to install.
|
||||||
|
|
||||||
|
You can install this with Homebrew using:
|
||||||
|
brew install postgres
|
||||||
|
|
||||||
|
Or you can use an official installer from:
|
||||||
|
http://www.postgresql.org/download/macosx/
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user