From e70a5f806a346d04146132afab682787e7c5681e Mon Sep 17 00:00:00 2001 From: Erol Fornoles Date: Fri, 6 May 2016 18:34:00 +0800 Subject: [PATCH 1/2] Move default response to a constant --- lib/hanami/routing/endpoint_resolver.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/hanami/routing/endpoint_resolver.rb b/lib/hanami/routing/endpoint_resolver.rb index bac2d61..9573619 100644 --- a/lib/hanami/routing/endpoint_resolver.rb +++ b/lib/hanami/routing/endpoint_resolver.rb @@ -14,6 +14,10 @@ class EndpointResolver # @api private NAMING_PATTERN = '%{controller}::%{action}'.freeze + # @since 0.8.0 + # @api private + DEFAULT_RESPONSE = [404, {'X-Cascade' => 'pass'}, 'Not Found'].freeze + # Default separator for controller and action. # A different separator can be passed to #initialize with the `:separator` option. # @@ -178,7 +182,7 @@ def find(options) protected def default @endpoint_class.new( - ->(env) { [404, {'X-Cascade' => 'pass'}, 'Not Found'] } + ->(env) { DEFAULT_RESPONSE } ) end From 9c140ed234fc78d815bf779431a851d5e17f3d96 Mon Sep 17 00:00:00 2001 From: Erol Fornoles Date: Fri, 6 May 2016 22:01:44 +0800 Subject: [PATCH 2/2] Correct version doc --- lib/hanami/routing/endpoint_resolver.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hanami/routing/endpoint_resolver.rb b/lib/hanami/routing/endpoint_resolver.rb index 9573619..c352183 100644 --- a/lib/hanami/routing/endpoint_resolver.rb +++ b/lib/hanami/routing/endpoint_resolver.rb @@ -14,7 +14,7 @@ class EndpointResolver # @api private NAMING_PATTERN = '%{controller}::%{action}'.freeze - # @since 0.8.0 + # @since x.x.x # @api private DEFAULT_RESPONSE = [404, {'X-Cascade' => 'pass'}, 'Not Found'].freeze