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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c985edef988e05d377a87ad0cb79c56a4dfe1145
4
- data.tar.gz: 23bb02c5fa6d764765e33a65799616c3ca462419
3
+ metadata.gz: ef1bc1c5b9310099704c88f785fa83efdb63486b
4
+ data.tar.gz: 1c8f745a084987db0428a0b9d8d9074427b75fdd
5
5
  SHA512:
6
- metadata.gz: 66f40c56458c050b56be2239085f7a0b187001a5c7e71eccf6728addd64500e34bf3aec7fba93a733ac49a398fb01321da909fe9d7195756a929e60db4b6b3fc
7
- data.tar.gz: 361ee33f820bb435b409aa004ac209deb90e0b324869a90a51ed10f841e13332617a5f4395d27e4bf87abc8f828ac550aedb7910d5bf4b6ace7b2e3331d36238
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 api
11
- endpoints << route[:route] if route[:route].include?('/api')
12
- else
13
- endpoints << route[:route]
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
 
@@ -1,3 +1,3 @@
1
1
  module SwaggerCoverage
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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.2
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-06-27 00:00:00.000000000 Z
11
+ date: 2016-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler