Skip to content

Commit

Permalink
Strip some more spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
flori committed Dec 24, 2011
1 parent 4447696 commit 91ddbb6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bin/rtail
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions lib/file/tail.rb
Expand Up @@ -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
# <code>:bottom</code> which indicates that the file
# should be tailed beginning from the end. <code>:top</code>
Expand Down Expand Up @@ -111,7 +111,7 @@ def forward(n = 0)
#
# The additional argument <code>bufsize</code> 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)
Expand Down Expand Up @@ -188,7 +188,7 @@ def tail(n = nil, &block) # :yields: line
end
end
end

private

def read_line(&block)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/file/tail/logfile.rb
Expand Up @@ -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)
Expand Down

0 comments on commit 91ddbb6

Please sign in to comment.