aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2015-06-14 19:48:58 -0400
committerTeddy Wing2015-06-14 19:48:58 -0400
commitf1b64d6816086554cc5538eca24e0cdba36dff70 (patch)
tree134eaeb474514b7a1734cf45ed4071952977b857
parentbef0d13cf98bb8d8bb354b6cc6181b6729aaa04b (diff)
downloadirssi-hipchat-stfu-f1b64d6816086554cc5538eca24e0cdba36dff70.tar.bz2
Change title message format (single line)
Change the format so that the title message is on a single line instead of 3. Typically this will mean that the message will appear on 2 lines, which is still better than 3 lines, saving us some vertical space.
-rw-r--r--hipchat-stfu.pl2
-rwxr-xr-xtest.pl10
2 files changed, 4 insertions, 8 deletions
diff --git a/hipchat-stfu.pl b/hipchat-stfu.pl
index 10fcc23..22c288c 100644
--- a/hipchat-stfu.pl
+++ b/hipchat-stfu.pl
@@ -29,7 +29,7 @@ sub prettify_hipchat {
# Construct start message
if ($link) {
- $input =~ s/ Created by/\n$link\nCreated by/g;
+ $input =~ s/Created by (.+)$/($1) ($link)/g;
}
return $input;
diff --git a/test.pl b/test.pl
index 5a0ace1..1e0a2a3 100755
--- a/test.pl
+++ b/test.pl
@@ -5,15 +5,11 @@ use strict;
use Test::More tests => 9;
require 'prettify_hipchat.pl';
-my $title_message = <<'END_MESSAGE';
-SC-1000 : Some kind of issue text that is kind of long and describes the problem that we saw during testing.
-https://somecompany.atlassian.net/browse/SC-2169
-Created by Person Name
-END_MESSAGE
-chomp($title_message);
is(prettify_hipchat(' <img src="https://somecompany.atlassian.net/images/16jira.png" height="16" width="16" /> <a href="https://somecompany.atlassian.net/browse/SC-2169"><b>SC-1000 : Some kind of issue text that is kind of long and describes the problem that we saw during testing.</b></a> Created by <a href="https://somecompany.atlassian.net/secure/ViewProfile.jspa?name=PersonN">Person Name</a><br />'),
- $title_message,
+ 'SC-1000 : Some kind of issue text that is kind of long and describes the ' .
+ 'problem that we saw during testing. (Person Name) ' .
+ '(https://somecompany.atlassian.net/browse/SC-2169)',
'Title, link, and creator');
is(prettify_hipchat('<span style="color: dimgrey;">Type:</span>  <img src="https://somecompany.atlassian.net/images/icons/issuetypes/bug.png" height="16" width="16" /> Bug  '),
'Type: Bug',