gull 0.4.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/ci.yml +23 -0
  3. data/.gitignore +5 -21
  4. data/.rubocop.yml +34 -1
  5. data/CHANGELOG.md +9 -1
  6. data/Gemfile +2 -0
  7. data/Guardfile +2 -0
  8. data/LICENSE.txt +1 -1
  9. data/README.md +41 -25
  10. data/Rakefile +2 -0
  11. data/gull.gemspec +19 -11
  12. data/lib/gull/alert.rb +79 -45
  13. data/lib/gull/client.rb +51 -36
  14. data/lib/gull/error.rb +5 -0
  15. data/lib/gull/geocode.rb +5 -0
  16. data/lib/gull/polygon.rb +11 -27
  17. data/lib/gull/version.rb +3 -1
  18. data/lib/gull.rb +10 -3
  19. data/spec/alert_spec.rb +130 -72
  20. data/spec/client_spec.rb +46 -63
  21. data/spec/error_spec.rb +4 -2
  22. data/spec/fixtures/alerts.json +4881 -0
  23. data/spec/fixtures/empty.json +4 -0
  24. data/spec/fixtures/features/blizzard_warning.json +93 -0
  25. data/spec/fixtures/features/empty_geocode.json +34 -0
  26. data/spec/fixtures/features/flood_advisory.json +156 -0
  27. data/spec/fixtures/features/flood_warning.json +108 -0
  28. data/spec/fixtures/features/missing_times.json +36 -0
  29. data/spec/fixtures/features/multipolygon.json +69 -0
  30. data/spec/fixtures/features/null_geometry.json +145 -0
  31. data/spec/fixtures/features/polygon_no_vtec.json +165 -0
  32. data/spec/fixtures/features/polygon_with_vtec.json +128 -0
  33. data/spec/fixtures/missing_event.json +21 -0
  34. data/spec/polygon_spec.rb +22 -34
  35. data/spec/spec_helper.rb +5 -88
  36. metadata +42 -42
  37. data/.hound.yml +0 -3
  38. data/.ruby-version +0 -1
  39. data/.travis.yml +0 -7
  40. data/spec/fixtures/alerts.xml +0 -118
  41. data/spec/fixtures/bad.xml +0 -1
  42. data/spec/fixtures/empty.xml +0 -30
  43. data/spec/fixtures/missing_cap.xml +0 -46
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.3.1
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- language: ruby
2
- sudo: true
3
- rvm:
4
- - 2.3.1
5
- - 2.2.5
6
-
7
- script: rspec spec
@@ -1,118 +0,0 @@
1
- <?xml version = '1.0' encoding = 'UTF-8' standalone = 'yes'?>
2
-
3
- <!--
4
- This atom/xml feed is an index to active advisories, watches and warnings
5
- issued by the National Weather Service. This index file is not the complete
6
- Common Alerting Protocol (CAP) alert message. To obtain the complete CAP
7
- alert, please follow the links for each entry in this index. Also note the
8
- CAP message uses a style sheet to convey the information in a human readable
9
- format. Please view the source of the CAP message to see the complete data
10
- set. Not all information in the CAP message is contained in this index of
11
- active alerts.
12
- -->
13
-
14
- <feed
15
- xmlns = 'http://www.w3.org/2005/Atom'
16
- xmlns:cap = 'urn:oasis:names:tc:emergency:cap:1.1'
17
- xmlns:ha = 'http://www.alerting.net/namespace/index_1.0'
18
- >
19
- <!-- http-date = Wed, 01 Oct 2014 04:05:00 GMT -->
20
-
21
- <id>http://alerts.weather.gov/cap/us.atom</id>
22
- <logo>http://alerts.weather.gov/images/xml_logo.gif</logo>
23
- <generator>NWS CAP Server</generator>
24
- <updated>2014-10-01T11:05:00-05:00</updated>
25
- <author>
26
- <name>w-nws.webmaster@noaa.gov</name>
27
- </author>
28
- <title>Current Watches, Warnings and Advisories for the United States Issued by the National Weather Service</title>
29
- <link href='http://alerts.weather.gov/cap/us.atom'/>
30
-
31
- <entry>
32
- <id>http://alerts.weather.gov/cap/wwacapget.php?x=CA125171381DD0.HeatAdvisory</id>
33
- <updated>2014-10-01T08:40:00-07:05</updated>
34
- <published>2014-10-01T08:40:00-07:06</published>
35
- <author>
36
- <name>w-nws.webmaster@noaa.gov</name>
37
- </author>
38
- <title>Heat Advisory issued October 01 at 8:40AM PDT until October 03 at 9:00PM PDT by NWS</title>
39
- <link href='http://alerts.weather.gov/cap/wwacapget.php?x=CA125171381DD0.HeatAdvisory'/>
40
- <summary>SUMMARY TEXT</summary>
41
- <cap:event>Heat Advisory</cap:event>
42
- <cap:effective>2014-10-01T08:40:00-07:00</cap:effective>
43
- <cap:expires>2014-10-03T21:00:00-07:00</cap:expires>
44
- <cap:status>Actual</cap:status>
45
- <cap:msgType>Alert</cap:msgType>
46
- <cap:category>Met</cap:category>
47
- <cap:urgency>Expected</cap:urgency>
48
- <cap:severity>Minor</cap:severity>
49
- <cap:certainty>Very Likely</cap:certainty>
50
- <cap:areaDesc>Southern Salinas Valley, Arroyo Seco and Lake San Antonio</cap:areaDesc>
51
- <cap:polygon>27.35,-81.79 27.14,-81.89 27.04,-81.97 27.04,-82.02 27.14,-81.97 27.35,-81.86 27.35,-81.79</cap:polygon>
52
- <cap:geocode>
53
- </cap:geocode>
54
- <cap:parameter>
55
- <valueName>VTEC</valueName>
56
- <value>/O.NEW.KMTR.HT.Y.0002.141002T1900Z-141004T0400Z/</value>
57
- </cap:parameter>
58
- </entry>
59
-
60
- <entry>
61
- <id>http://alerts.weather.gov/cap/wwacapget.php?x=CA125171381DD0.HeatAdvisory.125171642740CA.MTRNPWMTR.64d60221994d798a87b4862623e0d63c</id>
62
- <updated>2014-10-01T08:40:00-07:00</updated>
63
- <published>2014-10-01T08:40:00-07:00</published>
64
- <author>
65
- <name>w-nws.webmaster@noaa.gov</name>
66
- </author>
67
- <title>Heat Advisory issued October 01 at 8:40AM PDT until October 03 at 9:00PM PDT by NWS</title>
68
- <link href='http://alerts.weather.gov/cap/wwacapget.php?x=CA125171381DD0.HeatAdvisory.125171642740CA.MTRNPWMTR.64d60221994d798a87b4862623e0d63c'/>
69
- <summary>...VERY WARM WEATHER EXPECTED ACROSS OUR ENTIRE AREA STARTING ON THURSDAY... .A RIDGE OF HIGH PRESSURE COMBINED WITH OFFSHORE WINDS AND WARM TEMPERATURES WILL LEAD TO MUCH ABOVE NORMAL TEMPERATURES ACROSS OUR AREA.. ...HEAT ADVISORY IN EFFECT FROM NOON THURSDAY TO 9 PM PDT FRIDAY...</summary>
70
- <cap:event>Flood Advisory</cap:event>
71
- <cap:effective>2014-10-01T08:40:00-07:00</cap:effective>
72
- <cap:expires>2014-10-03T21:00:00-07:00</cap:expires>
73
- <cap:status>Actual</cap:status>
74
- <cap:msgType>Alert</cap:msgType>
75
- <cap:category>Met</cap:category>
76
- <cap:urgency>Expected</cap:urgency>
77
- <cap:severity>Minor</cap:severity>
78
- <cap:certainty>Likely</cap:certainty>
79
- <cap:areaDesc>Coastal North Bay Including Point Reyes National Seashore; East Bay Hills and the Diablo Range; East Bay Interior Valleys; Mountains Of San Benito County And Interior Monterey County Including Pinnacles National Monument; North Bay Interior Valleys; North Bay Mountains; Northern Monterey Bay; Northern Salinas Valley, Hollister Valley and Carmel Valley; San Francisco; San Francisco Bay Shoreline; San Fransisco Peninsula Coast; Santa Clara Valley Including San Jose; Santa Cruz Mountains; Santa Lucia Mountains and Los Padres National Forest; Southern Monterey Bay and Big Sur Coast; Southern Salinas Valley, Arroyo Seco and Lake San Antonio</cap:areaDesc>
80
- <cap:polygon></cap:polygon>
81
- <cap:geocode>
82
- <valueName>FIPS6</valueName>
83
- <value>006001 006013 006041 006053 006055 006069 006075 006081 006085 006087 006097</value>
84
- <valueName>UGC</valueName>
85
- <value>CAZ006 CAZ505 CAZ506 CAZ507 CAZ508 CAZ509 CAZ510 CAZ511 CAZ512 CAZ513 CAZ516 CAZ517 CAZ518 CAZ528 CAZ529 CAZ530</value>
86
- </cap:geocode>
87
- <cap:parameter>
88
- </cap:parameter>
89
- </entry>
90
-
91
- <entry>
92
- <id>http://alerts.weather.gov/cap/wwacapget.php?x=CA125171381DD0.HeatAdvisory.125171642740CA.MTRNPWMTR.64d60221994d798a87b4862623e0d63c</id>
93
- <updated>2014-10-01T08:40:00-07:00</updated>
94
- <published>2014-10-01T08:40:00-07:00</published>
95
- <author>
96
- <name>w-nws.webmaster@noaa.gov</name>
97
- </author>
98
- <title>Heat Advisory issued October 01 at 8:40AM PDT until October 03 at 9:00PM PDT by NWS</title>
99
- <summary>...VERY WARM WEATHER EXPECTED ACROSS OUR ENTIRE AREA STARTING ON THURSDAY... .A RIDGE OF HIGH PRESSURE COMBINED WITH OFFSHORE WINDS AND WARM TEMPERATURES WILL LEAD TO MUCH ABOVE NORMAL TEMPERATURES ACROSS OUR AREA.. ...HEAT ADVISORY IN EFFECT FROM NOON THURSDAY TO 9 PM PDT FRIDAY...</summary>
100
- <cap:event>Tornado Warning</cap:event>
101
- <cap:effective>2014-10-01T08:40:00-07:00</cap:effective>
102
- <cap:expires>2014-10-03T21:00:00-07:00</cap:expires>
103
- <cap:status>Actual</cap:status>
104
- <cap:msgType>Alert</cap:msgType>
105
- <cap:category>Met</cap:category>
106
- <cap:urgency>Expected</cap:urgency>
107
- <cap:severity>Minor</cap:severity>
108
- <cap:certainty>Likely</cap:certainty>
109
- <cap:areaDesc>Coastal North Bay Including Point Reyes National Seashore; East Bay Hills and the Diablo Range; East Bay Interior Valleys; Mountains Of San Benito County And Interior Monterey County Including Pinnacles National Monument; North Bay Interior Valleys; North Bay Mountains; Northern Monterey Bay; Northern Salinas Valley, Hollister Valley and Carmel Valley; San Francisco; San Francisco Bay Shoreline; San Fransisco Peninsula Coast; Santa Clara Valley Including San Jose; Santa Cruz Mountains; Santa Lucia Mountains and Los Padres National Forest; Southern Monterey Bay and Big Sur Coast; Southern Salinas Valley, Arroyo Seco and Lake San Antonio</cap:areaDesc>
110
- <cap:polygon></cap:polygon>
111
- <cap:geocode>
112
- <valueName>FIPS6</valueName>
113
- <value>006001 006013 006041 006053 006055 006069 006075 006081 006085 006087 006097</value>
114
- <valueName>UGC</valueName>
115
- <value>CAZ006 CAZ505 CAZ506 CAZ507 CAZ508 CAZ509 CAZ510 CAZ511 CAZ512 CAZ513 CAZ516 CAZ517 CAZ518 CAZ528 CAZ529 CAZ530</value>
116
- </cap:geocode>
117
- </entry>
118
- </feed>
@@ -1 +0,0 @@
1
- ? cannot read /www1/cap_atom/web/cap/us.atom
@@ -1,30 +0,0 @@
1
- <?xml version = '1.0' encoding = 'UTF-8' standalone = 'yes'?>
2
-
3
- <!--
4
- This atom/xml feed is an index to active advisories, watches and warnings
5
- issued by the National Weather Service. This index file is not the complete
6
- Common Alerting Protocol (CAP) alert message. To obtain the complete CAP
7
- alert, please follow the links for each entry in this index. Also note the
8
- CAP message uses a style sheet to convey the information in a human readable
9
- format. Please view the source of the CAP message to see the complete data
10
- set. Not all information in the CAP message is contained in this index of
11
- active alerts.
12
- -->
13
-
14
- <feed
15
- xmlns = 'http://www.w3.org/2005/Atom'
16
- xmlns:cap = 'urn:oasis:names:tc:emergency:cap:1.1'
17
- xmlns:ha = 'http://www.alerting.net/namespace/index_1.0'
18
- >
19
- <!-- http-date = Wed, 01 Oct 2014 04:05:00 GMT -->
20
-
21
- <id>http://alerts.weather.gov/cap/us.atom</id>
22
- <logo>http://alerts.weather.gov/images/xml_logo.gif</logo>
23
- <generator>NWS CAP Server</generator>
24
- <updated>2014-10-01T11:05:00-05:00</updated>
25
- <author>
26
- <name>w-nws.webmaster@noaa.gov</name>
27
- </author>
28
- <title>Current Watches, Warnings and Advisories for the United States Issued by the National Weather Service</title>
29
- <link href='http://alerts.weather.gov/cap/us.atom'/>
30
- </feed>
@@ -1,46 +0,0 @@
1
-
2
- <?xml version = '1.0' encoding = 'UTF-8' standalone = 'yes'?>
3
- <?xml-stylesheet href='http://alerts.weather.gov/cap/capatom.xsl' type='text/xsl'?>
4
-
5
- <!--
6
- This atom/xml feed is an index to active advisories, watches and warnings
7
- issued by the National Weather Service. This index file is not the complete
8
- Common Alerting Protocol (CAP) alert message. To obtain the complete CAP
9
- alert, please follow the links for each entry in this index. Also note the
10
- CAP message uses a style sheet to convey the information in a human readable
11
- format. Please view the source of the CAP message to see the complete data
12
- set. Not all information in the CAP message is contained in this index of
13
- active alerts.
14
- -->
15
-
16
-
17
- <feed
18
- xmlns = 'http://www.w3.org/2005/Atom'
19
- xmlns:cap = 'urn:oasis:names:tc:emergency:cap:1.1'
20
- xmlns:ha = 'http://www.alerting.net/namespace/index_1.0'
21
- >
22
- <!-- http-date = Sat, 20 Jun 2015 01:23:00 GMT -->
23
-
24
- <id>http://alerts.weather.gov/cap/us.atom</id>
25
- <logo>http://alerts.weather.gov/images/xml_logo.gif</logo>
26
- <generator>NWS CAP Server</generator>
27
- <updated>2015-06-20T08:23:00-05:00</updated>
28
- <author>
29
- <name>w-nws.webmaster@noaa.gov</name>
30
- </author>
31
- <title>Current Watches, Warnings and Advisories for the United States Issued by the National Weather Service</title>
32
- <link href='http://alerts.weather.gov/cap/us.atom'/>
33
-
34
- <entry>
35
- <id>http://alerts.weather.gov/cap/wwacapget.php?x=LA1253AE8E0B98.FloodWarning.1253AEBAFBE4LA.SHVFLSSHV.3908c4d415c0ed7efa65ce2f6eea425e</id>
36
- <updated>2015-06-20T08:02:00-05:00</updated>
37
- <published>2015-06-20T08:02:00-05:00</published>
38
- <author>
39
- <name>w-nws.webmaster@noaa.gov</name>
40
- </author>
41
- <title>Flood Warning issued June 20 at 8:02AM CDT until June 23 at 2:53AM CDT by NWS</title>
42
- <link href='http://alerts.weather.gov/cap/wwacapget.php?x=LA1253AE8E0B98.FloodWarning.1253AEBAFBE4LA.SHVFLSSHV.3908c4d415c0ed7efa65ce2f6eea425e'/>
43
- <summary>The flood warning continues for the Red Chute Bayou At Sligo, Louisiana. * until late Monday night...or until the warning is cancelled. * At 70 AM Saturday the stage was 32.0 feet. * Minor flooding is occurring and minor flooding is forecast. * Flood stage is 31 feet.</summary>
44
- </entry>
45
-
46
- </feed>