Class: Debci::Config

Inherits:
Struct
  • Object
show all
Defined in:
lib/debci/config.rb

Overview

This class contains provides a Ruby interface to read debci configuration values.

Available configuration items:

  • data_basedir: the root directory used by debci to store test run data

There is a globally accessible instance of this class accessible from the config method of the Debci module.

>> Debci.config.data_basedir
=> "/path/to/debci/data"

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Config) initialize

Returns a new instance of Config



26
27
28
29
30
31
32
33
34
# File 'lib/debci/config.rb', line 26

def initialize
  # :nodoc:
  IO.popen(['debci', 'config', *members.map(&:to_s)]) do |data|
    data.each_line.each do |line|
      key, value = line.strip.split('=')
      self.send("#{key}=", value)
    end
  end
end

Instance Attribute Details

- (Object) data_basedir

Returns the value of attribute data_basedir

Returns:

  • (Object)

    the current value of data_basedir



16
17
18
# File 'lib/debci/config.rb', line 16

def data_basedir
  @data_basedir
end