gull 0.2.8 → 0.2.9

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: 15e97a70db97f4535e0e878880f690eb74217408
4
- data.tar.gz: ef4f4664567e79990b7cf981672ea8341e9ce51a
3
+ metadata.gz: efe23d6de3946c51a67a4fc953d6d1815eea92a9
4
+ data.tar.gz: 4101a32bf1a6ce2111e0771bd2d22b9f1d7c9d23
5
5
  SHA512:
6
- metadata.gz: 580e281a96af8f6e11701825a4b4110bbe4fa7f8cbfa87f206710623394475afe4e559b7489487a7eb24e300884cf2a9712e3d31374d09eca30b4b54d2b5fa7c
7
- data.tar.gz: 0bf171005aa7a1eb0ec603e7997e402615a0c1c4a7a35ac83aa7be0bf36f5e7188a5fd64ab49416b254ec3f2ec23f792f79e609f16b6b1808bfb43b99a1b7e7e
6
+ metadata.gz: b47fef1e1492a2f6f46b796922f8870fa2c308aaf5803ab550f31d3d6cd853e3821009a3892c59be9237376200e77c70407eacf30c25035c8440586f885403cc
7
+ data.tar.gz: 4e9dd491033578832999b28fa7c0d56a8a6a867e36ea4a2ebe035e97be511a58f6b739f060a36f16f8dd80f17c3ced550ac5b8c52c383fc3284187470c04d197
data/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
  [![Coverage Status](https://coveralls.io/repos/sethdeckard/gull/badge.png)](https://coveralls.io/r/sethdeckard/gull)
4
4
  [![Code Climate](https://codeclimate.com/github/sethdeckard/gull/badges/gpa.svg)](https://codeclimate.com/github/sethdeckard/gull)
5
5
  [![Dependency Status](https://gemnasium.com/sethdeckard/gull.svg)](https://gemnasium.com/sethdeckard/gull)
6
- # Gull
7
6
  [![security](https://hakiri.io/github/sethdeckard/gull/master.svg)](https://hakiri.io/github/sethdeckard/gull/master)
7
+ # Gull
8
8
 
9
9
  Ruby client for parsing NOAA/NWS alerts, warnings, and watches. The name comes from the type of bird featured on the NOAA logo.
10
10
 
@@ -94,7 +94,7 @@ Or install it yourself as:
94
94
 
95
95
  1. Fork it ( https://github.com/sethdeckard/gull/fork )
96
96
  2. Create your feature branch (`git checkout -b my-new-feature`)
97
- 3. Run the specs, make sure they pass and that few features are covered
97
+ 3. Run the specs, make sure they pass and that new features are covered
98
98
  4. Commit your changes (`git commit -am 'Add some feature'`)
99
99
  5. Push to the branch (`git push origin my-new-feature`)
100
100
  6. Create a new Pull Request
data/lib/gull/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gull
2
- VERSION = "0.2.8"
2
+ VERSION = "0.2.9"
3
3
  end
data/spec/alert_spec.rb CHANGED
@@ -7,7 +7,7 @@ describe Gull::Alert do
7
7
  end
8
8
 
9
9
  it "should fetch parsed alerts" do
10
- xml = File.read "spec/alerts.xml"
10
+ xml = File.read "spec/fixtures/alerts.xml"
11
11
 
12
12
  stub_request(:get, "http://alerts.weather.gov/cap/us.php?x=0").
13
13
  with(:headers => {'Accept'=>'*/*'}).
@@ -49,4 +49,26 @@ describe Gull::Alert do
49
49
  third = alerts[2]
50
50
  expect(third.vtec).to be_nil
51
51
  end
52
+
53
+ it "should handle empty alerts" do
54
+ xml = File.read "spec/fixtures/empty.xml"
55
+
56
+ stub_request(:get, "http://alerts.weather.gov/cap/us.php?x=0").
57
+ with(:headers => {'Accept'=>'*/*'}).
58
+ to_return(:status => 200, :body => xml, :headers => {})
59
+
60
+ alerts = Gull::Alert.fetch
61
+ expect(alerts.size).to eq(0)
62
+ end
63
+
64
+ it "should handle bad response" do
65
+ xml = File.read "spec/fixtures/bad.xml"
66
+
67
+ stub_request(:get, "http://alerts.weather.gov/cap/us.php?x=0").
68
+ with(:headers => {'Accept'=>'*/*'}).
69
+ to_return(:status => 200, :body => xml, :headers => {})
70
+
71
+ alerts = Gull::Alert.fetch
72
+ expect(alerts.size).to eq(0)
73
+ end
52
74
  end
File without changes
@@ -0,0 +1 @@
1
+ ? cannot read /www1/cap_atom/web/cap/us.atom
@@ -0,0 +1,30 @@
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>
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gull
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Deckard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-12 00:00:00.000000000 Z
11
+ date: 2014-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.6.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.6.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.6'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.6'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '2.11'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '2.11'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: webmock
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: Client for parsing NOAA/NWS alerts, warnings, and watches.
@@ -101,9 +101,9 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - .gitignore
105
- - .rspec
106
- - .travis.yml
104
+ - ".gitignore"
105
+ - ".rspec"
106
+ - ".travis.yml"
107
107
  - Gemfile
108
108
  - LICENSE.txt
109
109
  - README.md
@@ -115,7 +115,9 @@ files:
115
115
  - lib/gull/polygon.rb
116
116
  - lib/gull/version.rb
117
117
  - spec/alert_spec.rb
118
- - spec/alerts.xml
118
+ - spec/fixtures/alerts.xml
119
+ - spec/fixtures/bad.xml
120
+ - spec/fixtures/empty.xml
119
121
  - spec/polygon_spec.rb
120
122
  - spec/spec_helper.rb
121
123
  homepage: https://github.com/sethdeckard/gull
@@ -128,12 +130,12 @@ require_paths:
128
130
  - lib
129
131
  required_ruby_version: !ruby/object:Gem::Requirement
130
132
  requirements:
131
- - - '>='
133
+ - - ">="
132
134
  - !ruby/object:Gem::Version
133
135
  version: '0'
134
136
  required_rubygems_version: !ruby/object:Gem::Requirement
135
137
  requirements:
136
- - - '>='
138
+ - - ">="
137
139
  - !ruby/object:Gem::Version
138
140
  version: '0'
139
141
  requirements: []
@@ -144,6 +146,8 @@ specification_version: 4
144
146
  summary: Client for parsing NOAA/NWS alerts, warnings, and watches.
145
147
  test_files:
146
148
  - spec/alert_spec.rb
147
- - spec/alerts.xml
149
+ - spec/fixtures/alerts.xml
150
+ - spec/fixtures/bad.xml
151
+ - spec/fixtures/empty.xml
148
152
  - spec/polygon_spec.rb
149
153
  - spec/spec_helper.rb