From b38e49ea340c551bfa406f3eb32eabd42fbc1847 Mon Sep 17 00:00:00 2001 From: Andrew Crump Date: Wed, 6 Jun 2012 23:44:55 +0100 Subject: [PATCH] Restrict to descendant axis, refs #31. --- lib/foodcritic/api.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/foodcritic/api.rb b/lib/foodcritic/api.rb index 2e36d359..16e34e2c 100644 --- a/lib/foodcritic/api.rb +++ b/lib/foodcritic/api.rb @@ -186,7 +186,7 @@ def match(node) # a string or a Node if the resource name is an expression. def notifications(ast) return [] unless ast.respond_to?(:xpath) - ast.xpath('//command[ident/@value="notifies" or + ast.xpath('descendant::command[ident/@value="notifies" or ident/@value="subscribes"]').map do |notifies| params = notifies.xpath('descendant::method_add_arg[fcall/ident/