rcap 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +4 -0
- data/lib/rcap.rb +2 -0
- data/lib/rcap/info.rb +15 -0
- data/lib/rcap/version.rb +1 -1
- data/spec/info_spec.rb +35 -0
- metadata +16 -25
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fcde72aed04c8e2fc3fb4438f7aa0efa8c4ea742
|
4
|
+
data.tar.gz: c4da4ef49d6baa85a8ed1c2d8f6483911f7c8d83
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: dc204739fd9dadf31a5b8681534dc0f432f3cedee19f5d4c867532273a4da3d68fa4e5f54cea9f62c73b323832a437449efdcf0c12e5cdc92443874bbfeec78f
|
7
|
+
data.tar.gz: 1f12805f57d4ccb6c445b9995d5d43028b7987555ed149847c1f1520bc4d38ca6114d50f3c5c465e84d05c7a6c394b96e3709c04f2e7a3b3aace14c1f79feb72
|
data/CHANGELOG.md
CHANGED
data/lib/rcap.rb
CHANGED
data/lib/rcap/info.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
module RCAP
|
2
|
+
module Info
|
3
|
+
|
4
|
+
def self.from_h( alert, info_hash )
|
5
|
+
case alert.class::CAP_VERSION
|
6
|
+
when CAP_1_0::Alert::CAP_VERSION
|
7
|
+
CAP_1_0::Info.from_h( info_hash )
|
8
|
+
when CAP_1_1::Alert::CAP_VERSION
|
9
|
+
CAP_1_1::Info.from_h( info_hash )
|
10
|
+
else
|
11
|
+
CAP_1_2::Info.from_h( info_hash )
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/rcap/version.rb
CHANGED
data/spec/info_spec.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe( RCAP::Info ) do
|
4
|
+
describe( 'initialising' ) do
|
5
|
+
context( 'a CAP 1.2 info' ) do
|
6
|
+
let( :alert ) do
|
7
|
+
RCAP::CAP_1_2::Alert.new
|
8
|
+
end
|
9
|
+
|
10
|
+
let( :original_info ) do
|
11
|
+
RCAP::CAP_1_2::Info.new do |info|
|
12
|
+
info.event = "Event"
|
13
|
+
info.urgency = RCAP::CAP_1_2::Info::URGENCY_EXPECTED
|
14
|
+
info.severity = RCAP::CAP_1_2::Info::SEVERITY_SEVERE
|
15
|
+
info.certainty = RCAP::CAP_1_2::Info::CERTAINTY_LIKELY
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
shared_examples_for( 'the 1.2 Info object is initialised correctly' ) do
|
20
|
+
it( 'sets the event' ){ info.event.should == original_info.event }
|
21
|
+
it( 'sets the urgency' ){ info.urgency.should == original_info.urgency }
|
22
|
+
it( 'sets the severity' ){ info.severity.should == original_info.severity }
|
23
|
+
it( 'sets the certainty' ){ info.certainty.should == original_info.certainty }
|
24
|
+
end
|
25
|
+
|
26
|
+
context( 'from a Hash' ) do
|
27
|
+
let( :info ) do
|
28
|
+
RCAP::Info.from_h( alert, original_info.to_h )
|
29
|
+
end
|
30
|
+
|
31
|
+
it_should_behave_like( 'the 1.2 Info object is initialised correctly' )
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rcap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 2.2.0
|
4
|
+
version: 2.2.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Farrel Lifson
|
@@ -10,13 +9,12 @@ autorequire:
|
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
11
|
|
13
|
-
date: 2013-
|
12
|
+
date: 2013-04-16 00:00:00 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: assistance
|
17
16
|
prerelease: false
|
18
17
|
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
-
none: false
|
20
18
|
requirements:
|
21
19
|
- - ">="
|
22
20
|
- !ruby/object:Gem::Version
|
@@ -27,7 +25,6 @@ dependencies:
|
|
27
25
|
name: json
|
28
26
|
prerelease: false
|
29
27
|
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
-
none: false
|
31
28
|
requirements:
|
32
29
|
- - ">="
|
33
30
|
- !ruby/object:Gem::Version
|
@@ -38,7 +35,6 @@ dependencies:
|
|
38
35
|
name: uuidtools
|
39
36
|
prerelease: false
|
40
37
|
requirement: &id003 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
38
|
requirements:
|
43
39
|
- - ">="
|
44
40
|
- !ruby/object:Gem::Version
|
@@ -49,7 +45,6 @@ dependencies:
|
|
49
45
|
name: rspec
|
50
46
|
prerelease: false
|
51
47
|
requirement: &id004 !ruby/object:Gem::Requirement
|
52
|
-
none: false
|
53
48
|
requirements:
|
54
49
|
- - ">="
|
55
50
|
- !ruby/object:Gem::Version
|
@@ -60,9 +55,9 @@ dependencies:
|
|
60
55
|
name: yard
|
61
56
|
prerelease: false
|
62
57
|
requirement: &id005 !ruby/object:Gem::Requirement
|
63
|
-
none: false
|
64
58
|
requirements:
|
65
|
-
-
|
59
|
+
- &id006
|
60
|
+
- ">="
|
66
61
|
- !ruby/object:Gem::Version
|
67
62
|
version: "0"
|
68
63
|
type: :development
|
@@ -70,14 +65,11 @@ dependencies:
|
|
70
65
|
- !ruby/object:Gem::Dependency
|
71
66
|
name: webmock
|
72
67
|
prerelease: false
|
73
|
-
requirement: &
|
74
|
-
none: false
|
68
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
75
69
|
requirements:
|
76
|
-
-
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version: "0"
|
70
|
+
- *id006
|
79
71
|
type: :development
|
80
|
-
version_requirements: *
|
72
|
+
version_requirements: *id007
|
81
73
|
description: A Ruby API providing parsing, generation and validation of CAP(Common Alerting Protocol) messages.
|
82
74
|
email:
|
83
75
|
- farrel.lifson@aimred.com
|
@@ -142,6 +134,7 @@ files:
|
|
142
134
|
- lib/rcap/extensions/date_time.rb
|
143
135
|
- lib/rcap/extensions/string.rb
|
144
136
|
- lib/rcap/extensions/time.rb
|
137
|
+
- lib/rcap/info.rb
|
145
138
|
- lib/rcap/utilities.rb
|
146
139
|
- lib/rcap/validations.rb
|
147
140
|
- lib/rcap/version.rb
|
@@ -191,35 +184,32 @@ files:
|
|
191
184
|
- spec/cap_1_2/polygon_spec.rb
|
192
185
|
- spec/cap_1_2/resource_spec.rb
|
193
186
|
- spec/extensions_spec.rb
|
187
|
+
- spec/info_spec.rb
|
194
188
|
- spec/spec.opts
|
195
189
|
- spec/spec_helper.rb
|
196
190
|
- spec/validations_spec.rb
|
197
191
|
homepage: http://www.aimred.com/projects/rcap
|
198
192
|
licenses: []
|
199
193
|
|
194
|
+
metadata: {}
|
195
|
+
|
200
196
|
post_install_message:
|
201
197
|
rdoc_options: []
|
202
198
|
|
203
199
|
require_paths:
|
204
200
|
- lib
|
205
201
|
required_ruby_version: !ruby/object:Gem::Requirement
|
206
|
-
none: false
|
207
202
|
requirements:
|
208
|
-
-
|
209
|
-
- !ruby/object:Gem::Version
|
210
|
-
version: "0"
|
203
|
+
- *id006
|
211
204
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
212
|
-
none: false
|
213
205
|
requirements:
|
214
|
-
-
|
215
|
-
- !ruby/object:Gem::Version
|
216
|
-
version: "0"
|
206
|
+
- *id006
|
217
207
|
requirements: []
|
218
208
|
|
219
209
|
rubyforge_project: rcap
|
220
|
-
rubygems_version:
|
210
|
+
rubygems_version: 2.0.3
|
221
211
|
signing_key:
|
222
|
-
specification_version:
|
212
|
+
specification_version: 4
|
223
213
|
summary: CAP(Common Alerting Protocol) API
|
224
214
|
test_files:
|
225
215
|
- spec/alert_spec.rb
|
@@ -267,6 +257,7 @@ test_files:
|
|
267
257
|
- spec/cap_1_2/polygon_spec.rb
|
268
258
|
- spec/cap_1_2/resource_spec.rb
|
269
259
|
- spec/extensions_spec.rb
|
260
|
+
- spec/info_spec.rb
|
270
261
|
- spec/spec.opts
|
271
262
|
- spec/spec_helper.rb
|
272
263
|
- spec/validations_spec.rb
|