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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc65a6c9ee8613f29a9e8e5d0417fec80900b73f
4
- data.tar.gz: e306c334a7890b5ba7008faef82ec29ce95627a5
3
+ metadata.gz: 792d49f4035818566097996e4db53f94b4024886
4
+ data.tar.gz: 2050b304dffd2ba40568ce076866a8675226927e
5
5
  SHA512:
6
- metadata.gz: ff9664befc1f5cada0ff816a64a3ba0c4de73470b3d80fc1986e73b78e7a086715d10b325f178fc8bdf5416d69c3b151bd1e1b7cb2de1b0a81bebf27bfe48f62
7
- data.tar.gz: 0d8ae32459002821f3cdd83c3687884fafb8ad6afe7689b73470660ef6b3ab22332f792b03d078f30724941410f5d19c808fda8d5fcdf73cefbd008e0460b453
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
- alert.polygon = entry.xpath('cap:polygon').inner_text
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
@@ -1,3 +1,3 @@
1
1
  module Gull
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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 = "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"
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")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gull
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Deckard