humidifier 1.0.1 → 1.0.2

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.
data/specs/fixer.rb DELETED
@@ -1,53 +0,0 @@
1
- class Fixer
2
- attr_reader :filepath, :parsed
3
-
4
- def initialize(filepath)
5
- @filepath = filepath
6
- @parsed = JSON.parse(File.read(filepath))
7
- end
8
-
9
- def write
10
- self.class.fixes.each { |fix| send(fix) }
11
- File.write(filepath, JSON.pretty_generate(parsed))
12
- end
13
-
14
- class << self
15
- attr_reader :fixes
16
-
17
- def fix(_reason, &block)
18
- fix_name = :"fix_#{fixes.length}"
19
- define_method(fix_name, &block)
20
- @fixes << fix_name
21
- end
22
- end
23
- @fixes = []
24
-
25
- fix 'AWS::ElasticLoadBalancing::LoadBalancer.Policies references invalid ItemType "json"' do
26
- parsed['PropertyTypes']['AWS::ElasticLoadBalancing::LoadBalancer.Policies']['Properties']['Attributes'].delete('ItemType')
27
- parsed['PropertyTypes']['AWS::ElasticLoadBalancing::LoadBalancer.Policies']['Properties']['Attributes']['PrimitiveItemType'] = 'Json'
28
- end
29
-
30
- fix 'AWS::DynamoDB::Table references invalid ItemType "AttributeDefinition"' do
31
- parsed['ResourceTypes']['AWS::DynamoDB::Table']['Properties']['AttributeDefinitions']['ItemType'] = 'AttributeDefinitions'
32
- end
33
-
34
- fix 'AWS::CloudFront::Distribution.Origin references missing ItemType "OriginCustomHeader"' do
35
- parsed['PropertyTypes']['AWS::CloudFront::Distribution.OriginCustomHeader'] = {
36
- "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-origin-origincustomheader.html",
37
- "Properties": {
38
- "HeaderName": {
39
- "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-origin-origincustomheader.html#cfn-cloudfront-origin-origincustomheader-headername",
40
- "Required": true,
41
- "PrimitiveType": "String",
42
- "UpdateType": "Mutable"
43
- },
44
- "HeaderValue": {
45
- "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-origin-origincustomheader.html#cfn-cloudfront-origin-origincustomheader-headervalue",
46
- "PrimitiveType": "String",
47
- "Required": true,
48
- "UpdateType": "Mutable"
49
- }
50
- }
51
- }
52
- end
53
- end