From f875a3f3d4d0fa3afd1bda3801307e7681bf3da5 Mon Sep 17 00:00:00 2001 From: Hiro Asari Date: Fri, 15 Nov 2013 11:03:31 -0500 Subject: [PATCH 1/2] Fix auto-generated endpoints text Before: /endpoints:prefi After: /endpoints/:prefix --- lib/travis/api/app/endpoint/endpoints.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/travis/api/app/endpoint/endpoints.rb b/lib/travis/api/app/endpoint/endpoints.rb index 5416df99..4e21a395 100644 --- a/lib/travis/api/app/endpoint/endpoints.rb +++ b/lib/travis/api/app/endpoint/endpoints.rb @@ -16,7 +16,7 @@ class Travis::Api::App namespace = route.namespace controller = namespace.to_s.constantize route_info = { - 'uri' => (controller.prefix + route.http_path[1..-2]).gsub('//', '/'), + 'uri' => (controller.prefix + '/' + route.http_path[1..-1]).gsub('//', '/'), 'verb' => route.http_verb, 'doc' => route.docstring, 'scope' => /scope\W+(\w+)/.match(route.source).try(:[], 1) || controller.default_scope.to_s From 1a45e5dae1ef694bd0f3c7c4b91f69787859b390 Mon Sep 17 00:00:00 2001 From: Hiro Asari Date: Fri, 15 Nov 2013 11:33:30 -0500 Subject: [PATCH 2/2] Generate the string more cleanly --- lib/travis/api/app/endpoint/endpoints.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/travis/api/app/endpoint/endpoints.rb b/lib/travis/api/app/endpoint/endpoints.rb index 4e21a395..ffe2219c 100644 --- a/lib/travis/api/app/endpoint/endpoints.rb +++ b/lib/travis/api/app/endpoint/endpoints.rb @@ -16,7 +16,7 @@ class Travis::Api::App namespace = route.namespace controller = namespace.to_s.constantize route_info = { - 'uri' => (controller.prefix + '/' + route.http_path[1..-1]).gsub('//', '/'), + 'uri' => (controller.prefix + route.http_path).gsub('//', '/'), 'verb' => route.http_verb, 'doc' => route.docstring, 'scope' => /scope\W+(\w+)/.match(route.source).try(:[], 1) || controller.default_scope.to_s