commit d37b2c2965c5e164207e2021eee9e83ea08079d5
parent 42ee12157508704adbd4869a252be45c759c4b05
Author: Dan Callaghan <djc@djc.id.au>
Date: Sat, 17 Oct 2026 13:09:39 +1100
delete unused load_header method
Diffstat:
6 files changed, 0 insertions(+), 27 deletions(-)
diff --git a/lib/sup/draft.rb b/lib/sup/draft.rb
@@ -70,10 +70,6 @@ class DraftLoader < Source
def fn_for_offset o; File.join(@dir, o.to_s); end
- def load_header offset
- File.open(fn_for_offset(offset)) { |f| parse_raw_email_header f }
- end
-
def load_message offset
raise SourceError, "Draft not found" unless File.exist? fn_for_offset(offset)
File.open(fn_for_offset(offset)) do |f|
diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb
@@ -84,10 +84,6 @@ class Maildir < Source
end
end
- def load_header id
- with_file_for(id) { |f| parse_raw_email_header f }
- end
-
def load_message id
with_file_for(id) { |f| RMail::Parser.read f }
end
diff --git a/lib/sup/mbox.rb b/lib/sup/mbox.rb
@@ -69,16 +69,6 @@ class MBox < Source
end
end
- def load_header offset
- header = nil
- @mutex.synchronize do
- ensure_open
- @f.seek offset
- header = parse_raw_email_header @f
- end
- header
- end
-
def load_message offset
@mutex.synchronize do
ensure_open
diff --git a/lib/sup/message.rb b/lib/sup/message.rb
@@ -48,8 +48,6 @@ class Message
attr_accessor :locations
- ## if you specify a :header, will use values from that. otherwise,
- ## will try and load the header from the source.
def initialize opts
@locations = opts[:locations] or raise ArgumentError, "locations can't be nil"
@snippet = opts[:snippet]
@@ -64,8 +62,6 @@ class Message
## we need to initialize this. see comments in parse_header as to
## why.
@refs = []
-
- #parse_header(opts[:header] || @source.load_header(@source_info))
end
def decode_header_field v
diff --git a/lib/sup/source.rb b/lib/sup/source.rb
@@ -33,7 +33,6 @@ class Source
## To write a new source, subclass this class, and implement:
##
## - initialize
- ## - load_header offset
## - load_message offset
## - raw_header offset
## - raw_message offset
diff --git a/test/dummy_source.rb b/test/dummy_source.rb
@@ -32,10 +32,6 @@ class DummySource < Source
File.open(fn, 'rb') { |f| yield f }
end
- def load_header id
- with_file_for(id) { |f| parse_raw_email_header f }
- end
-
def load_message id
with_file_for(id) { |f| RMail::Parser.read f }
end