noaa-alerts 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Noaa::Alerts
1
+ # noaa-alerts
2
2
 
3
3
  A library for consuming and formatting NOAA National Weather Service alerts.
4
4
 
@@ -26,7 +26,7 @@ Or install it yourself as:
26
26
 
27
27
  ## Requirements
28
28
 
29
- Requires Ruby 1.9
29
+ Ruby 1.9
30
30
 
31
31
  ## Contributing
32
32
 
@@ -2,10 +2,14 @@ require "noaa-alerts/version"
2
2
 
3
3
  module Noaa
4
4
  class Alert
5
- attr_reader :description, :locations, :identifier, :effective_at, :expires_at
5
+ attr_reader :description, :locations, :identifier, :effective_at, :expires_at, :event, :urgency, :severity, :headline
6
6
 
7
7
  def initialize(entry)
8
8
  @description = ""
9
+ @event = ""
10
+ @urgency = ""
11
+ @severity = ""
12
+ @headline = ""
9
13
  @locations = []
10
14
  @identifier = ""
11
15
  @effective_at = nil
@@ -17,6 +21,10 @@ module Noaa
17
21
 
18
22
  def handle_entry(entry)
19
23
  @description = entry['info']['description']
24
+ @event = entry['info']['event']
25
+ @urgency= entry['info']['urgency']
26
+ @severity = entry['info']['severity']
27
+ @headline = entry['info']['headline']
20
28
  @locations = entry['info']['area']['areaDesc'].split('; ')
21
29
  @identifier = entry['identifier']
22
30
  @effective_at = Time.parse(entry['info']['effective'])
@@ -1,3 +1,3 @@
1
1
  module Noaa
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -21,6 +21,10 @@ describe Noaa, :vcr do
21
21
  subject { Noaa::Client.new("ak").alerts.first }
22
22
 
23
23
  its(:description) { should_not be_nil }
24
+ its(:event) { should_not be_empty }
25
+ its(:urgency) { should_not be_empty }
26
+ its(:severity) { should_not be_empty }
27
+ its(:headline) { should_not be_empty }
24
28
  its(:locations) { should_not be_empty }
25
29
  its(:identifier) { should_not be_empty }
26
30
  its(:effective_at) { should be_an_instance_of Time }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noaa-alerts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-06-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
16
- requirement: &70107377106780 !ruby/object:Gem::Requirement
16
+ requirement: &70303393653120 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.8.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70107377106780
24
+ version_requirements: *70303393653120
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &70107377106260 !ruby/object:Gem::Requirement
27
+ requirement: &70303393652600 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70107377106260
35
+ version_requirements: *70303393652600
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70107377105560 !ruby/object:Gem::Requirement
38
+ requirement: &70303393651720 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.9.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70107377105560
46
+ version_requirements: *70303393651720
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: webmock
49
- requirement: &70107377104540 !ruby/object:Gem::Requirement
49
+ requirement: &70303393650780 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.8.7
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70107377104540
57
+ version_requirements: *70303393650780
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: vcr
60
- requirement: &70107377104000 !ruby/object:Gem::Requirement
60
+ requirement: &70303393650180 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 2.2.2
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70107377104000
68
+ version_requirements: *70303393650180
69
69
  description: A Ruby library for consuming NOAA National Weather Service severe weather
70
70
  alerts.
71
71
  email: