Sha256: b215baa909f31f3ae35175d059fc4f1226ba8b92810805ad9867c1863f98210b

Contents?: true

Size: 817 Bytes

Versions: 9

Compression:

Stored size: 817 Bytes

Contents

module BinInstall
  module Postgres
    def self.install
      puts 'Installing PostgreSQL...'.white
      Brew::Package.install_or_upgrade('postgresql')
    end

    def self.install!
      puts 'Installing PostgreSQL...'.white
      Brew::Package.install_or_upgrade!('postgresql')
    end

    def self.create_superuser(username = 'postgres')
      system("createuser --superuser #{username}")
    end

    def self.create_superuser!(username = 'postgres')
      BinInstall.system!("createuser --superuser #{username}")
    end

    def self.create_user(username = 'postgres')
      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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
bin_install-0.0.17 lib/bin_install/postgres.rb
bin_install-0.0.16 lib/bin_install/postgres.rb
bin_install-0.0.15 lib/bin_install/postgres.rb
bin_install-0.0.14 lib/bin_install/postgres.rb
bin_install-0.0.13 lib/bin_install/postgres.rb
bin_install-0.0.12 lib/bin_install/postgres.rb
bin_install-0.0.11 lib/bin_install/postgres.rb
bin_install-0.0.10 lib/bin_install/postgres.rb
bin_install-0.0.9 lib/bin_install/postgres.rb