Permalink
Browse files

Do not use control-flow operators. Closes #282

  • Loading branch information...
1 parent 93d9b6c commit 47abba82ca0f3feb3ed8addb0129a4cb5bd2d9d3 @josegonzalez josegonzalez committed Oct 7, 2012
Showing with 12 additions and 12 deletions.
  1. +6 −6 Formula/php53.rb
  2. +6 −6 Formula/php54.rb
View
12 Formula/php53.rb
@@ -40,7 +40,7 @@ class Php53 < Formula
depends_on 'postgresql' => :recommended unless postgres_installed?
end
- if build.include? 'with-cgi' and build.include? 'with-fpm'
+ if build.include?('with-cgi') && build.include?('with-fpm')
raise "Cannot specify more than one executable to build."
end
@@ -185,7 +185,7 @@ def _install
end
# Build Apache module by default
- unless build.include? 'without-apache' or build.include? 'with-cgi' or build.include? 'with-fpm'
+ unless build.include?('without-apache') || build.include?('with-cgi') || build.include?('with-fpm')
args << "--with-apxs2=/usr/sbin/apxs"
args << "--libexecdir=#{libexec}"
end
@@ -216,14 +216,14 @@ def _install
args << "--with-pdo-mysql=/usr/local"
end
- if build.include? 'with-mysql' or build.include? 'with-mariadb'
+ if build.include?('with-mysql') || build.include?('with-mariadb')
args << "--with-mysql-sock=/tmp/mysql.sock"
args << "--with-mysqli=mysqlnd"
args << "--with-mysql=mysqlnd"
args << "--with-pdo-mysql=mysqlnd"
end
- if build.include? 'with-pgsql' and File.directory? Formula.factory('postgresql').prefix.to_s
+ if build.include?('with-pgsql') && File.directory?(Formula.factory('postgresql').prefix.to_s)
args << "--with-pgsql=#{Formula.factory('postgresql').prefix}"
args << "--with-pdo-pgsql=#{Formula.factory('postgresql').prefix}"
elsif build.include? 'with-pgsql'
@@ -249,7 +249,7 @@ def _install
system "./configure", *args
- unless build.include? 'without-apache'
+ unless build.include?('without-apache') || build.include?('with-cgi') || build.include?('with-fpm')
# Use Homebrew prefix for the Apache libexec folder
inreplace "Makefile",
"INSTALL_IT = $(mkinstalldirs) '$(INSTALL_ROOT)/usr/libexec/apache2' && $(mkinstalldirs) '$(INSTALL_ROOT)/private/etc/apache2' && /usr/sbin/apxs -S LIBEXECDIR='$(INSTALL_ROOT)/usr/libexec/apache2' -S SYSCONFDIR='$(INSTALL_ROOT)/private/etc/apache2' -i -a -n php5 libs/libphp5.so",
@@ -269,7 +269,7 @@ def _install
config_path.install "./php.ini-development" => "php.ini" unless File.exists? config_path+"php.ini"
chmod_R 0775, lib+"php"
system bin+"pear", "config-set", "php_ini", config_path+"php.ini" unless build.include? 'without-pear'
- if build.include?('with-fpm') and not File.exists? config_path+"php-fpm.conf"
+ if build.include?('with-fpm') && !File.exists?(config_path+"php-fpm.conf")
config_path.install "sapi/fpm/php-fpm.conf"
inreplace config_path+"php-fpm.conf" do |s|
s.sub!(/^;?daemonize\s*=.+$/,'daemonize = no')
View
12 Formula/php54.rb
@@ -42,7 +42,7 @@ class Php54 < Formula
depends_on 'postgresql' => :recommended unless postgres_installed?
end
- if build.include? 'with-cgi' and build.include? 'with-fpm'
+ if build.include?('with-cgi') && build.include?('with-fpm')
raise "Cannot specify more than one executable to build."
end
@@ -191,7 +191,7 @@ def _install
end
# Build Apache module by default
- unless build.include? 'without-apache' or build.include? 'with-cgi' or build.include? 'with-fpm'
+ unless build.include?('without-apache') || build.include?('with-cgi') || build.include?('with-fpm')
args << "--with-apxs2=/usr/sbin/apxs"
args << "--libexecdir=#{libexec}"
end
@@ -222,14 +222,14 @@ def _install
args << "--with-pdo-mysql=/usr/local"
end
- if build.include? 'with-mysql' or build.include? 'with-mariadb'
+ if build.include?('with-mysql') && build.include?('with-mariadb')
args << "--with-mysql-sock=/tmp/mysql.sock"
args << "--with-mysqli=mysqlnd"
args << "--with-mysql=mysqlnd"
args << "--with-pdo-mysql=mysqlnd"
end
- if build.include? 'with-pgsql' and File.directory? Formula.factory('postgresql').prefix.to_s
+ if build.include?('with-pgsql') && File.directory?(Formula.factory('postgresql').prefix.to_s)
args << "--with-pgsql=#{Formula.factory('postgresql').prefix}"
args << "--with-pdo-pgsql=#{Formula.factory('postgresql').prefix}"
elsif build.include? 'with-pgsql'
@@ -259,7 +259,7 @@ def _install
system "./buildconf" if build.head?
system "./configure", *args
- unless build.include? 'without-apache'
+ unless build.include?('without-apache') || build.include?('with-cgi') || build.include?('with-fpm')
# Use Homebrew prefix for the Apache libexec folder
inreplace "Makefile",
"INSTALL_IT = $(mkinstalldirs) '$(INSTALL_ROOT)/usr/libexec/apache2' && $(mkinstalldirs) '$(INSTALL_ROOT)/private/etc/apache2' && /usr/sbin/apxs -S LIBEXECDIR='$(INSTALL_ROOT)/usr/libexec/apache2' -S SYSCONFDIR='$(INSTALL_ROOT)/private/etc/apache2' -i -a -n php5 libs/libphp5.so",
@@ -279,7 +279,7 @@ def _install
config_path.install "./php.ini-development" => "php.ini" unless File.exists? config_path+"php.ini"
chmod_R 0775, lib+"php"
system bin+"pear", "config-set", "php_ini", config_path+"php.ini" unless build.include? 'without-pear'
- if build.include?('with-fpm') and not File.exists? config_path+"php-fpm.conf"
+ if build.include?('with-fpm') && !File.exists?(config_path+"php-fpm.conf")
config_path.install "sapi/fpm/php-fpm.conf"
inreplace config_path+"php-fpm.conf" do |s|
s.sub!(/^;?daemonize\s*=.+$/,'daemonize = no')

0 comments on commit 47abba8

Please sign in to comment.