Class: Shoestring::Postgres

Inherits:
Base
  • Object
show all
Defined in:
lib/shoestring/postgres.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

check

Constructor Details

#initialize(postgres_interactive = 'psql') ⇒ Postgres

Returns a new instance of Postgres.



5
6
7
# File 'lib/shoestring/postgres.rb', line 5

def initialize(postgres_interactive = 'psql')
  @postgres_interactive = postgres_interactive
end

Instance Attribute Details

#postgres_interactiveObject (readonly)

Returns the value of attribute postgres_interactive.



3
4
5
# File 'lib/shoestring/postgres.rb', line 3

def postgres_interactive
  @postgres_interactive
end

Instance Method Details

#checkObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/shoestring/postgres.rb', line 9

def check
  Shoestring::Generic.check('Postgres', install_help) do
    if system("which #{postgres_interactive} >/dev/null")
      true
    else
      puts "Postgres interactive command (#{postgres_interactive}) not found."
      false
    end
  end
end