aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-06-14README: Update incorrect transformed output exampleHEADmasterTeddy Wing
Accidentally copied the wrong text without realising it. Change the transformed text in the example to correctly illustrate what should happen.
2015-06-14Condense `signal_add` callv1.00Teddy Wing
Instead of using the hash syntax to add our `message public` signal listener, use the parameterised subroutine style call. Since we're only adding a single signal, we don't really need to use the hash syntax. I started out with it because I was following the example on http://juerd.nl/site.plp/irssiscripttut
2015-06-14Remove hipchat-data.txtTeddy Wing
Now that this information is captured in the README, including it in its own file is no longer necessary.
2015-06-14Add READMETeddy Wing
Include: * A description of the plugin * Requirements * Installation instructions * A note on testing * License information
2015-06-14Add LICENSE (MIT)Teddy Wing
2015-06-14Strip 'Priority:' and 'Status:'Teddy Wing
These single lines are irrelevant and don't need to be included in output.
2015-06-14Change title message format (single line)Teddy Wing
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.
2015-06-14Stop output of empty messagesTeddy Wing
Don't write blank messages, only write messages with text.
2015-06-14Transform messages from HipChat & output to channelTeddy Wing
Use the `signal_continue` sub to continue sending the message with transformed text. Thanks so much to `Nei` on Freenode#irssi for recommending `signal_continue`! Decided to get all variables from the caller to be able to pass them on to `signal_continue`.
2015-06-14Construct start messageTeddy Wing
Make the start message to correspond to the test expectation. Grab the issue link first because that should tip us off that this is the text that will give us the starter data. Also chomp the newline from the test string to match the function result.
2015-06-14test.pl: Change status expected text to 'Status:'Teddy Wing
Make this 'Status:' instead of empty string. I might want to change this back later because the thought of seeing 'Status:' on a single line bothers me. But let's do this for now so this test passes and we can change it back if it looks terrible.
2015-06-14prettify_hipchat: Collapse extra whitespace between wordsTeddy Wing
Turn extra whitespace between words (including non-breaking spaces because _that's a thing_) into a single space.
2015-06-14test.sh: Ensure closing '}' is at the start of a lineTeddy Wing
Otherwise, any '}' inside the subroutine will get matched, and none of the rest of the sub will get outputted to our temporary prettify_hipchat.pl file, causing an error when trying to run our tests.
2015-06-14prettify_hipchat: Remove HTML tagsTeddy Wing
And add some comments to describe what we're matching.
2015-06-14prettify_hipchat: Also match non-breaking spacesTeddy Wing
Turns out the whitespace problem I was getting in d6f76b336715ca0fc9a11b2d2bd26500918a0e9f was due to the fact that HipChat sends non-breaking spaces in addition to regular spaces (WTF?!!!?!!!), so those weren't getting trimmed. Add non-breaking space characters to the regular expression so those get whacked by our substitution matcher also.
2015-06-14prettify_hipchat: Trim whitespaceTeddy Wing
Trim whitespace around the beginning and end of the text. Based on http://perlmaven.com/trim. There's some problem where some ending whitespace isn't getting trimmed from some of the strings. Still not sure what's going on here.
2015-06-14Get tests working to test `prettify_hipchat` subTeddy Wing
* test.sh: Create a temporary file `prettify_hipchat.pl` that contains only the `prettify_hipchat` subroutine. Then run `test.pl`. Finally remove the file we created to contain the subroutine. * Require `prettify_hipchat.pl` from test.pl. This file contains only the `prettify_hipchat` subroutine, allowing us to require it without concern.
2015-06-14Create test.shTeddy Wing
Add a shell script for running tests. This will be the main runner for our test cases (not test.pl). From here, we'll do the necessary setup, call test.pl, and finally to our cleanup. Decided to make a shell script for running tests because you can't directly include Perl subs from another file (i.e. including `prettify_hipchat` in test.pl). One option would have been to `require` the file, which also executes the entire file. This means that things that are not my sub also get executed which is not what I want, and the script will bork on the `use Irssi` line because we have no Irssi available when running our tests. Another option would have been to create a Perl module for my sub which could then be easily included in my test. The trouble with this approach is that I don't think I should be making my Irssi script into a module, and I think it could be bad practise and potentially a small performance hit if I were to include a custom module from my Irssi script. Not to mention having to needing 2 different files for a single plugin. What I'm going to do instead is grab the sub from hipchat-stfu.pl, send that to a new script, run test.pl (which will require that new script), and finally rm the newly-created script. Pretty hackish but it gets the job done with the least amount of disruption and extra formalities in the code. Found out about `pcregrep` after I searched for multi-line grep (turns out this is something grep can't do). Never knew pcregrep existed before. That's pretty cool. Here's the Stack Overflow post that I copied to grab the `prettify_hipchat` sub from hipchat-stfu.pl: http://stackoverflow.com/questions/2686147/how-to-find-patterns-across-multiple-lines-using-grep
2015-06-14Add a new `prettify_hipchat` stub subTeddy Wing
This is what I'll be using to actually convert the text into something decent. Stubbing it for now to give me something to include in my test script.
2015-06-13test.pl: Add some real test casesTeddy Wing
* Use `Test::More` instead of `Test::Simple` so I can take advantage of the `is` test function * Get rid of my dummy test tests * Add some tests based on HipChat output for what I'd like that output to be prettified to
2015-06-13Remove `Data::Dumper` importTeddy Wing
Not using it after 6cbc5ecddd2a52edfacb3754b74f35048095a3ad.
2015-06-13hipchat-data.txt: Use generic issue prefix and numberTeddy Wing
Rename the issue prefix to SC for "some company" and change the issue number to the one I used in the tag body. Forgot to change this when I was removing real company-specific details. Probably don't need to retroactively remove this from the repository as it's not a huge mistake and going back to do so would be kind of a pain.
2015-06-13Drop empty messages from HipChat/JIRATeddy Wing
Now that I know what's going on with those empty messages from 8746a69bbb79902b6be5fd205efbb5bfc83feed7, we can kill those messages before they ever reach my chat screen using the `signal_stop` subroutine.
2015-06-13Delete old log file output codeTeddy Wing
Since I was just using that to test the signal and see what kind of input I was getting, this is no longer needed. Now that I know what's going on we can write the actual code to do the work.
2015-06-13Checking for empty messages from HipChat (WIP)Teddy Wing
Some trial and error in selecting the blank empty messages coming from HipChat/JIRA. Had to do the output-to-file thing again, this time a new different one. Was trying to match against an empty string message but it turns out the empty messages that HipChat sends have a single space in them, aggh!
2015-06-13Rename main sub to `hipchat_stfu`Teddy Wing
`test` was just a temporary name to see if I could get the signal working and to see what kind of information irssi would give me. Let's use a more final name now that we know it works.
2015-06-13Dump server information to logTeddy Wing
Let's see what's in the `$server` hash and if it could be useful to us in our checks.
2015-06-13Fix test `message public` listenerTeddy Wing
Turns out I got the argument list wrong. The argument list I was using was for a `command_bind` (based on the tutorial mentioned in 0370866db92e1916af5ee98acf948adc3916d545). I wanted to make a signal listener for public messages. Looked up the documentation and figured out the correct arguments. Also fixed my log message printing to append to the file instead of overwriting it for every message received (previously I only got the last message posted in my log output).
2015-06-02Test listener for `message public` signalTeddy Wing
Following this tutorial: http://juerd.nl/site.plp/irssiscripttut Add a test sub that receives a public message signal so I can prove that it works and see what kind of data I'm getting back when my sub is called.
2015-05-31Add base irssi scriptTeddy Wing
New file containing the minimum defaults needed for an irssi script, copied from http://juerd.nl/site.plp/irssiscripttut. Sets up `$VERSION` & `%IRSSI` variables.
2015-05-31Add hipchat-data.txtTeddy Wing
The raw text output from Jira when a new issue is created. This is what we'll be listening for in our irssi plugin and silencing & filtering. I probably missed some empty lines commented by Jira. Hard to keep track when all the lines are the same and I have to scroll back in irssi with pretty much no context.
2015-05-31.gitignore: Ignore /privateTeddy Wing
Directory for things I don't want tracked in the public repository.
2015-05-31Initial commit. Learning about Perl testing.Teddy Wing
Created a basic test file using `Test::Simple` and this tutorial: http://search.cpan.org/dist/Test-Simple/lib/Test/Tutorial.pod