]>
gitweb.michael.orlitzky.com - mailshears.git/blob - lib/common/configuration.rb
b2a37d01177551cb51c56752e601c7a66f43a976
5 USERCONF_PATH
= ENV['HOME'] +
'/.mailshears.conf.yml'
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(USERCONF_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
44 d
['dbhost'] = 'localhost'
48 d
['dbuser'] = 'postgres'
50 d
['dbname'] = 'postfix'
52 d
['plugins'] = ['dovecot_mailstore', 'roundcube_db']
54 d
['mail_root'] = '/var/spool/mail/vhosts'
56 d
['roundcube_dbhost'] = 'localhost'
57 d
['roundcube_dbport'] = 5432
58 d
['roundcube_dbopts'] = ''
59 d
['roundcube_dbtty'] = ''
60 d
['roundcube_dbuser'] = 'postgres'
61 d
['roundcube_dbpass'] = ''
62 d
['roundcube_dbname'] = 'roundcube'
64 d
['agendav_dbhost'] = 'localhost'
65 d
['agendav_dbport'] = 5432
66 d
['agendav_dbopts'] = ''
67 d
['agendav_dbtty'] = ''
68 d
['agendav_dbuser'] = 'postgres'
69 d
['agendav_dbpass'] = ''
70 d
['agendav_dbname'] = 'agendav'
72 d
['davical_dbhost'] = 'localhost'
73 d
['davical_dbport'] = 5432
74 d
['davical_dbopts'] = ''
75 d
['davical_dbtty'] = ''
76 d
['davical_dbuser'] = 'postgres'
77 d
['davical_dbpass'] = ''
78 d
['davical_dbname'] = 'davical'