| Age | Commit message (Collapse) | Author |
|
Accidentally copied the wrong text without realising it. Change the
transformed text in the example to correctly illustrate what should
happen.
|
|
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
|
|
Now that this information is captured in the README, including it in its
own file is no longer necessary.
|
|
Include:
* A description of the plugin
* Requirements
* Installation instructions
* A note on testing
* License information
|
|
|
|
These single lines are irrelevant and don't need to be included in
output.
|
|
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.
|
|
Don't write blank messages, only write messages with text.
|
|
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`.
|
|
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.
|
|
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.
|
|
Turn extra whitespace between words (including non-breaking spaces
because _that's a thing_) into a single space.
|
|
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.
|
|
And add some comments to describe what we're matching.
|
|
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.
|
|
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.
|
|
* 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.
|
|
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
|
|
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.
|
|
* 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
|
|
Not using it after 6cbc5ecddd2a52edfacb3754b74f35048095a3ad.
|
|
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.
|
|
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.
|
|
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.
|
|
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!
|
|
`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.
|
|
Let's see what's in the `$server` hash and if it could be useful to us
in our checks.
|
|
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).
|
|
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.
|
|
New file containing the minimum defaults needed for an irssi script,
copied from http://juerd.nl/site.plp/irssiscripttut.
Sets up `$VERSION` & `%IRSSI` variables.
|
|
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.
|
|
Directory for things I don't want tracked in the public repository.
|
|
Created a basic test file using `Test::Simple` and this tutorial:
http://search.cpan.org/dist/Test-Simple/lib/Test/Tutorial.pod
|