Generate the string more cleanly
This commit is contained in:
parent
f875a3f3d4
commit
1a45e5dae1
|
@ -16,7 +16,7 @@ class Travis::Api::App
|
||||||
namespace = route.namespace
|
namespace = route.namespace
|
||||||
controller = namespace.to_s.constantize
|
controller = namespace.to_s.constantize
|
||||||
route_info = {
|
route_info = {
|
||||||
'uri' => (controller.prefix + '/' + route.http_path[1..-1]).gsub('//', '/'),
|
'uri' => (controller.prefix + route.http_path).gsub('//', '/'),
|
||||||
'verb' => route.http_verb,
|
'verb' => route.http_verb,
|
||||||
'doc' => route.docstring,
|
'doc' => route.docstring,
|
||||||
'scope' => /scope\W+(\w+)/.match(route.source).try(:[], 1) || controller.default_scope.to_s
|
'scope' => /scope\W+(\w+)/.match(route.source).try(:[], 1) || controller.default_scope.to_s
|
||||||
|
|
Loading…
Reference in New Issue
Block a user