Skip to content
This repository was archived by the owner on Jul 12, 2019. It is now read-only.

Commit

Permalink
Refactor to simplicity
Browse files Browse the repository at this point in the history
  • Loading branch information
shalvah committed Feb 3, 2017
1 parent d2ca5a7 commit 501023a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
9 changes: 0 additions & 9 deletions app/Custom/CustomWorker.php

This file was deleted.

1 change: 1 addition & 0 deletions app/Jobs/HandleSlackEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public function handle()
} else {
$rawText = $this->request['event']['text'];
$mustMention = !(preg_match('/^D/', $this->request['event']['channel']));

$parsedText = $this->parseText($rawText, $mustMention);
if (isset($parsedText["type"])) {
if ($parsedText["type"] == "gitlab-add") {
Expand Down
10 changes: 6 additions & 4 deletions config/bot.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@
* "containsType" can only be one of the following:
* "{email}",
*
* The rules are all joined by ANDs
*
* To extract a parenthesized regex pattern into a variable,
* put the name of the variable (in order) in square bracket
* put the name of the variable (in order) after the type (space-separated)
*/
"parse" => array(
"containsAll[username]" => array(
"containsAll username" => array(
"/gitlab/i",
"/username\s*:\s*([^@\s]+)/i"
),
Expand All @@ -74,10 +76,10 @@
"containsAll" => array(
"/pivotal/i"
),
"containsType[email]" => array(
"containsType email" => array(
"{email}",
),
"canContain[project]" => array(
"canContain project" => array(
"/project\s*:\s*([^@\s]+)/"
)
),
Expand Down

0 comments on commit 501023a

Please sign in to comment.