]>
gitweb.michael.orlitzky.com - mailshears.git/blob - lib/common/configuration.rb
5 USERCONF_PATH
= ENV['HOME'] +
'/.mailshears.conf.yml'
8 def initialize(path
= USERCONF_PATH
)
9 cfg
= default_configuration()
11 # Now, load the user configuration which will override the
12 # variables defined above.
14 user_config
= YAML
.load(File
.open(path
))
16 # Write our own update() method for Ruby 1.8.
17 user_config
.each
do |key
, value
|
21 # If the user config file doesn't exist, whatever.
24 # Convert all of the keys to symbols.
25 cfg
= cfg
.inject({}){|memo
,(k
,v
)| memo
[k
.to_sym
] = v
; memo
}
31 def method_missing(sym
, *args
)
32 # Replace all missing method calls with dictionary lookups.
39 def default_configuration()
42 d
['i_mean_business'] = false
43 d
['plugins'] = ['agendav',
49 d
['agendav_dbhost'] = 'localhost'
50 d
['agendav_dbport'] = 5432
51 d
['agendav_dbopts'] = ''
52 d
['agendav_dbtty'] = ''
53 d
['agendav_dbuser'] = 'postgres'
54 d
['agendav_dbpass'] = ''
55 d
['agendav_dbname'] = 'agendav'
57 d
['davical_dbhost'] = 'localhost'
58 d
['davical_dbport'] = 5432
59 d
['davical_dbopts'] = ''
60 d
['davical_dbtty'] = ''
61 d
['davical_dbuser'] = 'postgres'
62 d
['davical_dbpass'] = ''
63 d
['davical_dbname'] = 'davical'
65 d
['dovecot_mail_root'] = '/var/spool/mail/vhosts'
67 d
['postfixadmin_dbhost'] = 'localhost'
68 d
['postfixadmin_dbport'] = 5432
69 d
['postfixadmin_dbopts'] = ''
70 d
['postfixadmin_dbtty'] = ''
71 d
['postfixadmin_dbuser'] = 'postgres'
72 d
['postfixadmin_dbpass'] = ''
73 d
['postfixadmin_dbname'] = 'postfixadmin'
75 d
['roundcube_dbhost'] = 'localhost'
76 d
['roundcube_dbport'] = 5432
77 d
['roundcube_dbopts'] = ''
78 d
['roundcube_dbtty'] = ''
79 d
['roundcube_dbuser'] = 'postgres'
80 d
['roundcube_dbpass'] = ''
81 d
['roundcube_dbname'] = 'roundcube'