Skip to content

Commit

Permalink
Merge pull request #66 from swistaczek/master
Browse files Browse the repository at this point in the history
fix for empty captures
  • Loading branch information
tim-vandecasteele committed Nov 4, 2013
2 parents ccdc6fa + ff09ee6 commit 9fda24b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ GEM
coderay (1.0.7)
descendants_tracker (0.0.1)
diff-lcs (1.1.3)
ffi (1.9.3-java)
git (1.2.5)
grape (0.5.0)
activesupport
Expand All @@ -31,6 +32,7 @@ GEM
rake
rdoc
json (1.7.3)
json (1.7.3-java)
kramdown (0.13.7)
method_source (0.8)
multi_json (1.7.7)
Expand All @@ -39,6 +41,11 @@ GEM
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.3.1)
pry (0.9.10-java)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.3.1)
spoon (~> 0.0)
rack (1.5.2)
rack-accept (0.4.5)
rack (>= 0.4)
Expand All @@ -64,11 +71,14 @@ GEM
shoulda-matchers (1.2.0)
activesupport (>= 3.0.0)
slop (3.3.2)
spoon (0.0.4)
ffi
virtus (0.5.5)
backports (~> 3.3)
descendants_tracker (~> 0.0.1)

PLATFORMS
java
ruby

DEPENDENCIES
Expand Down
4 changes: 3 additions & 1 deletion lib/grape-swagger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ def add_swagger_documentation(options={})

@combined_routes = {}
routes.each do |route|
resource = route.route_path.split(route.route_prefix).last.match('\/([\w|-]*?)[\.\/\(]').captures.first
route_match = route.route_path.split(route.route_prefix).last.match('\/([\w|-]*?)[\.\/\(]')
next if route_match.nil?
resource = route_match.captures.first
next if resource.empty?
resource.downcase!
@combined_routes[resource] ||= []
Expand Down

0 comments on commit 9fda24b

Please sign in to comment.