Sha256: e4faa2900c38ebebc01b559169bcc48da834aad4465dc4c5af43fa2009344b23

Contents?: true

Size: 1.04 KB

Versions: 13

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...'.whtie
      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

13 entries across 13 versions & 1 rubygems

Version Path
bin_install-0.0.30 lib/bin_install/postgres.rb
bin_install-0.0.29 lib/bin_install/postgres.rb
bin_install-0.0.28 lib/bin_install/postgres.rb
bin_install-0.0.27 lib/bin_install/postgres.rb
bin_install-0.0.26 lib/bin_install/postgres.rb
bin_install-0.0.25 lib/bin_install/postgres.rb
bin_install-0.0.24 lib/bin_install/postgres.rb
bin_install-0.0.23 lib/bin_install/postgres.rb
bin_install-0.0.22 lib/bin_install/postgres.rb
bin_install-0.0.21 lib/bin_install/postgres.rb
bin_install-0.0.20 lib/bin_install/postgres.rb
bin_install-0.0.19 lib/bin_install/postgres.rb
bin_install-0.0.18 lib/bin_install/postgres.rb