controls 1.7.3 → 1.7.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d67e5bddefeaa16c4a2ee50fe022c455c3e43e63
4
- data.tar.gz: a1fe600177ccee03c9dbbf7453e05feb4565db55
3
+ metadata.gz: 065fa99a2640d1220a1ff42cc3e5cce250bb4b50
4
+ data.tar.gz: 54b996ced517d7709a9a0462e7407bc39e31c379
5
5
  SHA512:
6
- metadata.gz: 397a2b4672d1ddef044750e299a8e588a367a92a808710193595110bb2edd3dd94aa6a6b2d60d92acad3496a076faba28d71d1b7558be52f026c992ecd1f1422
7
- data.tar.gz: 11a4d31b47f8763e3b6f57aa9ed2f29498b35a4b560d10f2a9a4f6f36e35883b2cbf3ff8a8028572ce3f2f49ab3b3f46587c3720789f9868529eac93a5c7283a
6
+ metadata.gz: 674bcfba75b727fac6740e128171ea14603855725bf1f5e7c8d3fce2abf67d3924fc54ef2e9d084e6e9d84751340e9112f13390c378ebeb1b32aab8fcaba3208
7
+ data.tar.gz: d0d18bd18e12f54ab6f32cca5c8726da967d255202905e4c668080dbafca77a0d95d05de93dd8c219f7d28329f12fdb84029fbdf6c12049172e0df595ee807ab
data/apiary.apib CHANGED
@@ -29,16 +29,18 @@ Notes API is a *short texts saving* service similar to its physical paper presen
29
29
 
30
30
  + Response 200 (application/json)
31
31
 
32
- {
33
- "id": 1,
34
- "assessing": false,
35
- "highRiskAssetCount": 0,
36
- "mediumRiskAssetCount": 24,
37
- "lowRiskAssetCount": 0,
38
- "totalAssetCount": 24,
39
- "overallRiskScore": 4.004146038088617,
40
- "timestamp": 1393184605912
41
- }
32
+ [
33
+ {
34
+ "id": 1,
35
+ "assessing": false,
36
+ "highRiskAssetCount": 0,
37
+ "mediumRiskAssetCount": 24,
38
+ "lowRiskAssetCount": 0,
39
+ "totalAssetCount": 24,
40
+ "overallRiskScore": 4.004146038088617,
41
+ "timestamp": 1393184605912
42
+ }
43
+ ]
42
44
 
43
45
  # Group Search
44
46
  ## Assets [/assets/search?query={query}]
@@ -57,4 +59,4 @@ Notes API is a *short texts saving* service similar to its physical paper presen
57
59
  "hostName": "CMMNCTR2K7R2-U",
58
60
  "ipaddress": "10.4.19.25"
59
61
  }
60
- ]
62
+ ]
@@ -3,9 +3,25 @@ require 'controls/objects/coverage_information'
3
3
  module Controls
4
4
  # A representation of the Configuration resource w/ coverage information
5
5
  class Configuration < Dish::Plate
6
+ include Comparable
7
+
6
8
  coerce :assessmentTimestamp, ->(value) { Time.at(value / 1000) if value }
7
9
  coerce :coverage, Controls::CoverageInformation
8
10
 
11
+ def <=>(other)
12
+ return unless other.respond_to? :coverage
13
+ coverage.percent_covered <=> other.coverage.percent_covered
14
+ end
15
+
16
+ # [review] - define this in Dish?
17
+ def respond_to?(method_name, *)
18
+ if method_name.eql? :coverage
19
+ true
20
+ else
21
+ super
22
+ end
23
+ end
24
+
9
25
  # The title of the configuration
10
26
  #
11
27
  # @return [String]
@@ -2,6 +2,22 @@ module Controls
2
2
  # A representation of the CoverageInformation for SecurityControl or
3
3
  # Configuration coverage
4
4
  class CoverageInformation < Dish::Plate
5
+ include Comparable
6
+
7
+ def <=>(other)
8
+ return unless other.respond_to? :percent_covered
9
+ percent_covered <=> other.percent_covered
10
+ end
11
+
12
+ # [review] - define this in Dish?
13
+ def respond_to?(method_name, *)
14
+ if method_name.eql? :percent_covered
15
+ true
16
+ else
17
+ super
18
+ end
19
+ end
20
+
5
21
  alias_method :to_s, :inspect
6
22
  end
7
23
  end
@@ -2,9 +2,36 @@ require 'controls/objects/coverage_information'
2
2
 
3
3
  module Controls
4
4
  class SecurityControlCoverage < Dish::Plate
5
+ include Comparable
6
+
7
+
5
8
  coerce :assessmentTimestamp, ->(value) { Time.at(value / 1000) if value }
6
9
  coerce :coverage, Controls::CoverageInformation
7
10
 
11
+ def <=>(other)
12
+ return unless other.respond_to? :coverage
13
+ coverage.percent_covered <=> other.coverage.percent_covered
14
+ end
15
+
16
+ # [review] - define this in Dish?
17
+ def respond_to?(method_name, *)
18
+ if method_name.eql? :coverage
19
+ true
20
+ else
21
+ super
22
+ end
23
+ end
24
+
25
+ def without_coverage
26
+ Controls::SecurityControl.new(enabled: enabled, name: name)
27
+ end
28
+
29
+ def without_coverage!
30
+ @_original_hash.delete_if do |key, _value|
31
+ not %w[enabled name].include?(key)
32
+ end
33
+ end
34
+
8
35
  def to_s
9
36
  title
10
37
  end
@@ -1,4 +1,4 @@
1
1
  module Controls
2
2
  # The version of the Controls gem
3
- VERSION = '1.7.3'
3
+ VERSION = '1.7.4'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: controls
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.3
4
+ version: 1.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erran Carey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-18 00:00:00.000000000 Z
11
+ date: 2014-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dish