- C
- E
- L
- M
- N
- R
- S
make _From line
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 209 def UNIXMbox.create_from_line( port ) sprintf 'From %s %s', fromaddr(), TextUtils.time2str(File.mtime(port.filename)) end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 151 def UNIXMbox.lock( fname ) begin f = File.open(fname) f.flock File::LOCK_EX yield f ensure f.flock File::LOCK_UN f.close if f and not f.closed? end end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 186 def UNIXMbox.mkfinal( mh, mboxfile, writeback_p, cleanup_p ) lambda { if writeback_p lock(mboxfile) {|f| mh.each_port do |port| f.puts create_from_line(port) port.ropen {|r| f.puts r.read } end } end if cleanup_p Dir.foreach(mh.dirname) do |fname| next if %r\A\.\.?\z/ === fname File.unlink "#{mh.dirname}/#{fname}" end Dir.rmdir mh.dirname end } end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 166 def UNIXMbox.new( fname, tmpdir = nil, readonly = false ) tmpdir = ENV['TEMP'] || ENV['TMP'] || '/tmp' newobj(fname, "#{tmpdir}/ruby_tmail_#{$$}_#{rand()}", readonly, false) end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 175 def initialize( fname, mhdir, readonly, static ) @filename = fname @readonly = readonly @closed = false Dir.mkdir mhdir @real = MhMailbox.new(mhdir) @finalizer = UNIXMbox.mkfinal(@real, @filename, !@readonly, !static) ObjectSpace.define_finalizer self, @finalizer end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 171 def UNIXMbox.static_new( fname, dir, readonly = false ) newobj(fname, dir, readonly, true) end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 222 def close return if @closed ObjectSpace.undefine_finalizer self @finalizer.call @finalizer = nil @real = nil @closed = true @updated = nil end
old #each_mail returns Port
def #each_mail( &block )
each_port do |port| yield Mail.new(port) end
end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 256 def each_new_port( mtime = nil ) close_check update @real.each_new_port(mtime) {|p| yield p } end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 233 def each_port( &block ) close_check update @real.each_port(&block) end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 262 def new_port close_check @real.new_port end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb, line 241 def reverse_each_port( &block ) close_check update @real.reverse_each_port(&block) end