Class: Inspec::Resources::Postgres

Inherits:
Object
  • Object
show all
Defined in:
lib/inspec/resources/postgres.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePostgres

Returns a new instance of Postgres.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/inspec/resources/postgres.rb', line 10

def initialize
  # determine dirs and service based on versions
  determine_dirs
  determine_service

  # print warnings if the dirs do not exist
  verify_dirs

  if !@version.to_s.empty? && !@conf_dir.to_s.empty?
    @conf_path = File.join @conf_dir, "postgresql.conf"
  else
    @conf_path = nil
    skip_resource "Seems like PostgreSQL is not installed on your system"
  end
end

Instance Attribute Details

#clusterObject (readonly)

Returns the value of attribute cluster.



9
10
11
# File 'lib/inspec/resources/postgres.rb', line 9

def cluster
  @cluster
end

#conf_dirObject (readonly)

Returns the value of attribute conf_dir.



9
10
11
# File 'lib/inspec/resources/postgres.rb', line 9

def conf_dir
  @conf_dir
end

#conf_pathObject (readonly)

Returns the value of attribute conf_path.



9
10
11
# File 'lib/inspec/resources/postgres.rb', line 9

def conf_path
  @conf_path
end

#data_dirObject (readonly)

Returns the value of attribute data_dir.



9
10
11
# File 'lib/inspec/resources/postgres.rb', line 9

def data_dir
  @data_dir
end

#serviceObject (readonly)

Returns the value of attribute service.



9
10
11
# File 'lib/inspec/resources/postgres.rb', line 9

def service
  @service
end

#versionObject (readonly)

Returns the value of attribute version.



9
10
11
# File 'lib/inspec/resources/postgres.rb', line 9

def version
  @version
end

Instance Method Details

#to_sObject



26
27
28
# File 'lib/inspec/resources/postgres.rb', line 26

def to_s
  "PostgreSQL"
end