watchman 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/watchman/call.rb +27 -6
- data/lib/watchman/version.rb +1 -1
- data/spec/support/istatus_mocker.rb +374 -0
- data/spec/watchman/call_watcher_spec.rb +49 -1
- metadata +4 -4
data/lib/watchman/call.rb
CHANGED
@@ -34,8 +34,13 @@ module Watchman
|
|
34
34
|
"O"=>"Omega"}
|
35
35
|
|
36
36
|
def response_level
|
37
|
-
|
38
|
-
|
37
|
+
code = nature_cell_text.split("-").first
|
38
|
+
if code == "IA"
|
39
|
+
return "Bravo"
|
40
|
+
else
|
41
|
+
match = code.scan(/^\d+([A-O])/).first.first
|
42
|
+
ResponseLevelMap[match]
|
43
|
+
end
|
39
44
|
end
|
40
45
|
|
41
46
|
def apparatus
|
@@ -71,11 +76,19 @@ module Watchman
|
|
71
76
|
end
|
72
77
|
|
73
78
|
def cross_street_1
|
74
|
-
xpath_text("#{main_table_path}/tr[7]/
|
79
|
+
if xpath_text("#{main_table_path}/tr[7]/th") == "Cross1"
|
80
|
+
xpath_text("#{main_table_path}/tr[7]/td")
|
81
|
+
elsif xpath_text("#{main_table_path}/tr[8]/th") == "Cross1"
|
82
|
+
xpath_text("#{main_table_path}/tr[8]/td")
|
83
|
+
end
|
75
84
|
end
|
76
85
|
|
77
86
|
def cross_street_2
|
78
|
-
xpath_text("#{main_table_path}/tr[8]/
|
87
|
+
if xpath_text("#{main_table_path}/tr[8]/th") == "Cross2"
|
88
|
+
xpath_text("#{main_table_path}/tr[8]/td")
|
89
|
+
elsif xpath_text("#{main_table_path}/tr[9]/th") == "Cross2"
|
90
|
+
xpath_text("#{main_table_path}/tr[9]/td")
|
91
|
+
end
|
79
92
|
end
|
80
93
|
|
81
94
|
def priority
|
@@ -95,7 +108,11 @@ module Watchman
|
|
95
108
|
end
|
96
109
|
|
97
110
|
def time_of_alarm
|
98
|
-
|
111
|
+
if xpath_text("#{main_table_path}/tr[16]/th") == "Inc Date/Time"
|
112
|
+
Time.parse(xpath_text("#{main_table_path}/tr[16]/td"))
|
113
|
+
elsif xpath_text("#{main_table_path}/tr[18]/th") == "Date Recd"
|
114
|
+
Time.parse(xpath_text("#{main_table_path}/tr[18]/td"))
|
115
|
+
end
|
99
116
|
end
|
100
117
|
|
101
118
|
def time_of_first_unit_on_scene
|
@@ -103,7 +120,11 @@ module Watchman
|
|
103
120
|
end
|
104
121
|
private
|
105
122
|
def nature_cell_text
|
106
|
-
xpath_text("#{main_table_path}/tr[3]/
|
123
|
+
if xpath_text("#{main_table_path}/tr[3]/th") == "Nature"
|
124
|
+
xpath_text("#{main_table_path}/tr[3]/td")
|
125
|
+
elsif xpath_text("#{main_table_path}/tr[4]/th") == "Nature"
|
126
|
+
xpath_text("#{main_table_path}/tr[4]/td")
|
127
|
+
end
|
107
128
|
end
|
108
129
|
|
109
130
|
def main_table_path
|
data/lib/watchman/version.rb
CHANGED
@@ -17,6 +17,13 @@ class IstatusMocker
|
|
17
17
|
:body => MEDIC_PAGE_HTML)
|
18
18
|
end
|
19
19
|
|
20
|
+
def fake_active_call_path(host,incident_number)
|
21
|
+
fake_login(host)
|
22
|
+
FakeWeb.register_uri(:get,"https://#{host}/DisplayCall.php?Incid=#{incident_number}",
|
23
|
+
'content-type'=>"text/html",
|
24
|
+
:body => ACTIVE_CALL_HTML)
|
25
|
+
end
|
26
|
+
|
20
27
|
def fake_call_path(host,incident_number)
|
21
28
|
fake_login(host)
|
22
29
|
FakeWeb.register_uri(:get,"https://#{host}/DisplayCall.php?Incid=#{incident_number}",
|
@@ -785,4 +792,371 @@ class IstatusMocker
|
|
785
792
|
</HTML>
|
786
793
|
<script language="javascript" src="JSFuncs.js"></script>
|
787
794
|
}
|
795
|
+
|
796
|
+
ACTIVE_CALL_HTML = %Q{
|
797
|
+
|
798
|
+
<HTML>
|
799
|
+
<HEAD>
|
800
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
801
|
+
<!--<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">-->
|
802
|
+
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
|
803
|
+
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
|
804
|
+
<META HTTP-EQUIV="EXPIRES" CONTENT="0">
|
805
|
+
<TITLE>EnRoute I-STATUS - Version 5.10</TITLE>
|
806
|
+
<LINK REL="stylesheet" HREF="DisplayFormat.css" TYPE="text/css">
|
807
|
+
<script language="javascript">
|
808
|
+
//bring the page to foreground
|
809
|
+
this.focus();
|
810
|
+
</script>
|
811
|
+
</HEAD>
|
812
|
+
<BODY CLASS="Detail" j=l>
|
813
|
+
<H3 class="Status">Active Incident: 201024340</H3><table cellpadding="0" cellspacing="0" width="100%"><tr width="100%"><td valign="top" width="50%"><table cellpadding="0" cellspacing="0" width="100%"><tr><th class="Detail" align="left" width=$cw>Location</th><td class="Detail" align="left" colspan="3"><a href="SearchDStatsSubmit.php?Address=HIGHWAY WW E-BC/RANGELINE RD S-BC">HIGHWAY WW E-BC/RANGELINE RD S-BC</a></td></tr><tr><TH CLASS='Detail' align=left width=100px>
|
814
|
+
Building</TH>
|
815
|
+
<TD CLASS='Detail' COLSPAN=3>
|
816
|
+
</TD>
|
817
|
+
</tr><tr><th class="Detail" align="left" width=$cw>Nature</th><TD CLASS='Detail' COLSPAN=3>
|
818
|
+
IA-INJURY ACCIDENT </TD>
|
819
|
+
</tr><tr><TH CLASS='Detail' align=left width=100px>
|
820
|
+
Priority</TH>
|
821
|
+
<TD CLASS='Detail' width=110px>
|
822
|
+
1</TD>
|
823
|
+
<TH CLASS='Detail' align=left width=100px>
|
824
|
+
Dispatch Code</TH>
|
825
|
+
<TD CLASS='Detail' >
|
826
|
+
IA </TD>
|
827
|
+
</tr><tr><TH CLASS='Detail' align=left>
|
828
|
+
Grid</TH>
|
829
|
+
<TD CLASS='Detail' width=110px>
|
830
|
+
30194B </TD>
|
831
|
+
<TH CLASS='Detail' align=left width=100px>
|
832
|
+
Tac</TH>
|
833
|
+
<TD CLASS='Detail' >
|
834
|
+
BF1 </TD>
|
835
|
+
</tr><tr><TH CLASS='Detail' align=left>
|
836
|
+
Fire Area</TH>
|
837
|
+
<td class="Detail" COLSPAN="3">12-15C</td></tr><tr><TH CLASS='Detail' align=left>
|
838
|
+
Plan</TH>
|
839
|
+
<TD CLASS='Detail' width=110px>
|
840
|
+
</TD>
|
841
|
+
<TH CLASS='Detail' align=left width=100px>
|
842
|
+
Map</TH>
|
843
|
+
<TD CLASS='Detail' >
|
844
|
+
</TD>
|
845
|
+
</tr><tr><TH CLASS='Detail' align=left>
|
846
|
+
Cross1</TH>
|
847
|
+
<td class="Detail" COLSPAN="3">RANGELINE RD S</td></tr><tr><TH CLASS='Detail' align=left>
|
848
|
+
Cross2</TH>
|
849
|
+
<td class="Detail" COLSPAN="3">BLACKTHORNE LN S</td></tr><tr><th class="Detail" align="left">Hyd1</th><td class="Detail" width=$dw> </td><th class="Detail" align="left" width=$cw>Hyd2</th><td class="Detail"> </td></tr><tr><th class="Detail" align="left" width=$cw>Cautions</th><td class="Detail" colspan="3">HSD HSD:At Columbia/Boone County Line - eastern continuation of Broadway-E</td></tr><tr><td colspan="4"><hr color=navy></td></tr><tr><TH CLASS='Detail' align=left width=100px>
|
850
|
+
Complainant</TH>
|
851
|
+
<TD CLASS='Detail' colspan=3>
|
852
|
+
AMBER FOSTER</TD>
|
853
|
+
</tr><tr><TH CLASS='Detail' align=left width=100px>
|
854
|
+
Phone</TH>
|
855
|
+
<TD CLASS='Detail' colspan=3>
|
856
|
+
2204066 </TD>
|
857
|
+
</tr><tr><th class="Detail" align="left" width=$cw>Dispatcher</th><td class="Detail" width=$dw>ALL </td><th class="Detail" align="left" width=$cw>CallTaker</th><td class="Detail">JSH </td></tr><tr><TH CLASS='Detail' align=left width=100px>
|
858
|
+
DispO</TH>
|
859
|
+
<TD CLASS='Detail' >
|
860
|
+
ND </TD>
|
861
|
+
<TH CLASS='Detail' align=left width=100px>
|
862
|
+
Meth. Alarm</TH>
|
863
|
+
<TD CLASS='Detail' >
|
864
|
+
1 </TD>
|
865
|
+
</tr><tr><td colspan="4"><hr color=navy></td></tr><tr><TH CLASS='Detail' align=left width=100px>
|
866
|
+
Date Recd</TH>
|
867
|
+
<TD CLASS='Detail' colspan=3>
|
868
|
+
12/29/2010 14:54:53</TD>
|
869
|
+
</tr><tr><TH CLASS='Detail' align=left width=100px>
|
870
|
+
On Scene</TH>
|
871
|
+
<TD CLASS='Detail' colspan=3>
|
872
|
+
12/29/2010 15:04:18</TD>
|
873
|
+
</tr><tr><TH CLASS='Detail' align=left width=100px>
|
874
|
+
Upgrade</TH>
|
875
|
+
<TD CLASS='Detail' colspan=3>
|
876
|
+
00:00:00</TD>
|
877
|
+
</tr><tr><TH CLASS='Detail' align=left width=100px>
|
878
|
+
Pat Contact</TH>
|
879
|
+
<TD CLASS='Detail' colspan=3>
|
880
|
+
00:00:00</TD>
|
881
|
+
</tr></TR>
|
882
|
+
</table></td><td valign="top" align="center" width="50%"><table border="1" bordercolor="#76a5b6" cellpadding="0" cellspacing="0" width="90%"><TR >
|
883
|
+
<TH CLASS='Detail' align=left>
|
884
|
+
Apparatus</TH>
|
885
|
+
<TH CLASS='Detail' align="center">
|
886
|
+
DSP</TH>
|
887
|
+
<TH CLASS='Detail' align="center">
|
888
|
+
ENR</TH>
|
889
|
+
<TH CLASS='Detail' align="center">
|
890
|
+
ONS</TH>
|
891
|
+
<TH CLASS='Detail' align="center">
|
892
|
+
Tran</TH>
|
893
|
+
<TH CLASS='Detail' align="center">
|
894
|
+
OSH</TH>
|
895
|
+
<TH CLASS='Detail' align="center">
|
896
|
+
AVL</TH>
|
897
|
+
</TR>
|
898
|
+
<TR >
|
899
|
+
<TD CLASS='AOS' >
|
900
|
+
E1201 </TD>
|
901
|
+
<TD CLASS='Detail' align="center">
|
902
|
+
14:55:00</TD>
|
903
|
+
<TD CLASS='Detail' align="center">
|
904
|
+
14:56:59</TD>
|
905
|
+
<TD CLASS='Detail' align="center">
|
906
|
+
15:01:54</TD>
|
907
|
+
<TD CLASS='Detail' align="center">
|
908
|
+
00:00:00</TD>
|
909
|
+
<TD CLASS='Detail' align="center">
|
910
|
+
00:00:00</TD>
|
911
|
+
<TD CLASS='Detail' align="center">
|
912
|
+
15:28:41</TD>
|
913
|
+
</TR>
|
914
|
+
<TR >
|
915
|
+
<TD CLASS='AOS' >
|
916
|
+
E1501 </TD>
|
917
|
+
<TD CLASS='Detail' align="center">
|
918
|
+
14:55:00</TD>
|
919
|
+
<TD CLASS='Detail' align="center">
|
920
|
+
14:58:23</TD>
|
921
|
+
<TD CLASS='Detail' align="center">
|
922
|
+
15:07:18</TD>
|
923
|
+
<TD CLASS='Detail' align="center">
|
924
|
+
00:00:00</TD>
|
925
|
+
<TD CLASS='Detail' align="center">
|
926
|
+
00:00:00</TD>
|
927
|
+
<TD CLASS='Detail' align="center">
|
928
|
+
15:28:28</TD>
|
929
|
+
</TR>
|
930
|
+
<TR >
|
931
|
+
<TD CLASS='ENH' >
|
932
|
+
M111 </TD>
|
933
|
+
<TD CLASS='Detail' align="center">
|
934
|
+
14:55:00</TD>
|
935
|
+
<TD CLASS='Detail' align="center">
|
936
|
+
14:56:53</TD>
|
937
|
+
<TD CLASS='Detail' align="center">
|
938
|
+
15:07:51</TD>
|
939
|
+
<TD CLASS='Detail' align="center">
|
940
|
+
15:14:00</TD>
|
941
|
+
<TD CLASS='Detail' align="center">
|
942
|
+
00:00:00</TD>
|
943
|
+
<TD CLASS='Detail' align="center">
|
944
|
+
00:00:00</TD>
|
945
|
+
</TR>
|
946
|
+
<TR >
|
947
|
+
<TD CLASS='AVL' >
|
948
|
+
DIV61 </TD>
|
949
|
+
<TD CLASS='Detail' align="center">
|
950
|
+
14:57:14</TD>
|
951
|
+
<TD CLASS='Detail' align="center">
|
952
|
+
14:57:14</TD>
|
953
|
+
<TD CLASS='Detail' align="center">
|
954
|
+
15:07:58</TD>
|
955
|
+
<TD CLASS='Detail' align="center">
|
956
|
+
00:00:00</TD>
|
957
|
+
<TD CLASS='Detail' align="center">
|
958
|
+
00:00:00</TD>
|
959
|
+
<TD CLASS='Detail' align="center">
|
960
|
+
15:29:38</TD>
|
961
|
+
</TR>
|
962
|
+
<TR >
|
963
|
+
<TD CLASS='AVL' >
|
964
|
+
EMS22 </TD>
|
965
|
+
<TD CLASS='Detail' align="center">
|
966
|
+
14:57:36</TD>
|
967
|
+
<TD CLASS='Detail' align="center">
|
968
|
+
14:57:46</TD>
|
969
|
+
<TD CLASS='Detail' align="center">
|
970
|
+
15:05:29</TD>
|
971
|
+
<TD CLASS='Detail' align="center">
|
972
|
+
00:00:00</TD>
|
973
|
+
<TD CLASS='Detail' align="center">
|
974
|
+
00:00:00</TD>
|
975
|
+
<TD CLASS='Detail' align="center">
|
976
|
+
15:24:24</TD>
|
977
|
+
</TR>
|
978
|
+
<TR >
|
979
|
+
<TD CLASS='AVL' >
|
980
|
+
C1218 </TD>
|
981
|
+
<TD CLASS='Detail' align="center">
|
982
|
+
14:57:58</TD>
|
983
|
+
<TD CLASS='Detail' align="center">
|
984
|
+
14:58:09</TD>
|
985
|
+
<TD CLASS='Detail' align="center">
|
986
|
+
15:04:18</TD>
|
987
|
+
<TD CLASS='Detail' align="center">
|
988
|
+
00:00:00</TD>
|
989
|
+
<TD CLASS='Detail' align="center">
|
990
|
+
00:00:00</TD>
|
991
|
+
<TD CLASS='Detail' align="center">
|
992
|
+
15:29:36</TD>
|
993
|
+
</TR>
|
994
|
+
</table></td></tr><tr><td colspan="4"><hr color=navy></td></tr><tr><table cellpadding="1" cellspacing="0" width="100%"><tr><th class="Detail" align="left" width=$cw>Notes</th><td class="Detail" colspan=3"><table cellpadding="1" cellspacing="0" width="100%"><TR >
|
995
|
+
<td class="Notes" valign="top">14:49:45</td><TD CLASS='Notes' >
|
996
|
+
*CITY: BC-BOONE COUNTY </TD>
|
997
|
+
</TR>
|
998
|
+
<TR >
|
999
|
+
<td class="Notes" valign="top">14:50:14</td><TD CLASS='Notes' >
|
1000
|
+
NON INJURY (00000155-140)</TD>
|
1001
|
+
</TR>
|
1002
|
+
<TR >
|
1003
|
+
<td class="Notes" valign="top">14:50:43</td><TD CLASS='Notes' >
|
1004
|
+
BROWN RANGERS VS SILV EXPLORER (00000155-140)</TD>
|
1005
|
+
</TR>
|
1006
|
+
<TR >
|
1007
|
+
<td class="Notes" valign="top">14:50:47</td><TD CLASS='Notes' >
|
1008
|
+
BLOCKING TRAFFIC (00000155-140)</TD>
|
1009
|
+
</TR>
|
1010
|
+
<TR >
|
1011
|
+
<td class="Notes" valign="top">14:52:07</td><TD CLASS='Notes' >
|
1012
|
+
P.D. Response area is 114 (00000155-140)</TD>
|
1013
|
+
</TR>
|
1014
|
+
<TR >
|
1015
|
+
<td class="Notes" valign="top">14:52:44</td><TD CLASS='Notes' >
|
1016
|
+
COMP NOT INVOLVED (00000155-140)</TD>
|
1017
|
+
</TR>
|
1018
|
+
<TR >
|
1019
|
+
<td class="Notes" valign="top">14:53:27</td><TD CLASS='Notes' >
|
1020
|
+
NOW CALLING BACK ADVISING POSSIB (00000155-140)</TD>
|
1021
|
+
</TR>
|
1022
|
+
<TR >
|
1023
|
+
<td class="Notes" valign="top">14:53:27</td><TD CLASS='Notes' >
|
1024
|
+
INJURY (00000155-140)</TD>
|
1025
|
+
</TR>
|
1026
|
+
<TR >
|
1027
|
+
<td class="Notes" valign="top">14:53:43</td><TD CLASS='Notes' >
|
1028
|
+
REQ FOR A MEDIC (00000155-140)</TD>
|
1029
|
+
</TR>
|
1030
|
+
<TR >
|
1031
|
+
<td class="Notes" valign="top">14:53:48</td><TD CLASS='Notes' >
|
1032
|
+
!*** Nature changed from A ACCIDENT (00000155-140)</TD>
|
1033
|
+
</TR>
|
1034
|
+
<TR >
|
1035
|
+
<td class="Notes" valign="top">14:53:49</td><TD CLASS='Notes' >
|
1036
|
+
!*** (00000155-140)</TD>
|
1037
|
+
</TR>
|
1038
|
+
<TR >
|
1039
|
+
<td class="Notes" valign="top">14:53:49</td><TD CLASS='Notes' >
|
1040
|
+
Priority changed from 3 to 1 (00000155-140)</TD>
|
1041
|
+
</TR>
|
1042
|
+
<TR >
|
1043
|
+
<td class="Notes" valign="top">14:53:58</td><TD CLASS='Notes' >
|
1044
|
+
51 YOA M, CONSCIOUS/BREATHING (00000155-140)</TD>
|
1045
|
+
</TR>
|
1046
|
+
<TR >
|
1047
|
+
<td class="Notes" valign="top">14:54:10</td><TD CLASS='Notes' >
|
1048
|
+
HAS CHEST INJURY DUE TO ACCIDENT (00000155-140)</TD>
|
1049
|
+
</TR>
|
1050
|
+
<TR >
|
1051
|
+
<td class="Notes" valign="top">14:54:53</td><TD CLASS='Notes' >
|
1052
|
+
SHIPPED FROM POLICE DISPATCH, INCIDENT NUMBER 2010257111 (00000155-140)</TD>
|
1053
|
+
</TR>
|
1054
|
+
<TR >
|
1055
|
+
<td class="Notes" valign="top">14:54:53</td><TD CLASS='Notes' >
|
1056
|
+
PD INCIDENT 2010257111 SHIPPED TO FIRE [00000155-140]</TD>
|
1057
|
+
</TR>
|
1058
|
+
<TR >
|
1059
|
+
<td class="Notes" valign="top">14:54:53</td><TD CLASS='Notes' >
|
1060
|
+
WITH NATURE IA-INJURY ACCIDENT [00000155-140]</TD>
|
1061
|
+
</TR>
|
1062
|
+
<TR >
|
1063
|
+
<td class="Notes" valign="top">14:55:00</td><TD CLASS='Notes' >
|
1064
|
+
Fire service incident 201024340 (00000194-160)</TD>
|
1065
|
+
</TR>
|
1066
|
+
<TR >
|
1067
|
+
<td class="Notes" valign="top">14:55:15</td><TD CLASS='Notes' >
|
1068
|
+
TAC CHANNEL BF1 ASSIGNED (00000194-160)</TD>
|
1069
|
+
</TR>
|
1070
|
+
<TR >
|
1071
|
+
<td class="Notes" valign="top">14:55:36</td><TD CLASS='Notes' >
|
1072
|
+
STATE AWARE [00000155-140]</TD>
|
1073
|
+
</TR>
|
1074
|
+
<TR >
|
1075
|
+
<td class="Notes" valign="top">14:56:54</td><TD CLASS='Notes' >
|
1076
|
+
Unit M111 Pressed Enroute</TD>
|
1077
|
+
</TR>
|
1078
|
+
<TR >
|
1079
|
+
<td class="Notes" valign="top">14:57:14</td><TD CLASS='Notes' >
|
1080
|
+
Truck DIV61 specialed themselves on the call</TD>
|
1081
|
+
</TR>
|
1082
|
+
<TR >
|
1083
|
+
<td class="Notes" valign="top">14:57:14</td><TD CLASS='Notes' >
|
1084
|
+
Unit DIV61 Pressed Enroute</TD>
|
1085
|
+
</TR>
|
1086
|
+
<TR >
|
1087
|
+
<td class="Notes" valign="top">14:59:23</td><TD CLASS='Notes' >
|
1088
|
+
*Police incident 2010257111 closed [00000095-130]</TD>
|
1089
|
+
</TR>
|
1090
|
+
<TR >
|
1091
|
+
<td class="Notes" valign="top">15:01:54</td><TD CLASS='Notes' >
|
1092
|
+
E1201 went in command 15:01:54 (00000192-100)</TD>
|
1093
|
+
</TR>
|
1094
|
+
<TR >
|
1095
|
+
<td class="Notes" valign="top">15:02:03</td><TD CLASS='Notes' >
|
1096
|
+
*WW CMD (00000192-100)</TD>
|
1097
|
+
</TR>
|
1098
|
+
<TR >
|
1099
|
+
<td class="Notes" valign="top">15:02:15</td><TD CLASS='Notes' >
|
1100
|
+
2 VEHICLES UPRIGHT BLOCKING THE ROAD (00000192-100)</TD>
|
1101
|
+
</TR>
|
1102
|
+
<TR >
|
1103
|
+
<td class="Notes" valign="top">15:02:16</td><TD CLASS='Notes' >
|
1104
|
+
WAY (00000192-100)</TD>
|
1105
|
+
</TR>
|
1106
|
+
<TR >
|
1107
|
+
<td class="Notes" valign="top">15:04:58</td><TD CLASS='Notes' >
|
1108
|
+
C1218 went in command 15:04:58 (00000192-100)</TD>
|
1109
|
+
</TR>
|
1110
|
+
<TR >
|
1111
|
+
<td class="Notes" valign="top">15:05:15</td><TD CLASS='Notes' >
|
1112
|
+
C1218 ASSUMING CMD (00000192-100)</TD>
|
1113
|
+
</TR>
|
1114
|
+
<TR >
|
1115
|
+
<td class="Notes" valign="top">15:05:21</td><TD CLASS='Notes' >
|
1116
|
+
*HIGHWAY WW SHUT DOWN (00000192-100)</TD>
|
1117
|
+
</TR>
|
1118
|
+
<TR >
|
1119
|
+
<td class="Notes" valign="top">15:06:44</td><TD CLASS='Notes' >
|
1120
|
+
MARTI DONE (00000152-170)</TD>
|
1121
|
+
</TR>
|
1122
|
+
<TR >
|
1123
|
+
<td class="Notes" valign="top">15:07:51</td><TD CLASS='Notes' >
|
1124
|
+
Unit M111 Pressed On scene</TD>
|
1125
|
+
</TR>
|
1126
|
+
<TR >
|
1127
|
+
<td class="Notes" valign="top">15:07:58</td><TD CLASS='Notes' >
|
1128
|
+
Unit DIV61 Pressed On scene</TD>
|
1129
|
+
</TR>
|
1130
|
+
<TR >
|
1131
|
+
<td class="Notes" valign="top">15:09:53</td><TD CLASS='Notes' >
|
1132
|
+
Mark Inc Under Ctrl updated from: 12/29/10 (00000192-100)</TD>
|
1133
|
+
</TR>
|
1134
|
+
<TR >
|
1135
|
+
<td class="Notes" valign="top">15:09:54</td><TD CLASS='Notes' >
|
1136
|
+
15:09:53 (00000192-100)</TD>
|
1137
|
+
</TR>
|
1138
|
+
<TR >
|
1139
|
+
<td class="Notes" valign="top">15:14:01</td><TD CLASS='Notes' >
|
1140
|
+
UNIT M111 Pressed Enr To Hosp: 001 UNIVERSITY HOSPITAL Pri: 3</TD>
|
1141
|
+
</TR>
|
1142
|
+
<TR >
|
1143
|
+
<td class="Notes" valign="top">15:14:01</td><TD CLASS='Notes' >
|
1144
|
+
Beginning mileage = 0</TD>
|
1145
|
+
</TR>
|
1146
|
+
<TR >
|
1147
|
+
<td class="Notes" valign="top">15:22:16</td><TD CLASS='Notes' >
|
1148
|
+
E1201 TIMER SET TO 20 MINUTE(S) (00000192-100)</TD>
|
1149
|
+
</TR>
|
1150
|
+
<TR >
|
1151
|
+
<td class="Notes" valign="top">15:29:24</td><TD CLASS='Notes' >
|
1152
|
+
C1218 WITH REPORT (00000192-100)</TD>
|
1153
|
+
</TR>
|
1154
|
+
<TR >
|
1155
|
+
<td class="Notes" valign="top">15:29:33</td><TD CLASS='Notes' >
|
1156
|
+
*WW NOW BACK OPEN (00000192-100)</TD>
|
1157
|
+
</TR>
|
1158
|
+
</table></td></tr></table></tr></table></html><script language="javascript" src="JSFuncs.js"></script>
|
1159
|
+
|
1160
|
+
|
1161
|
+
}
|
788
1162
|
end
|
@@ -19,7 +19,7 @@ describe "Watchman::CallWatcher" do
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
describe "when parsing
|
22
|
+
describe "when parsing an old call" do
|
23
23
|
before(:each) do
|
24
24
|
IstatusMocker.fake_call_path(Client.host,"201023687")
|
25
25
|
end
|
@@ -66,4 +66,52 @@ describe "Watchman::CallWatcher" do
|
|
66
66
|
call.time_of_first_unit_on_scene == Time.parse("12/19/2010 14:27:09")
|
67
67
|
end
|
68
68
|
end
|
69
|
+
|
70
|
+
describe "when parsing an active call" do
|
71
|
+
before(:each) do
|
72
|
+
IstatusMocker.fake_active_call_path(Client.host,"201024340")
|
73
|
+
end
|
74
|
+
|
75
|
+
let(:call){ CallWatcher.new.info_for("201024340") }
|
76
|
+
|
77
|
+
it "can find the address" do
|
78
|
+
call.address.should == "HIGHWAY WW E-BC/RANGELINE RD S"
|
79
|
+
end
|
80
|
+
|
81
|
+
it "can find the incident number" do
|
82
|
+
call.incident_number.should == "201024340"
|
83
|
+
end
|
84
|
+
|
85
|
+
it "can find the cross-streets" do
|
86
|
+
call.cross_streets.should == ["RANGELINE RD S","BLACKTHORNE LN S"]
|
87
|
+
end
|
88
|
+
|
89
|
+
it "can extract the response level" do
|
90
|
+
call.response_level.should == "Bravo"
|
91
|
+
end
|
92
|
+
|
93
|
+
it "can harvest the priority level" do
|
94
|
+
call.priority.should == 1
|
95
|
+
end
|
96
|
+
|
97
|
+
it "extracts the dispatch_code" do
|
98
|
+
call.dispatch_code.should == "IA"
|
99
|
+
end
|
100
|
+
|
101
|
+
it "can get the grid" do
|
102
|
+
call.grid.should == "30194B"
|
103
|
+
end
|
104
|
+
|
105
|
+
it "can get the fire_area" do
|
106
|
+
call.fire_area.should == "12-15C"
|
107
|
+
end
|
108
|
+
|
109
|
+
it "gets the time of alarm" do
|
110
|
+
call.time_of_alarm.should == Time.parse("12/29/2010 14:54:53")
|
111
|
+
end
|
112
|
+
|
113
|
+
it "gets the on-scene time" do
|
114
|
+
call.time_of_first_unit_on_scene == Time.parse("12/29/2010 15:04:18")
|
115
|
+
end
|
116
|
+
end
|
69
117
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watchman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ethan Vizitei
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-12-
|
18
|
+
date: 2010-12-29 00:00:00 -06:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|