lib/bin_install/postgres.rb in bin_install-0.0.6 vs lib/bin_install/postgres.rb in bin_install-0.0.9
- old
+ new
@@ -1,15 +1,15 @@
module BinInstall
module Postgres
def self.install
puts 'Installing PostgreSQL...'.white
- Brew.install_or_upgrade('postgresql')
+ Brew::Package.install_or_upgrade('postgresql')
end
def self.install!
puts 'Installing PostgreSQL...'.white
- Brew.install_or_upgrade!('postgresql')
+ Brew::Package.install_or_upgrade!('postgresql')
end
def self.create_superuser(username = 'postgres')
system("createuser --superuser #{username}")
end
@@ -22,8 +22,12 @@
system("createuser #{username}")
end
def self.create_user!(username = 'postgres')
BinInstall.system!("createuser #{username}")
+ end
+
+ def self.installed?
+ Shell.executable_exists?('psql')
end
end
end