lib/rubocop/cop/rake/duplicate_namespace.rb in rubocop-rake-0.5.1 vs lib/rubocop/cop/rake/duplicate_namespace.rb in rubocop-rake-0.6.0
- old
+ new
@@ -25,11 +25,11 @@
# end
# task :hoge do
# end
# end
#
- class DuplicateNamespace < Cop
+ class DuplicateNamespace < Base
include Helper::OnNamespace
MSG = 'Namespace `%<namespace>s` is defined at both %<previous>s and %<current>s.'
def initialize(*)
@@ -53,10 +53,10 @@
def namespaces(node)
ns = []
node.each_ancestor(:block) do |block_node|
send_node = block_node.send_node
- next unless send_node.method_name == :namespace
+ next unless send_node.method?(:namespace)
name = Helper::TaskName.task_name(send_node)
ns << name
end