Class: Lita::Config

Inherits:
Hash
  • Object
show all
Defined in:
lib/lita/lita.rb

Class Method Summary collapse

Class Method Details

.default_configObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/lita/lita.rb', line 6

def default_config
  config = new.tap do |c|
    c.robot = new
    c.robot.name = "Lita"
    c.robot.adapter = :shell
    c.robot.log_level = :info
    c.robot.admins = nil
    c.redis = new
    c.http = new
    c.http.port = 8080
    c.http.debug = false
    c.adapter = new
    c.handlers = new
    c.schedules = new # added
  end
  load_handler_configs(config)
  load_schedule_configs(config) # added
  config
end

.load_schedule_configs(config) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/lita/lita.rb', line 26

def load_schedule_configs(config)
  Lita.schedules.each do |schedule|
    next unless schedule.respond_to?(:default_config)
    schedule_config = config.schedules[schedule.namespace] = new
    schedule.default_config(schedule_config)
  end
end