From 91ddbb6cf6ba8b452c53dcbe57aae2658062b76a Mon Sep 17 00:00:00 2001 From: Florian Frank Date: Sat, 24 Dec 2011 22:53:24 +0100 Subject: [PATCH] Strip some more spaces --- bin/rtail | 2 +- lib/file/tail.rb | 14 +++++++------- lib/file/tail/logfile.rb | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/rtail b/bin/rtail index 0196eae..e91fffe 100755 --- a/bin/rtail +++ b/bin/rtail @@ -28,7 +28,7 @@ $logfiles = File::Tail::Group.new def add_logfiles(logfiles) logfiles = logfiles.map { |l| File.expand_path(l) } - $opt['m'] and logfiles = + $opt['m'] and logfiles = logfiles.select { |l| !$opt['m'] || File.fnmatch?($opt['m'], File.basename(l)) } for l in logfiles $logfiles.each_file.any? { |f| l == f.path } and next diff --git a/lib/file/tail.rb b/lib/file/tail.rb index 9725e5e..4c7cf98 100644 --- a/lib/file/tail.rb +++ b/lib/file/tail.rb @@ -26,12 +26,12 @@ class ReturnException < TailException; end class BreakException < TailException; end # The ReopenException is raised internally if File::Tail - # gets suspicious something unusual has happend to + # gets suspicious something unusual has happend to # the tailed file, e. g., it was rotated away. The exception # is caught and an attempt to reopen it is made. class ReopenException < TailException attr_reader :mode - + # Creates an ReopenException object. The mode defaults to # :bottom which indicates that the file # should be tailed beginning from the end. :top @@ -111,7 +111,7 @@ def forward(n = 0) # # The additional argument bufsize is # used to determine the buffer size that is used to step through - # the file backwards. It defaults to the block size of the + # the file backwards. It defaults to the block size of the # filesystem this file belongs to or 8192 bytes if this cannot # be determined. def backward(n = 0, bufsize = nil) @@ -188,7 +188,7 @@ def tail(n = nil, &block) # :yields: line end end end - + private def read_line(&block) @@ -265,7 +265,7 @@ def sleep_interval sleep @interval @no_read += @interval end - + def reopen_file(mode) $DEBUG and $stdout.print "Reopening '#{path}', mode = #{mode}.\n" @no_read = 0 @@ -274,7 +274,7 @@ def reopen_file(mode) backward end rescue Errno::ESTALE, Errno::ENOENT - if @reopen_deleted + if @reopen_deleted sleep @max_interval retry else @@ -284,7 +284,7 @@ def reopen_file(mode) def output_debug_information $DEBUG or return - STDERR.puts({ + STDERR.puts({ :path => path, :lines => @lines, :interval => @interval, diff --git a/lib/file/tail/logfile.rb b/lib/file/tail/logfile.rb index 3e395d4..1513b7b 100644 --- a/lib/file/tail/logfile.rb +++ b/lib/file/tail/logfile.rb @@ -42,7 +42,7 @@ class Logfile < File def self.open(filename, opts = {}, &block) # :yields: file file = new filename opts.each do |o, v| - writer = o.to_s + "=" + writer = o.to_s + "=" file.__send__(writer, v) if file.respond_to? writer end if opts.key?(:wind) or opts.key?(:rewind)