swagger_coverage 0.0.2 → 0.0.3
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/lib/code_parser.rb +9 -4
- data/lib/swagger_coverage/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef1bc1c5b9310099704c88f785fa83efdb63486b
|
4
|
+
data.tar.gz: 1c8f745a084987db0428a0b9d8d9074427b75fdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fe56477b040907811f5cdb8d52187c5b5c30dace2e73f43252195044710b8c29c0f9d470093a2f2461ea0c5ca7a44e00d449f4f20c31aff57eb4025a478ce63
|
7
|
+
data.tar.gz: c0c89e0826cadfb65f216d2cf01ac74fb7bbfe295aeb2d09a37d62689ead02390f0a23b4196d4e0ddc712a4f9b31035ac4c25ab04c7fdb1809324eb5386ac4f8
|
data/lib/code_parser.rb
CHANGED
@@ -4,15 +4,20 @@ class CodeParser
|
|
4
4
|
@raw_routes_output = output
|
5
5
|
end
|
6
6
|
|
7
|
+
#returns an empty array if no api_endpoints in code
|
7
8
|
def api_endpoints(output = @raw_routes_output, api = false)
|
8
9
|
endpoints = []
|
9
10
|
parsed_routes(output).each do |route|
|
10
|
-
if
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
if route[:route] != nil
|
12
|
+
if api
|
13
|
+
endpoints << route[:route] if route[:route].include?('/api')
|
14
|
+
else
|
15
|
+
endpoints << route[:route]
|
16
|
+
end
|
14
17
|
end
|
15
18
|
end
|
19
|
+
contains_api = endpoints.any? { |route| route.include?('/api') }
|
20
|
+
endpoints = [] if !contains_api
|
16
21
|
endpoints
|
17
22
|
end
|
18
23
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swagger_coverage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Harthcock
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|