Sha256: 4dd39f95f05e07c385064328dbf692cb54396ee87e930edbf15e2b33dee865fb

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

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')
      puts 'Creating superuser postgres for postgresqlSQL...'.white
      system("createuser --superuser #{username}")
    end

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

    def self.create_user(username = 'postgres')
      puts "Creating user #{username} for PostgreSQL".white
      system("createuser #{username}")
    end

    def self.create_user!(username = 'postgres')
      puts "Creating user #{username} for PostgreSQL".white
      BinInstall.system!("createuser #{username}")
    end

    def self.installed?
      Shell.executable_exists?('psql')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bin_install-0.0.31 lib/bin_install/postgres.rb