Class: Lane::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/Lane/config.rb

Constant Summary collapse

DEFAULT_CONF_FILE =

The location of the default config file

Pathname.new '/etc/lane.conf'
SAMPLE_CONF_FILE =
Pathname.new(__FILE__).parent.parent.parent + 'data/lane.conf.example'
CONF_KEYS =
{
    jamf_server: nil,
    jamf_port: :to_i,
    jamf_use_ssl: nil,
    jamf_user: nil,
    jamf_password: nil
}.freeze

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Initialize!



27
28
29
# File 'lib/Lane/config.rb', line 27

def initialize
  read_global
end

Instance Method Details



36
37
38
# File 'lib/Lane/config.rb', line 36

def print
  CONF_KEYS.keys.sort.each { |k| puts "#{k}: #{send k}" }
end

#read_globalObject



31
32
33
34
# File 'lib/Lane/config.rb', line 31

def read_global
  return false unless DEFAULT_CONF_FILE.file? && DEFAULT_CONF_FILE.readable?
  read DEFAULT_CONF_FILE
end