controls 1.5.0 → 1.5.1

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: c4537831e815a135b460f87a742e2a209e07de54
4
- data.tar.gz: e4a587053968dfa775c9b3e48a311cf1731fb3af
3
+ metadata.gz: afef162bcbc4d24e5943361cb4e5b55c4fbe2b06
4
+ data.tar.gz: ab9875952d506d826d3464593790a30368ca179a
5
5
  SHA512:
6
- metadata.gz: 5cb13b0f70613104b6b3984622d57b5f0fbcac877a9e6d1b9f05b30d7724953a79bbc532132711bad8646e2062ce8d54de7fca99b1fc7aa531c3f2f4e9ec259c
7
- data.tar.gz: c41b7b8797867824501d6577b213ba9965b8394919fcf1d6f7f071013f579b66138946d61ae7accf9f562e018a6848ced372a785c7f558942e66dd4d10e3c45a
6
+ metadata.gz: cfd01f6176f85cca3499c7d226d2eed978e26e620a4625ceb700e9f95f4b00858142669065206adbc644946a9712d254cb079b7bb0f458c5fd3aa6e921602308
7
+ data.tar.gz: 1ac3ddf95b414e5a3bb3007c149650ae204fde284d08666601711a743c6d5ddb84223bd9c60a5a63aae27450359304217b6aea6cb8cc6c6a509ca97038fc1b17
@@ -13,7 +13,7 @@ module Dish
13
13
  _set_value(key, args.first)
14
14
  else
15
15
  value = _get_value(camel_case_key)
16
- if value.nil?
16
+ if value.nil? && !_allowed_keys.include?(camel_case_key)
17
17
  super(method.to_sym, *args, &block)
18
18
  else
19
19
  value
@@ -51,5 +51,9 @@ module Dish
51
51
  value = _convert_value(value, self.class.coercions[key])
52
52
  @_original_hash[key] = value
53
53
  end
54
+
55
+ def _allowed_keys
56
+ []
57
+ end
54
58
  end
55
59
  end
@@ -1,7 +1,12 @@
1
1
  module Controls
2
2
  Guidance = Class.new(Dish::Plate)
3
- Guidance::Reference = Class.new(Dish::Plate)
4
3
  Guidance::Section = Class.new(Dish::Plate)
4
+ Guidance::Reference = Class.new(Dish::Plate) do
5
+ private
6
+ def _allowed_keys
7
+ %w[url]
8
+ end
9
+ end
5
10
 
6
11
  class Guidance
7
12
  coerce :assessmentTimestamp, ->(value) { Time.at(value / 1000) if value }
@@ -16,7 +16,7 @@ module Controls
16
16
  Controls::SecurityControlCoverage
17
17
  when /(configuration|event|guidance|prioritized_guidance|security_control|threat_vector|trend)s?$/
18
18
  Controls.const_get(Regexp.last_match[1].split('_').map(&:capitalize).join)
19
- when %r(^(?:/\d.\d)?\/(assessment|configuration|security_control|threat|threat_vector)s)
19
+ when %r(^(?:/\d.\d)?\/(assessment|configuration|guidance|security_control|threat|threat_vector)s?)
20
20
  Controls.const_get(Regexp.last_match[1].split('_').map(&:capitalize).join)
21
21
  when /((?:applicable|miconfigured|uncovered|undefended)?_?asset)s$/
22
22
  Controls.const_get('AssetCollection')
@@ -1,4 +1,4 @@
1
1
  module Controls
2
2
  # The version of the Controls gem
3
- VERSION = '1.5.0'
3
+ VERSION = '1.5.1'
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.5.0
4
+ version: 1.5.1
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-02-10 00:00:00.000000000 Z
11
+ date: 2014-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dish