<commit_before># Description:
#   Adds GitHub event hooks to GitHub repositories.
#
# Dependencies:
#   None
#
# Configuration:
#   HUBOT_GITHUB_EVENT_BASE_URL - Base URL used for the web hook (or HEROKU_URL)
#   HUBOT_GITHUB_EVENT_DEFAULT_ROOM - Room name of the default room to announce events in
#   HUBOT_GITHUB_EVENT_HOOK_TOKEN - GitHub OAuth token used to administer web hooks
#   HUBOT_GITHUB_EVENT_SECRET - Secret that matches the value stored in the GitHub hook definition
#
# Commands:
#   hubot list hooks on <user>/<repo>
#   hubot listen for events on <user>/<repo>
#
# Notes:
#   None
#
# Author:
#   lee-dohm

HookManager = require './hook-manager'

module.exports = (robot) ->
  robot.respond /list hooks on ([^/]+)\/(.+)$/i, (response) ->
    user = response.match[1]
    repo = response.match[2]

    robot.logger.info "Request to list GitHub event hooks on #{user}/#{repo} received"

    hookManager = new HookManager(robot, response)
    hookManager.listHooks(user, repo)

  robot.respond /listen for events on ([^/]+)\/(.+)$/i, (response) ->
    user = response.match[1]
    repo = response.match[2]

    robot.logger.info "Request to add GitHub events hook to #{user}/#{repo} received"

    hookManager = new HookManager(robot, response)
    hookManager.addHook(user, repo)<commit_msg>Add current room name to URL<commit_after># Description:
#   Adds GitHub event hooks to GitHub repositories.
#
# Dependencies:
#   None
#
# Configuration:
#   HUBOT_GITHUB_EVENT_BASE_URL - Base URL used for the web hook (or HEROKU_URL)
#   HUBOT_GITHUB_EVENT_DEFAULT_ROOM - Room name of the default room to announce events in
#   HUBOT_GITHUB_EVENT_HOOK_TOKEN - GitHub OAuth token used to administer web hooks
#   HUBOT_GITHUB_EVENT_SECRET - Secret that matches the value stored in the GitHub hook definition
#
# Commands:
#   hubot list hooks on <user>/<repo>
#   hubot listen for events on <user>/<repo>
#
# Notes:
#   None
#
# Author:
#   lee-dohm

HookManager = require './hook-manager'

module.exports = (robot) ->
  robot.respond /list hooks on ([^/]+)\/(.+)$/i, (response) ->
    user = response.match[1]
    repo = response.match[2]

    robot.logger.info "Request to list GitHub event hooks on #{user}/#{repo} received"

    hookManager = new HookManager(robot, response)
    hookManager.listHooks(user, repo)

  robot.respond /listen for events on ([^/]+)\/(.+)$/i, (response) ->
    user = response.match[1]
    repo = response.match[2]
    room = response.message.room

    robot.logger.info "Request to add GitHub events hook to #{user}/#{repo} received"

    hookManager = new HookManager(robot, response)
    hookManager.addHook(user, repo, room: room)
{'fraction_non_alphanumeric': 0.1200448765893792, 'fraction_numerical': 0.0029917726252804786, 'mean_word_length': 3.734513274336283, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '753237', 'n_tokens_mistral': 909, 'n_tokens_neox': 877, 'n_words': 264}