gull 0.2.11 → 0.2.12

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: abbfea59f3e20194da7602da330d7d17304add4b
4
- data.tar.gz: 4469f2c218b7483b039b8404bf90a03a47a99e9e
3
+ metadata.gz: d7cf5f89f2aa7403966ecb221648242d55cb0ce0
4
+ data.tar.gz: 17a287cd6e61951cac00706ec4bd611bed4f87e6
5
5
  SHA512:
6
- metadata.gz: 1157f36b6ba261f2f91077b6e016b65eb3b782038af7da83e7af7464b1612d846b860fab672e2328bb816cf8b59aff02b8671363771a547954568c1137e0d89c
7
- data.tar.gz: 5cbfa92c6fbd6de9806f73f5791097506969ee72f5eff576def3dfd58a361a1985a65d383800f7e08025f6a76df15e739481d80c3ed5c42d2035823e56b7a527
6
+ metadata.gz: 315ae3c06f02a5a155f3c614bbd4ed6f532a81cd973526ee001cb62c303cae3cd50a6b65380b9185273da7e6ec57f83a04dda09246ed13118af904b64f2c4813
7
+ data.tar.gz: 68c3b8ad903322414850c62c4071cbbf7402ca4175aaf37c8ef6a6104bd8cd43860c49a684b736c5728064e540e5ced86550e5073d9d5abe667821aef46749f7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ### 0.2.12 (6/12/2015) - Fix issue with missing link elements
2
+ ***
3
+ ### 0.2.11 (5/29/2015) - Added method to get original polygon string
1
4
  ***
2
5
  ### 0.2.10 (3/23/2015) - Added option to override default alert service URI.
3
6
  ***
data/lib/gull/alert.rb CHANGED
@@ -61,11 +61,16 @@ module Gull
61
61
  self.id = element.css('id').inner_text
62
62
  self.title = element.css('title').inner_text
63
63
  self.summary = element.css('summary').inner_text
64
- self.link = element.css('link').first.attributes['href'].value
64
+ self.link = parse_link element
65
65
  self.alert_type = element.xpath('cap:event').inner_text
66
66
  self.area = element.xpath('cap:areaDesc').inner_text
67
67
  end
68
68
 
69
+ def parse_link(element)
70
+ link = element.css('link').first
71
+ link.attributes['href'].value unless link.nil?
72
+ end
73
+
69
74
  def parse_times(element)
70
75
  self.updated_at = Time.parse(element.css('updated').inner_text)
71
76
  self.published_at = Time.parse(element.css('published').inner_text)
data/lib/gull/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gull
2
- VERSION = '0.2.11'
2
+ VERSION = '0.2.12'
3
3
  end
data/spec/alert_spec.rb CHANGED
@@ -53,6 +53,7 @@ describe Gull::Alert do
53
53
 
54
54
  third = alerts[2]
55
55
  expect(third.vtec).to be_nil
56
+ expect(third.link).to be_nil
56
57
  end
57
58
 
58
59
  it 'should fetch from url in options' do
@@ -100,7 +100,6 @@ xmlns:ha = 'http://www.alerting.net/namespace/index_1.0'
100
100
  <name>w-nws.webmaster@noaa.gov</name>
101
101
  </author>
102
102
  <title>Heat Advisory issued October 01 at 8:40AM PDT until October 03 at 9:00PM PDT by NWS</title>
103
- <link href='http://alerts.weather.gov/cap/wwacapget.php?x=CA125171381DD0.HeatAdvisory.125171642740CA.MTRNPWMTR.64d60221994d798a87b4862623e0d63c'/>
104
103
  <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>
105
104
  <cap:event>Tornado Warning</cap:event>
106
105
  <cap:effective>2014-10-01T08:40:00-07:00</cap:effective>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gull
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Deckard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-30 00:00:00.000000000 Z
11
+ date: 2015-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient