lib/logger.rb in narou-1.5.7.1 vs lib/logger.rb in narou-1.5.8
- old
+ new
@@ -27,9 +27,17 @@
def silent
@is_silent
end
+ def silence(&block)
+ raise "need a block" unless block
+ tmp = self.silent
+ self.silent = true
+ block.call
+ self.silent = tmp
+ end
+
def strip_color(str)
if $disable_color
str
else
str.gsub(/(?:\e\[\d*[a-zA-Z])+/, "")