Class: IrcCat::HttpServer

Inherits:
Object
  • Object
show all
Defined in:
lib/irc_cat/http_server.rb

Instance Method Summary collapse

Constructor Details

#initialize(bot, config, ip, port) ⇒ HttpServer

Returns a new instance of HttpServer.



17
18
19
20
21
22
23
24
25
26
# File 'lib/irc_cat/http_server.rb', line 17

def initialize(bot, config, ip, port)
  @bot = bot
  @config = config
  puts "Starting HTTP (#{ip}:#{port})"
  h = Mongrel::HttpServer.new(ip, port)
  h.register("/", Index.new)
  h.register("/send", Send.new(@bot, @config)) if @config['http']['send'] == true
  h.register("/github", Github.new(@bot, @config)) if @config['http']['github'] == true
  h.run.join
end