# File lib/sup/draft.rb, line 53 def each ids = get_ids ids.each do |id| if id >= cur_offset self.cur_offset = id + 1 yield [id, [:draft, :inbox]] end end end
# File lib/sup/draft.rb, line 95 def each_raw_message_line offset File.open(fn_for_offset(offset)) do |f| yield f.gets until f.eof? end end
# File lib/sup/draft.rb, line 106 def end_offset ids = get_ids ids.empty? ? 0 : (ids.last + 1) end
# File lib/sup/draft.rb, line 71 def fn_for_offset o; File.join(@dir, o.to_s); end
# File lib/sup/draft.rb, line 63 def gen_offset i = cur_offset while File.exists? fn_for_offset(i) i += 1 end i end
# File lib/sup/draft.rb, line 73 def load_header offset File.open(fn_for_offset(offset)) { |f| parse_raw_email_header f } end
# File lib/sup/draft.rb, line 77 def load_message offset File.open fn_for_offset(offset) do |f| RMail::Mailbox::MBoxReader.new(f).each_message do |input| return RMail::Parser.read(input) end end end
# File lib/sup/draft.rb, line 85 def raw_header offset ret = "" File.open fn_for_offset(offset) do |f| until f.eof? || (l = f.gets) =~ /^$/ ret += l end end ret end
# File lib/sup/draft.rb, line 101 def raw_message offset IO.read(fn_for_offset(offset)) end
Generated with the Darkfish Rdoc Generator 2.