Methods
Included Modules
Private Instance methods
[ show source ]
# File lib/action_mailer/vendor/tmail/port.rb, line 231
231: def get_status( tag )
232: File.foreach(@filename) {|line|
233: return false if line.strip.empty?
234: if m = /\AX-TMail-Status:/i.match(line)
235: return m.post_match.strip.include?(tag[0])
236: end
237: }
238: false
239: end
[ show source ]
# File lib/action_mailer/vendor/tmail/port.rb, line 195
195: def set_status( tag, flag )
196: begin
197: tmpfile = @filename + '.tmailtmp.' + $$.to_s
198: File.open(tmpfile, 'w') {|f|
199: write_status f, tag, flag
200: }
201: File.unlink @filename
202: File.link tmpfile, @filename
203: ensure
204: File.unlink tmpfile
205: end
206: end
[ show source ]
# File lib/action_mailer/vendor/tmail/port.rb, line 208
208: def write_status( f, tag, flag )
209: stat = ''
210: File.open(@filename) {|r|
211: while line = r.gets
212: if line.strip.empty?
213: break
214: elsif m = /\AX-TMail-Status:/i.match(line)
215: stat = m.post_match.strip
216: else
217: f.print line
218: end
219: end
220:
221: s = procinfostr(stat, tag, flag)
222: f.puts 'X-TMail-Status: ' + s unless s.empty?
223: f.puts
224:
225: while s = r.read(2048)
226: f.write s
227: end
228: }
229: end