From 9c492d89d3ae444a745a92ce76c5ddd21c9732c0 Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Thu, 26 Jun 2014 20:57:14 +0000 Subject: [PATCH] Compact warnings emmited on namespace matching --- lib/mutant/matcher/namespace.rb | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/mutant/matcher/namespace.rb b/lib/mutant/matcher/namespace.rb index b42bf4b2..479c61c2 100644 --- a/lib/mutant/matcher/namespace.rb +++ b/lib/mutant/matcher/namespace.rb @@ -2,6 +2,8 @@ module Mutant class Matcher # Matcher for specific namespace + # + # rubocop:disable LineLength class Namespace < self include Concord::Public.new(:cache, :namespace) @@ -64,14 +66,12 @@ module Mutant # # @api private # + # rubocop:disable LineLength + # def self.scope_name(scope) scope.name rescue => exception - $stderr.puts <<-MESSAGE -WARNING: -While optaining #{scope.class}#name from: #{scope.inspect} -It raised an error: #{exception.inspect} fix your lib! - MESSAGE + $stderr.puts("WARNING: While optaining #{scope.class}#name from: #{scope.inspect} It raised an error: #{exception.inspect} fix your lib!") nil end @@ -86,11 +86,7 @@ It raised an error: #{exception.inspect} fix your lib! def emit_scope(scope) name = self.class.scope_name(scope) unless name.nil? or name.kind_of?(String) - $stderr.puts <<-MESSAGE -WARNING: -#{scope.class}#name from: #{scope.inspect} did not return a String or nil. -Fix your lib to support normal ruby semantics! - MESSAGE + $stderr.puts("WARNING: #{scope.class}#name from: #{scope.inspect} did not return a String or nil. Fix your lib to support normal ruby semantics!") return end yield scope if pattern =~ name