Slide 57
Slide 57 text
module Lita
module Handlers
class Rubyconf < Handler
route(/deploy (\w*) (\w*)$/i, :deploy_branch, command: true, help:
{"deploy [repo] [branch]" => "Deploys code according to informed params"})
def deploy_branch(message)
repo, branch = message.match_data[1], message.match_data[2]
github.create_deployment(repo, branch)
response.reply "Started deploying #{repo}/#{branch}!"
end
# continua...
end
Lita.register_handler(Rubyconf)
end
end