lib/slacky/config.rb in slacky-0.1.4 vs lib/slacky/config.rb in slacky-0.2
- old
+ new
@@ -42,9 +42,14 @@
def slack_accept_channels
return nil unless ENV['ACCEPT_CHANNELS']
ENV['ACCEPT_CHANNELS'].split(',').map {|c| c.strip}
end
+ def whitelist_users
+ return nil unless ENV['WHITELIST_USERS']
+ ENV['WHITELIST_USERS'].split(',').map {|u| u.strip}
+ end
+
def log(msg, ex = nil)
log = File.new(log_file, 'a')
timestamp = Time.now.strftime('%Y-%m-%d %H:%M:%S')
type = ex ? 'ERROR' : ' INFO'
log.puts "#{type} #{timestamp} #{msg}"