instance method
update
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v2.3.18 PrivateAvailable in: v2.2.3 v2.3.18
Signature
update()
No documentation comment.
Source
# File actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/mailbox.rb, line 335
def update
return if FileTest.zero?(@filename)
return if @updated and File.mtime(@filename) < @updated
w = nil
port = nil
time = nil
UNIXMbox.lock(@filename) {|f|
begin
f.each do |line|
if /\AFrom / === line
w.close if w
File.utime time, time, port.filename if time
port = @real.new_port
w = port.wopen
time = fromline2time(line)
else
w.print line if w
end
end
ensure
if w and not w.closed?
w.close
File.utime time, time, port.filename if time
end
end
f.truncate(0) unless @readonly
@updated = Time.now
}
end
Defined in actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/mailbox.rb line 335
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in TMail::UNIXMbox