swagger-docs 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9940ad082299dc2d0d6cb34a3e7c1336a37e0c8b
4
- data.tar.gz: 9f75192abe6f35735aea5b4948482211177b5cf0
3
+ metadata.gz: fae3be7ad414552f11679fa9038c9bdadc8e313a
4
+ data.tar.gz: d669dca205c935dcd57af4b405fe5e777cd014ff
5
5
  SHA512:
6
- metadata.gz: 9d1a4e4f8a4c83ed76b547414ff6c1ac1887d3570bcb43b90b665d7e8ca9c97ee7f5de6cdd097d5c790bac0a8fdf2dbd53b04c72ae892e85c415b0757bdd444b
7
- data.tar.gz: abba4ab15746a0ec3e1b8c8b2bbe78f35c62438289ed53641b1b682c5204eb971f7b6c67d67103a29093c5eb5eb49025a6194012b6564f07cdc4229c0e44b875
6
+ metadata.gz: 0c6cc1f82349ef06372e0443312f7abd7e154942b35631f4176b450e841d3b83c905e396d665d22c7874aa244c8dd5b1422b9451e8f2c6de84a9a04243b05b9c
7
+ data.tar.gz: fd41c0368dc912c349bcf58ab3e286b6b3506a4295afcb5fda9e8452e13851cf048ad8ddd28b489dcdf20ca47645a3dd673f2edfc116b167c465e97300e42cf8
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.1.3
2
+ - Fix issue where empty path throws error
3
+
1
4
  ## 0.1.2
2
5
  - Add suport for Swagger models
3
6
  - Use ActionControlller::Base instead of ApplicationController. fixes #27
data/README.md CHANGED
@@ -565,7 +565,7 @@ users.json output:
565
565
 
566
566
  ## Thanks to our contributors
567
567
 
568
- Thanks to @jdar and all our contributors.
568
+ Thanks to @jdar, @fotinakis, @stevschmid and all of our contributors for making swagger-docs better.
569
569
 
570
570
  ## Contributing
571
571
 
@@ -102,9 +102,10 @@ module Swagger
102
102
  end
103
103
 
104
104
  def process_path(path, root, config, settings)
105
- return {action: empty} if path.empty?
106
- klass = "#{path.to_s.camelize}Controller".constantize
107
- return {action: :skipped, path: path} if !klass.methods.include?(:swagger_config) or !klass.swagger_config[:controller]
105
+ return {action: :skipped, reason: :empty_path} if path.empty?
106
+ klass = "#{path.to_s.camelize}Controller".constantize rescue nil
107
+ return {action: :skipped, path: path, reason: :klass_not_present} if !klass
108
+ return {action: :skipped, path: path, reason: :not_swagger_resource} if !klass.methods.include?(:swagger_config) or !klass.swagger_config[:controller]
108
109
  apis, models = [], {}
109
110
  Config.base_application.routes.routes.select{|i| i.defaults[:controller] == path}.each do |route|
110
111
  ret = get_route_path_apis(path, route, klass, settings, config)
@@ -1,5 +1,5 @@
1
1
  module Swagger
2
2
  module Docs
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
@@ -18,7 +18,8 @@ describe Swagger::Docs::Generator do
18
18
  stub_route("^GET$", "show", "api/v1/sample", "/api/v1/sample/:id(.:format)"),
19
19
  stub_route("^PUT$", "update", "api/v1/sample", "/api/v1/sample/:id(.:format)"),
20
20
  stub_route("^DELETE$", "destroy", "api/v1/sample", "/api/v1/sample/:id(.:format)"),
21
- stub_route("^GET$", "new", "api/v1/sample", "/api/v1/sample/new(.:format)") # no parameters for this method
21
+ stub_route("^GET$", "new", "api/v1/sample", "/api/v1/sample/new(.:format)"), # no parameters for this method
22
+ stub_route("^GET$", "index", "", "/api/v1/empty_path") # intentional empty path should not cause any errors
22
23
  ]}
23
24
 
24
25
  let(:tmp_dir) { Pathname.new('/tmp/swagger-docs/') }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swagger-docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rich Hollis
@@ -30,7 +30,7 @@ cert_chain:
30
30
  RYcsqDfanYBx7QcftOnbeQq7/Ep7Zx+W9+Ph3TiJLMLdAr7bLkgN1SjvrjTL5mQR
31
31
  FuQtYvE4LKiUQpG7vLTRB78dQBlSj9fnv2OM9w==
32
32
  -----END CERTIFICATE-----
33
- date: 2014-04-02 00:00:00.000000000 Z
33
+ date: 2014-04-03 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: bundler
metadata.gz.sig CHANGED
Binary file