gull 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gull/alert.rb +7 -1
- data/lib/gull/version.rb +1 -1
- data/spec/alert_spec.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 792d49f4035818566097996e4db53f94b4024886
|
4
|
+
data.tar.gz: 2050b304dffd2ba40568ce076866a8675226927e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a772bcaae595a1850073a1fab8e692e695104efeea7fccc2e10977d4a06fbcb58a3250978dc8d33496d8163ce2e309357a1422a054cdb6776c4e38e8b0a64218
|
7
|
+
data.tar.gz: 1177871762889f9302bc2c19d892342c412b13970b315eaf776cf0402606cf8dca9eb8e7e863e7b1f9a7d841418a14be7608a77987547be7908456fa1aba68bd
|
data/lib/gull/alert.rb
CHANGED
@@ -24,7 +24,12 @@ module Gull
|
|
24
24
|
alert.alert_type = entry.xpath('cap:event').inner_text
|
25
25
|
alert.title = entry.css('title').inner_text
|
26
26
|
alert.summary = entry.css('summary').inner_text
|
27
|
-
|
27
|
+
|
28
|
+
polygon = entry.xpath('cap:polygon').inner_text
|
29
|
+
unless polygon.nil?
|
30
|
+
alert.polygon = polygon.split(" ").collect {|coords| coords.split(",").collect {|coord| coord.to_f} }
|
31
|
+
end
|
32
|
+
|
28
33
|
alert.area = entry.xpath('cap:areaDesc').inner_text
|
29
34
|
alert.effective_at = Time.parse(entry.xpath('cap:effective').inner_text).utc
|
30
35
|
alert.expires_at = Time.parse(entry.xpath('cap:expires').inner_text).utc
|
@@ -40,5 +45,6 @@ module Gull
|
|
40
45
|
def self.code_to_symbol code
|
41
46
|
code.gsub(' ','_').downcase.to_sym
|
42
47
|
end
|
48
|
+
|
43
49
|
end
|
44
50
|
end
|
data/lib/gull/version.rb
CHANGED
data/spec/alert_spec.rb
CHANGED
@@ -17,7 +17,8 @@ describe Gull::Alert do
|
|
17
17
|
expect(first.title).to eq "Heat Advisory issued October 01 at 8:40AM PDT until October 03 at 9:00PM PDT by NWS"
|
18
18
|
expect(first.summary).to eq "SUMMARY TEXT"
|
19
19
|
|
20
|
-
polygon =
|
20
|
+
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],
|
21
|
+
[27.35,-81.79]]
|
21
22
|
expect(first.polygon).to eq polygon
|
22
23
|
|
23
24
|
expect(first.effective_at).to eq Time.parse("2014-10-01T08:40:00-07:00")
|