cthiesfork-awspec 1.1.0 → 1.2.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.
- checksums.yaml +4 -4
- data/awspec.gemspec +1 -1
- data/doc/resource_types.md +4 -0
- data/lib/awspec/stub/apigateway.rb +4 -2
- data/lib/awspec/type/apigateway.rb +24 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f04090ce54345c6edab9b9f45776c27b86f57da62c3f34c65f9d125b2aac8aa
|
4
|
+
data.tar.gz: 7d425a66935a8491bb201e47146eaa2d1117e4b9d235ca502e8c6212728a925e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e4f27fb7faf28ad0cc0b3c849a1626528711cf8c0bf79387aafb23dee1059b2221b89387da6ef003c9092bfaf4319a41f76f804b35a59236a8324d68eb45a06
|
7
|
+
data.tar.gz: b6168cc0fc35bc2c71515b84c32bc1c1ab49cb178e762a3570680330b51e331284ed3bf60a4ce748ab36a495c0f53b078e50c369ea482f49f9ca57aa55b94333
|
data/awspec.gemspec
CHANGED
data/doc/resource_types.md
CHANGED
@@ -284,8 +284,12 @@ describe apigateway('my-apigateway') do
|
|
284
284
|
end
|
285
285
|
```
|
286
286
|
|
287
|
+
### have_integration_method
|
288
|
+
|
287
289
|
### have_integration_path
|
288
290
|
|
291
|
+
### have_method
|
292
|
+
|
289
293
|
### have_path
|
290
294
|
|
291
295
|
### its(:id), its(:name), its(:description), its(:created_date), its(:version), its(:warnings), its(:binary_media_types), its(:minimum_compression_size), its(:api_key_source), its(:policy), its(:tags)
|
@@ -78,7 +78,8 @@ Aws.config[:apigateway] = {
|
|
78
78
|
path: '/proxy',
|
79
79
|
resource_methods: {
|
80
80
|
'GET' => {
|
81
|
-
|
81
|
+
http_method: 'GET',
|
82
|
+
method_integration: { http_method: 'POST', uri: 'http://127.0.0.1:8080/hockey' }
|
82
83
|
}
|
83
84
|
}
|
84
85
|
},
|
@@ -86,7 +87,8 @@ Aws.config[:apigateway] = {
|
|
86
87
|
path: '/zambonis',
|
87
88
|
resource_methods: {
|
88
89
|
'POST' => {
|
89
|
-
|
90
|
+
http_method: 'POST',
|
91
|
+
method_integration: { http_method: 'POST', uri: 'http://127.0.0.1:8080/zambonis/{arena}' }
|
90
92
|
}
|
91
93
|
}
|
92
94
|
},
|
@@ -21,21 +21,39 @@ module Awspec::Type
|
|
21
21
|
def has_path?(path)
|
22
22
|
check_existence
|
23
23
|
self.api_resources.each do |resource|
|
24
|
-
return
|
24
|
+
return resource if resource.path == path
|
25
25
|
end
|
26
|
-
|
26
|
+
nil
|
27
27
|
end
|
28
28
|
|
29
29
|
def has_integration_path?(path)
|
30
30
|
check_existence
|
31
31
|
self.api_resources.each do |resource|
|
32
32
|
next if resource.resource_methods.nil?
|
33
|
-
resource.resource_methods.each do |_,
|
34
|
-
uri = Addressable::URI.parse(
|
35
|
-
return
|
33
|
+
resource.resource_methods.each do |_, method|
|
34
|
+
uri = Addressable::URI.parse(method.method_integration.uri)
|
35
|
+
return resource if uri.path == path
|
36
36
|
end
|
37
37
|
end
|
38
|
-
|
38
|
+
nil
|
39
|
+
end
|
40
|
+
|
41
|
+
def has_method?(path, http_method)
|
42
|
+
check_existence
|
43
|
+
resource_to_check = has_path?(path)
|
44
|
+
return nil if resource_to_check.nil?
|
45
|
+
resource_to_check.resource_methods.each do |_, method|
|
46
|
+
return resource_to_check if method.http_method == http_method
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def has_integration_method?(integration_path, http_method)
|
51
|
+
check_existence
|
52
|
+
integration_resource_to_check = has_integration_path?(integration_path)
|
53
|
+
return nil if integration_resource_to_check.nil?
|
54
|
+
integration_resource_to_check.resource_methods.each do |_, method|
|
55
|
+
return integration_resource_to_check if method.method_integration.http_method == http_method
|
56
|
+
end
|
39
57
|
end
|
40
58
|
end
|
41
59
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cthiesfork-awspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cthies
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|