humidifier 2.6.0 → 2.15.0

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.
@@ -36,6 +36,7 @@ module Humidifier
36
36
 
37
37
  response.stack_events.each do |event|
38
38
  next if failure_event_filtered?(event)
39
+
39
40
  reasons.unshift(event.resource_status_reason)
40
41
  end
41
42
 
@@ -16,6 +16,7 @@ MSG
16
16
 
17
17
  def upload_object(payload, key)
18
18
  raise S3_SDK_MESSAGE unless s3_sdk_loaded?
19
+
19
20
  super
20
21
  end
21
22
 
@@ -47,6 +47,7 @@ MSG
47
47
  # raise an error unless the s3_bucket field is set
48
48
  def ensure_upload_configured!(payload)
49
49
  return if s3_bucket
50
+
50
51
  raise UPLOAD_MESSAGE.gsub('%<identifier>s', payload.identifier)
51
52
  end
52
53
 
@@ -46,8 +46,9 @@ module Humidifier
46
46
  structs = StructureContainer.new(parsed['PropertyTypes'])
47
47
 
48
48
  parsed['ResourceTypes'].each do |key, spec|
49
- match = key.match(/\AAWS::(\w+)::(\w+)\z/)
50
- register(match[1], match[2], spec, structs.search(key))
49
+ match = key.match(/\A(\w+)::(\w+)::(\w+)\z/)
50
+
51
+ register(match[1], match[2], match[3], spec, structs.search(key))
51
52
  end
52
53
  end
53
54
 
@@ -69,8 +70,8 @@ module Humidifier
69
70
  end
70
71
  end
71
72
 
72
- def register(group, resource, spec, substructs)
73
- aws_name = "AWS::#{group}::#{resource}"
73
+ def register(top, group, resource, spec, substructs)
74
+ aws_name = "#{top}::#{group}::#{resource}"
74
75
  resource_class = build_class(aws_name, spec, substructs)
75
76
 
76
77
  unless Humidifier.const_defined?(group)
@@ -17,6 +17,7 @@ module Humidifier
17
17
  # true if it is a boolean
18
18
  def valid?(value)
19
19
  return true if whitelisted_value?(value)
20
+
20
21
  value.is_a?(TrueClass) || value.is_a?(FalseClass)
21
22
  end
22
23
  end
@@ -27,6 +27,7 @@ module Humidifier
27
27
  # on the subprop
28
28
  def valid?(list)
29
29
  return true if whitelisted_value?(list)
30
+
30
31
  list.is_a?(Enumerable) && list.all? { |value| subprop.valid?(value) }
31
32
  end
32
33
 
@@ -9,6 +9,7 @@ module Humidifier
9
9
  # converts the value through mapping using the subprop unless it is valid
10
10
  def convert(map)
11
11
  return map if valid?(map)
12
+
12
13
  map.map { |key, value| [key, subprop.convert(value)] }.to_h
13
14
  end
14
15
 
@@ -30,6 +31,7 @@ module Humidifier
30
31
  # the subprop
31
32
  def valid?(map)
32
33
  return true if whitelisted_value?(map)
34
+
33
35
  map.is_a?(Hash) && map.values.all? { |value| subprop.valid?(value) }
34
36
  end
35
37
 
@@ -36,6 +36,7 @@ module Humidifier
36
36
  # their corresponding props
37
37
  def valid?(struct)
38
38
  return true if whitelisted_value?(struct)
39
+
39
40
  struct.is_a?(Hash) && valid_struct?(struct)
40
41
  end
41
42
 
@@ -10,7 +10,7 @@ module Humidifier
10
10
  value
11
11
  else
12
12
  puts "WARNING: Property #{name} should be a Date or Time"
13
- DateTime.parse(value) # rubocop:disable Style/DateTime
13
+ DateTime.parse(value)
14
14
  end
15
15
  end
16
16
 
@@ -106,6 +106,7 @@ module Humidifier
106
106
 
107
107
  def should_upload?
108
108
  return force_upload unless force_upload.nil?
109
+
109
110
  Humidifier.config.force_upload || bytesize > MAX_TEMPLATE_BODY_SIZE
110
111
  end
111
112
 
@@ -6,6 +6,7 @@ module Humidifier
6
6
  # convert from UpperCamelCase to lower_snake_case
7
7
  def self.underscore(name)
8
8
  return nil unless name
9
+
9
10
  name.gsub(/([A-Z]+)([0-9]|[A-Z]|\z)/) { "#{$1.capitalize}#{$2}" }
10
11
  .gsub(/(.)([A-Z])/, '\1_\2').downcase
11
12
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Humidifier
4
4
  # Gem version
5
- VERSION = '2.6.0'
5
+ VERSION = '2.15.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: humidifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Localytics
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-28 00:00:00.000000000 Z
11
+ date: 2018-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.58'
75
+ version: '0.60'
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
- version: '0.58'
82
+ version: '0.60'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: simplecov
85
85
  requirement: !ruby/object:Gem::Requirement