-
-
Save icantrap/507809 to your computer and use it in GitHub Desktop.
watchr script for non-Rails test::unit projects w/ growl support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
�PNG | |
��� | |
IHDR���@���@����iq���� pHYs����������IDATx�[�eE��O��ř7�!H�`�$+��*�%���J颈�KX]FKV��0n)ò�����$q��̼y9�xR��u��������{}:�����>�:�� l���ey���2ϑ�3;3��9�4wI�sPE�C�����)H%�����8�$QH�J�f��t�S+�J=���^���p�:�'2�=5��O٢ | |
��#����p������C�FM���k?I�u7ܾM��[%ܵ����]�H��Y�" >E�iTM���A(�KĕXi��l訟%�}���օt���|S���w�|�鿯?��������. �UqS���-��7��N��4"il�,��0��-��Q5�$�Ҩ�4�Z��J�n�#��HG�;=�Le�v�ZAu�*�C�E���Z��7;z���o||e�$�q\ʮ�@�6(�蠭x���_�t���ScI!"m�L�&'��f�WI��0��x�P,�W��0����e�zyF?X� | |
J)�.r,&83\��;G~��g����H | |
�{��&��a�k&)K3��_/˾�}�<��T{D��a5���������l L�0�%. �Ւ��C#$A��R��v�4䓟��W����J�P����-���?�~�o~��+���{�c�+���k*�E�3���I�cP | |
$}o?E��t����4jA��6c�OH��g^GH=E/.�y�N+�] | |
����Q�����������[�S�zE����g�`�:��X�L���H#��,=g�Kr�> j����Q�K�@bM��Sm�A�0��L�PFP\ϥ��?m��ߜ��J�Y�Ʀϯ]���EE4j���L.��t��7Li/��D��>�$���_�S��u�}C�\��\up�b7_�I�f@�Z�����#f������ƄnI��i����������X��;߆ZBA�F�H�-+�'���[���~�zH���3a�I�]y��+���=���NL�&�g��0���5]`t/`�b�l�=0�]LW�抩w�+����q|���[�.<o`�����D0�Đ�T | |
�0�6So��2�f�Σ�f!����祩�� | |
I�ǥ�}�^�vѾ��~�����e��`@s`D���'��r+a�;��p���v�M�8���I@g�Ԉ�k����` | |
$�r�yv���-ޒ�O+��� �Hf&E�3݇{`����nZ�|`vY�o�f�q0�h&��Q6ޥT��~��O\���?9��w��b���S���f�]J��#OSH�l�=@�.V�SҹI*�s��k`PRX����=`��sϏ4T�8�J}w�������b�J����+�_�&�/����F�!���2�f�a�ƅ��e8D��fyk�xv��8�$�%�EH�O�O�������wm���Y | |
H�%���]��ҟ̀�)U>�����?~��C:CG� | |
�Y�RHH;�:�\�:d��A3�4L�:��G���`��G�G���~�3�X�$^3��`}�������J2<��4( ���y�J�$lT�k�����U��ѱ�V�n�1DQ��Tu��k3mH��XI�io��75*[�S7��Z�H��r�K����d`��S��L��"��P�Ҳ�w2RH_66)�d��M_Yw�%�y�~M<'4�2� ����U̷� | |
��!D=��:����������s | |
4��:��L�6i �֊�ŕ�Z����@t7��2!H��0����s��~캫��q�}�YK� �,��H#�lcV����-��6H�'�����-��Y��W�G+L�g �&k�a:a�8j���-�ׄ��\Vx8��t�%PUjEQ��O^{�i��� �M��r��:5R�Nj6�^DL��b�r^V_t�����|�����>FS��e��x8�y��e%��u�͒�^�U�uH<� | |
�t�:Bj�Z�M��?�����2����2����̫3C:Z_�e���RCɲ��+�G���]Nۈ��<o�b�� �G:oʶ�i��Si�~I��'���h��Q>I�}Q�F"uB|�w>p�]��I��Mw>��Δ��aO�����8T\�\���^��>��S�xn.��yH�ShM@nw���e�5YJ�Bu�ͅ#^�����3���Q�ޭ�Ү�?qͧ��F'qq���4�|I�)M]g^#�G�-ۖ���в�}��R����x��F}d�leh�!5J>A^��.�(��>ȳ�;����xo�qط8jJ[(z�m��O�S�}⚳v>�voi<,�H�B"t]F`�h�ڔL�l�>mb������Z%��Oouc��c$5p�$�� | |
O@����Cq�8�G�O��}C-��!��wM��-��t٦[n.�mm+d�@��-�:�/B��9�B�xV-�C?w��S�j�#���P��8у�D�'g�G�3��� >��M��J�Rm�:uY�<��"SV� | |
�5��[7~�Ʒ�L����)1Ѐ��OL;�j˭<��}���r𧯖�5��Z�\N����t�w�{��@y 1��!��K�4�`�F(6ϔS��|n4𩢭��y�ϓ7�p�Ѓ`���Г�Lh1y�b�a^f�<������)��}?�a��`7r�`�ުp��Qn: 0C������$��[��y@��&0�(�y�̭w�~t�~Nc�"D】�0�='z6Ev��ݵ�$��mo��|�:X�P��8�� | |
-p�u��XAw�����y��`f��s֗��p�C*2G | |
�ǀ�*�d��]��ɧq!i�OJ�����6˄�*�'�R�` | |
_'R��ǽN���wa��>� L���$ | |
y��{�PEQA3�Pv���JXx�L��X�,l#��V?����<,� | |
���_�qP��-J0P�)�lBfؖɜ��ò1lOB%��(G�F���~@o��.h@��Q�ݵ|��l�@��`�����Յ �v>�rZ�=H>Nj5<+H�0��~�n����?n��1|�'��4c�nZt &�nw=k���C fv��}�����QLi�܂uu��M��8�0�7���@>ࣶ݆ | |
���)g/b�#���lÖ,I�C���~�.��:vT^\�T�����m���$����ɱ_�8�����D��H�h��%��oQ)� *��{�f���<�,��ff�3g#˾^���[�؈�k�5jd��6<&��<��f�:�#9���Tq�ӌ�u�V��OD���Z9�Kߔt�C2~�+����`�[�,�+������j���2�D�^�Fhh���H!�fٲ�c�%��i�r�;5�,���;�x | |
���T�:���[��Y�e2.��_���/K���w�7?|�e�nҌ���q)^����z��?M���dlգ�o�t�ɾ����l�rS,����i�T�m�^#*��w�l&p.\�ޣ�:��`�L�U�IA�)�h�sΖ#>�Y���7e�_��`��V�-du蠻\�V��C!kȜ�D�˖I���"�����Dk5��p��D3�RX"��\�A���S^�M��R��������>$�����en&yv&G�S.�� �@$@کA�p�Mlf̖B��j�� �%|5^�����@�0n��^�� | |
4��°/�t9��@nrM` | |
5��0��XV� | |
��t5ˀ�@��W,��?{��>��̥��?�1�fj`s�3h���k�:�Ix+��N�s�83�.�v�Ae��åHoq7�g��4�����,]��\p֙o�Io� ���*Ay���$'\�e��m���{�T��Ul��Q�r��@�)D,��F�4�%�*[fj��� �/��7`4��Ԑe��`ɲ�c@&�b�UW�t��� ��f����O^w�'��^"��ɺ�O�۶���[8բc�Vi�����mx�cu����g�&4��`�;[�H\S:tA�'���P��],���[ | |
��g�=���L�c%�S� < | |
�d�� �2VK����u�w�d�ѯ���K�p���'-n.�/)4������Y��������c�����ķ12���OK��2�4p_�F���ɻ���eR���kU�����z>0r̂�)ā�u���t�㏓/�\�?������D��҄-��k�c��]�W�1��c���P����"��L�hT�, | |
��Ϡ�l�2�ЙWz�!�W���#��Ua��4��ν�I�*ꙍf8!X(ȤX�����G�O>V:�<Y�'_l���������~c. | |
rx��:(b����y�F���]��M�2cI�%�M`ہ� | |
�\��[�e�9}q��V���HT�8�C����}��JN�� | |
Z�\��R}��_�H���w���o9�8���,u�aQjۏ����xeL�����y�����JK����@�D�Ն<iB,S5�Xq(�˝F�r`5=A�A� | |
�K�v2 | |
��\��������42{������=� | |
N�å�sPb�Q��~Ѐ��.�o��xI���ܭU���#�4�7FG��_�6Q.�<y���452�����@ڄE� | |
PȐ�ذnA0=��q�=�1\ | |
�,�l��s˳�-���#��(�q�|ܩ�SIi�����꺇��cO.������>|��!��h6�dr�߉� ��HBX?ܰ�n��D&�=Ѩ��@�5^\�M �:������%�"�wա���R�4?��#<ؼx���ʣ��@&P����6�]4��z�Mz 0Ub�7�Ł���A'���ګ���k | |
G�RҨT�Ad����}�!�GӦ�N��~�m3p�K�ȇ<��� | |
l��Z���i$��T�* \��^�F�3�B�я�F1|՟u��9lyV�6�(� | |
rFI�F`;�nFOO?m���$@3�dzם��_�_?�{�ĵ | |
��� �CXo�A�$aN=�y1���v��K�(1G�e[�r�u�I��\��j�-C;Wd?�F�W�ih( J߆O�m�ij����O �gi3 ��>�U�Ɓ#�����G����$�0��n���/q��ڛ��VƦ=\�a}�� | |
x�&jf͒K��2�jC;7�!��>M� �R����R�)ȂR�x�c9��K��l��aA�;��`�g��̀(���U�T���QZ��f�n��/�]�� | |
0��t���aU����0d���vN��0�'iQ"B�5��'���.(�W>��6��bŵ.��$�K�� ��j�`J�YaJ|��k>j@�����s�^|TM�R�\��0G��y�i|��F�{^G�-���@ | |
���ቭ��箆��2��0�)c'�Y��ûY�u�����`l��K���љ�̛�������ԝ�C��H�f�t�}��U��:S;�Um��.#�_cP�$V��i�3��) | |
q:7�XL���>�2�� | |
�N?���KDf���9¶8��y����)�����+%'��| | |
S\�(Lrc[G��V�z��-}���\>�c�ؒ�s�������p�ȞF�=2k_�b�S���@y��Þblg5��,`=����a˯�)ܔ,��q�MDzY�j%0~c;�k�[҅�M<����gFदf�>���7(t>9���h��|�쮞�H<��AE��<�p��3����h��p����c,�zl�U���b����t�U��Z����3�̥�h��q:[k$�5�②A�Y"t���ݶ�|��=`<?�GG���0��~LJVx� | |
GR�j�NL���P�j\���M����!z�"ᴌ�4��}�����A3}k�8hF����]bj�Y�d��s�V�&oR�[���{�<�3Fp�!��I���)3��ՉC[��3�{s�u|s��w��Y`�cJ��j�7��1�S��B��TG-�dx�3"3��eK65��! | |
W-�e�Px | |
��ҫ��d�#�L����m��%롅��z��,L��f�6��\yU�P wNOm$�D9��\،5Ȅvl��%e���a`V�\g0�ی&��)�W�}Pkۖ�tcmY�kK���c�.\���%�����i�fnb�/����C7n�{k��[+�NDX�#�3یs�&~���,�x{��`��1�-X��Zp�&��YgovYׇ�rX�SJ�eE2��偧M8��G�/�3�� �]���;�V��\�.m&����v�2�=4�`�>Qtg�8.C:z3�7��7a��)�D�)M�5����0�v���P�2�ZFD�߬}��i�����ȓ�;��W��'�a5硪�ߑ�w�]������f��� | |
;�&��X | |
��țN���ć�X���u8O8�*�O��Ӥ���vB�<&k�0l����G��Fթ�Tm�S�u}�,�:��/kg�� �;��GNX�X_�р��3۠�s�D�]��0F�0AoWL�M�5=)Փ��Ǹ�4��VPF8�0�Ԕ�O | |
���nD�=d��:͜�!*A�]��O��>���b�LS0��a;��g��� �C�c2��,~>����p�t�� | |
��u��]�7��.4��;���n��;���a���zܐg���� | |
�������T(�� | |
�S]���PI.z�9�;����~(Ĵ�rF�'>F���<0��T^,��<�kH�T�V0�bOy�W�S�a[y0�$�"���,�P��8@$`БmY�y���?X����O�2x���":L�� | |
��XVZ��q�+C4�.�R�@x�q]�k�|.�t�zo�T=b���3��z��a�d��Hw�����8��MJ`{����z�X��\�(K8fkڬl>Ycl �H�)S3��P����`�u�4�>STXn�M��Y�U?�J ����8�����g{�P3L�U�p��� ��y�.�Q`����-*N��Ɯ�k[Z���<��ח�|�#؎O��H#�A�FS^���Ous��,�!^>Ѐj� �8A�$��nW8"�(̀�I`3Bg����jV�|�O�Bd��;g�g�S;v�NN�%�-z������C��D��|�I��C<g��q�%M�蛉v��`���p>�[�N�S���='��(w��C7�Io"u"��䒼E���mvGA}͒%��{N5��N�=Hy������IEND�B`� |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
�PNG | |
��� | |
IHDR���@���@����iq����sRGB�������bKGD������������� pHYs����������tIME�d����IIDATx�͛y�\u��?��{�R��n�C01(e��U�,q�#��8�q�qWs8��2(�Ń�1�Ǡ�A�E@��M�Nw�;���կ�����U�Wkwb��Sկ�-�{����w����6�w.<��3�+2�&�d�ԛ��N^, | |
�YO | |
�m��@{@@Y{�(�V,�cp��x�p#{[][�U_�� �{c���-�_9�ޣmJ�@ͱ��*6�"xIoa��� )o�6A8 ����kEF+,į��Z����7`T�Y��>y=O��w<�w/ | |
v; �nXd�X���t�O\&Kz��z��v��wjoSd�m�+O�H��AU��{���{����7������Y���=��?��ֽ�ˏE��$��@�H��ip��[pqx���)d#�v�� �`F1����U�+@3�/��s��\�W ԡ���0�8�\�|��G|SV,pEx��1��m�_k�f��Q�Kv2��6��u��89�Hp�X�)�W������k�� | |
j{�|Hx�;>{�;�Ɵ|c`hͤ�3���t��]� | |
B�Ȁ�����e�j|��?{侂� 9mӉ���ct�^�J�XH LN�<�'�߲��h�M��_ɓ��n�}j | |
dg|C�H�!$�ܴ�ge���۸L|�c����#6�mzbKV����xt��W��A�H�� ��7��5�l]:w��y�%��%[�F{�yl��"q�zw����O��K/�?��=���R�}�CD���I0��k{��8y5�=�����l��pD:V-!�� | |
)��`PK\�WE��|����C��]�'3/k;��M�@�oR�`!9�/ w.���EW�K���}�f | |
�\J�im��}�@���R��,XX�B�3�a7"�������Qvൽ������8��K�_��'��'}�,^��[n���H�7�t�̃H+�����0�|�<����{D�f�e���N~��ߝ����z�|�kֿ��>��x\?dM1��s�7\?yV5t�:��B���*�2c�T�B���x��~}Sb��SГL�ITH�:�E�"{ˏ���Y�O���xR?����UW�p�WK�` | |
�&���-!��X�o���ܒ�#O��Q~���gCv��:�ao{��@�"<@n�T����+�|��U�{i�Y�l �^�%ԤX��^�yf� �J��N�;Q���`Q���/3�m�L������X�Y���/�|���UX��P���0�m֦�'�81�ȳ��]Ĝ���LO{5��7RG٣�,�:۸��3��z��66�ҝ�]8}g"|+!� ���V@�9{�0�\&��pG8���Q�:h8_��c1�=�}(�ZD{N�����跾��鵚��(�Pٰ��yp�� �uP���k�L #rn(F� \TD�5�bdV�\�.��;����ܽj�&̥<h��=�-q'w�U����7� 1Y(�L��t�a(D�k�&B��e����\q�S_�X���(P+m���[�2�G���g�N��]��K�N{IV�=PNjL�x)�t��^��K�슋�ʶ���Ľ'�T���o�6��|��v�7���Y�?�)���(��^���� | |
�ɱ��I�ȑA2���-us����;>����I�N�s����+xDžo�XN��r�md�.��U | |
��k �W | |
����T"�aц��>�����N��`6�n��m�W�|��#O�:j��.~���u"��V���2 | |
?��L���aT�^����z��7p�/�<�Ye� UQ1w�+1j�尺�Qz�c�ݺtYe`G�n�U��&Ԇ���2e!!0�TGea��G��V0�M|�`�C5-����}�7�f��� �~v����n /$9a�!LaF�P��{ozg���Y��e.����q3�>�MHF5p6����뾰�/pc�ɐ�,��W�)nm�F�[�[�q��u�������� | |
k����M����%hz>?�|<F��nv0ń8G��_{8 | |
��:wܟ�F�z�H�8��.�]Wٿ�� }��E%Ɋ�qC�*A�Bx�g3%����F�b`�#?c,��6� | |
U��h+G�,@ᘵY���?���k�����@Ah�r��L�w�Ôt���W��Q�_t | |
�e ��u��5�3�1Ѫ_@ RP�S��6�>j�Km� Y����4���d���7���&f�X�N�'� | |
y5��l����<���<�g&�Z�#��#�"�*9�� ks�� �ځ�J�����Yͭ(��B��B�R(L�W�r�ZH�:ٺ����0<�m���q��]z�wm��s��f��P�ë��e{KP%�w.����$�p��%����e�ʱ������A��'��*� | |
v�P�¥|�V1z��d_��ʺ�gM��+fq�&��Q������[��#�k,����W�<#z�#�ZM�BւX�0�\g��L�� s�F��ٝte� �j��P����xߵp��(������d͠Ec#F�X@���_�j�J�;_������H�Tcb�̲h�:dI���j �"� ��X�շ���~d���U�^H2����d^��[XEC�� ���Ԁ-�=�+�VW�Jw��x;��%��u���'>�)ޫ?�̬ۜ� | |
]M���ɖ��d��&~�Vx!#�5[���dJ�E�C�Dv_��j"��z4�Cd�4��IX��aL�^���# r�o�9[�� | |
�ۚ}�s�-�W@�B�L�-K��`.���d>~�D�Q���T�����B8�[+ٸt�������W[��.aE����^��F��Zt�(0a�W�\��&da߲�4WM*�w��dzW�-����s>��\��c�[�k~֦i"P�Vh��CB�I��"��^L�?ᶼ�;�'�� ��ڱ�0�d|��T\�W@FAf��b��ԯ�Q�����k��2����� | |
�H&��vf/dcf*��Z@�C�� D@Hh\���D����1�-��+K�*����|���S�k�#�H�Z�o����/Km��)���k2���̈́�p�H�H | |
�uQs�|v���N ֭X�F\+�t��x���ǐy���pĉ���J�!�=��P�&V� ݲ��/��I7&������Lw��$,�L� | |
k�3H�� oC��`��"���;�����"qoa�����m����Q����[�$WV�g��M[*T�;���o���@a�ÌV���F2WȺe칹�D�/1�J�M-I�1 | |
��i��J�R�=<|��J��9�"g�ES | |
�� | |
'StD��uqzK������G�_��r���,m��, �#��,,�I��cVK�q����l�}j�y2S#8Q:���r�����p�t�\ILe]\\ʸ�[��k���q�CH��H$�o�wJ{��P��T��:��Pd�̯�s����(�Ck����!fD�)(E��HPE | |
���U�;�Eu�2��3���>em�iW�c�f<���l�d�r��� ����+L�!f��.h$�YI� �ʊ�G���=��`7��Y�-<k�YѶ�a��U�������v�w���0�Ev�j�q�XF����p-,J�įZ�D | |
�=�obXQ�Vv | |
�e�+$�l�DL�>Mf�Yw��xm�,f�p � | |
���� ݾ��:T��=�U�ڭ#n})�[���d>D�Q5���&��8�K[��|��㼿�(��_{��ܣ]�P��E���&��}�}����_s��濎~��.|%W�jB�&S�a(z�MA���X)���cǍ)ه���`B��\UD��ҪS�9H�l��Ps | |
���+a�C�#�Vd��d҄�l,�9\���(X*V{��"� | |
F��Hzf�`��Qj� �l�쩒���%�V����X �|��k��z��n��Ϯ�XhQ?R[��f�cJf�Fʚ�*"�m�B25MJ�ڦ� | |
q��8��J o�Hk��U�i�AB2#r)�����|���d�*'d��;iՎR�I��*���O֘}J��F�v�v�Ja�ZL�tZk�,mZ�IF1dJX���D@�&�@r�_R�6]D��Lp����*/�a��T�֔e��& ����ӀL8�[JTv<�Y���U1.L��j�aš�Ji�J�E6��V�YQS&�,�^կbW�̄Ei��dNH�t����T_�b�K1ƴ��}f%�z�V��J��h�*h6�������-���W���jD��Y�MH�5]�|V�A��X�I�5f��>���kЬ���^�@��C���.�f�6����}�1!Y�,�H���<UB���CY{X(�lqU��ԓ%�9�r�f�^�]��:Kx | |
tGuS�@d�4�Ze��t�FV�Z�FN;8U(���x �oƉ�����)0�u<`5���%�g���S�ζ*�V�0����yBH��CM��d\�|=�I�@2!:�G!*�n��W�`��J�_�]� jUj7n�����賚]����������2bP�H`.���A���x2��9g&���$4 �@ EVdq��s���gg�A�i��a��T���EZYB����c�����\���?}��|]X\���uB�p��.����"�rZ���l��j=|��HG+! ��ĉ} | |
ɸ��h�m�S�d%��h��pQ�3˙|�{��O������A8%5Y����2){�F�E�����H�bd��Wh���>O��1��)L�!�y�r���8.1���x��҄�!/����]{.,L���Ȳ���Bk�L�h�b������䅸����������c��� ���SjN8����IEND�B`� |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV["WATCHR"] = "1" | |
system "clear" | |
BORDER = "\n=========================================================\n" | |
def growl(message) | |
growlnotify = `which growlnotify`.chomp | |
title = "Watchr Test Results" | |
image = message.include?('0 failures, 0 errors') ? "~/.watchr/images/passed.png" : "~/.watchr/images/failed.png" | |
options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'" | |
system %(#{growlnotify} #{options} &) | |
end | |
def run(cmd) | |
puts(cmd) | |
`#{cmd}` | |
end | |
def run_test_file(file) | |
result = run(%Q(ruby -I"lib:test" #{file})) | |
growl result.split("\n").last rescue nil | |
puts result | |
puts BORDER | |
end | |
def run_associated_test_file(file) | |
test_file = "test/" + file.sub("\.rb", "_test.rb") | |
if File.exist?(test_file) | |
run_test_file test_file | |
else | |
run_suite | |
end | |
puts BORDER | |
end | |
def run_all_tests | |
result = run "rake test" | |
growl result.split("\n").last rescue nil | |
puts result | |
end | |
def run_suite | |
system "clear" | |
run_all_tests | |
end | |
watch('test/test_helper\.rb') { run_suite } | |
watch('test\/.*_test\.rb') { |md| run_test_file(md[0]) } | |
watch('lib\/(.*\.rb)') { |md| run_associated_test_file(md[1]) } | |
run_suite | |
# Ctrl-\ | |
Signal.trap 'QUIT' do | |
puts " --- Running all tests ---\n\n" | |
run_suite | |
end | |
# Ctrl-C | |
Signal.trap 'INT' do | |
if @interrupted then | |
abort("\n") | |
else | |
puts "Interrupt a second time to quit" | |
@interrupted = true | |
Kernel.sleep 1.5 | |
# raise Interrupt, nil # let the run loop catch it | |
run_suite | |
@interrupted = false | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment