rcap 2.7.3 → 2.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +4 -0
- data/lib/rcap/base/alert.rb +13 -19
- data/lib/rcap/base/info.rb +16 -16
- data/lib/rcap/base/parameter.rb +2 -2
- data/lib/rcap/base/resource.rb +4 -4
- data/lib/rcap/cap_1_0/alert.rb +14 -20
- data/lib/rcap/cap_1_1/info.rb +14 -14
- data/lib/rcap/cap_1_1/resource.rb +6 -6
- data/lib/rcap/cap_1_2/info.rb +13 -13
- data/lib/rcap/cap_1_2/resource.rb +6 -6
- data/lib/rcap/custom_validators.rb +18 -16
- data/lib/rcap/utilities.rb +1 -1
- data/lib/rcap/validation.rb +8 -5
- data/lib/rcap/version.rb +1 -1
- data/spec/alert_spec.rb +8 -9
- data/spec/cap_1_0/alert_spec.rb +4 -5
- data/spec/cap_1_0/area_spec.rb +7 -10
- data/spec/cap_1_0/event_code_spec.rb +1 -1
- data/spec/cap_1_0/geocode_spec.rb +1 -1
- data/spec/cap_1_0/info_spec.rb +38 -38
- data/spec/cap_1_0/resource_spec.rb +6 -7
- data/spec/cap_1_1/alert_spec.rb +6 -7
- data/spec/cap_1_1/area_spec.rb +6 -8
- data/spec/cap_1_1/info_spec.rb +26 -26
- data/spec/cap_1_1/parameter_spec.rb +1 -2
- data/spec/cap_1_1/resource_spec.rb +12 -12
- data/spec/cap_1_2/alert_spec.rb +7 -8
- data/spec/cap_1_2/area_spec.rb +6 -6
- data/spec/cap_1_2/info_spec.rb +25 -26
- data/spec/cap_1_2/resource_spec.rb +12 -12
- data/spec/extensions_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -2
- data/spec/validations_spec.rb +0 -1
- metadata +6 -7
@@ -107,33 +107,33 @@ describe(RCAP::CAP_1_2::Resource) do
|
|
107
107
|
end
|
108
108
|
|
109
109
|
it('should set the resource description') do
|
110
|
-
@resource_hash[
|
110
|
+
@resource_hash[RCAP::CAP_1_2::Resource::RESOURCE_DESC_KEY].should == @resource.resource_desc
|
111
111
|
end
|
112
112
|
|
113
113
|
it('should set the mime type') do
|
114
|
-
@resource_hash[
|
114
|
+
@resource_hash[RCAP::CAP_1_2::Resource::MIME_TYPE_KEY].should == @resource.mime_type
|
115
115
|
end
|
116
116
|
|
117
117
|
it('should set the size') do
|
118
|
-
@resource_hash[
|
118
|
+
@resource_hash[RCAP::CAP_1_2::Resource::SIZE_KEY].should == @resource.size
|
119
119
|
end
|
120
120
|
|
121
121
|
it('should set the URI') do
|
122
|
-
@resource_hash[
|
122
|
+
@resource_hash[RCAP::CAP_1_2::Resource::URI_KEY].should == @resource.uri
|
123
123
|
end
|
124
124
|
|
125
125
|
it('should set the dereferenced URI') do
|
126
|
-
@resource_hash[
|
126
|
+
@resource_hash[RCAP::CAP_1_2::Resource::DEREF_URI_KEY].should == @resource.deref_uri
|
127
127
|
end
|
128
128
|
|
129
129
|
it('should set the digest') do
|
130
|
-
@resource_hash[
|
130
|
+
@resource_hash[RCAP::CAP_1_2::Resource::DIGEST_KEY].should == @resource.digest
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
134
134
|
context('to xml') do
|
135
135
|
it('should be successful') do
|
136
|
-
|
136
|
+
-> { @resource_xml = @resource.to_xml }.should_not(raise_exception)
|
137
137
|
end
|
138
138
|
end
|
139
139
|
end
|
@@ -174,15 +174,15 @@ describe(RCAP::CAP_1_2::Resource) do
|
|
174
174
|
|
175
175
|
describe('calling dereference_uri!') do
|
176
176
|
it('should fetch the content and store it in deref_uri as Base64 encoded content') do
|
177
|
-
|
177
|
+
-> { @resource.dereference_uri! }.should(change(@resource, :deref_uri).to(@encoded_content))
|
178
178
|
end
|
179
179
|
|
180
180
|
it('should generate the correct SHA1 hash') do
|
181
|
-
|
181
|
+
-> { @resource.dereference_uri! }.should(change(@resource, :digest).to(Digest::SHA1.hexdigest(@encoded_content)))
|
182
182
|
end
|
183
183
|
|
184
184
|
it('should set the size in bytes') do
|
185
|
-
|
185
|
+
-> { @resource.dereference_uri! }.should(change(@resource, :size).to(@encoded_content.bytesize))
|
186
186
|
end
|
187
187
|
end
|
188
188
|
end
|
@@ -201,11 +201,11 @@ describe(RCAP::CAP_1_2::Resource) do
|
|
201
201
|
|
202
202
|
describe('#calculate_hash_and_size') do
|
203
203
|
it('should generate the correct SHA1 hash') do
|
204
|
-
|
204
|
+
-> { @resource.calculate_hash_and_size }.should(change(@resource, :digest).to(Digest::SHA1.hexdigest(@encoded_content)))
|
205
205
|
end
|
206
206
|
|
207
207
|
it('should set the size in bytes') do
|
208
|
-
|
208
|
+
-> { @resource.calculate_hash_and_size }.should(change(@resource, :size).to(@encoded_content.bytesize))
|
209
209
|
end
|
210
210
|
end
|
211
211
|
|
data/spec/extensions_spec.rb
CHANGED
@@ -14,7 +14,7 @@ describe(Array) do
|
|
14
14
|
|
15
15
|
context('without an element containing white space') do
|
16
16
|
before(:all) do
|
17
|
-
@list = %w
|
17
|
+
@list = %w[one two three]
|
18
18
|
end
|
19
19
|
it('should format the list correctly') do
|
20
20
|
@list.to_s_for_cap.should == 'one two three'
|
@@ -51,7 +51,7 @@ describe(String) do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
it('should unpack strings correclty') do
|
54
|
-
'Item1 Item2 Item3'.unpack_cap_list.should == %w
|
54
|
+
'Item1 Item2 Item3'.unpack_cap_list.should == %w[Item1 Item2 Item3]
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
data/spec/spec_helper.rb
CHANGED
data/spec/validations_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rcap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Farrel Lifson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -206,7 +206,7 @@ files:
|
|
206
206
|
homepage: http://www.aimred.com/projects/rcap
|
207
207
|
licenses: []
|
208
208
|
metadata: {}
|
209
|
-
post_install_message:
|
209
|
+
post_install_message:
|
210
210
|
rdoc_options: []
|
211
211
|
require_paths:
|
212
212
|
- lib
|
@@ -221,9 +221,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '0'
|
223
223
|
requirements: []
|
224
|
-
|
225
|
-
|
226
|
-
signing_key:
|
224
|
+
rubygems_version: 3.1.2
|
225
|
+
signing_key:
|
227
226
|
specification_version: 4
|
228
227
|
summary: CAP(Common Alerting Protocol) API
|
229
228
|
test_files:
|