From: wmorgan Date: Fri, 5 Oct 2007 21:37:57 +0000 (+0000) Subject: better URI handling for maildir and mbox X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=4a874da52e44bf8fd9f78c523a344a4fded30eab;p=sup better URI handling for maildir and mbox git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@602 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb index bb59c73..6020c86 100644 --- a/lib/sup/maildir.rb +++ b/lib/sup/maildir.rb @@ -19,6 +19,7 @@ class Maildir < Source raise ArgumentError, "not a maildir URI" unless uri.scheme == "maildir" raise ArgumentError, "maildir URI cannot have a host: #{uri.host}" if uri.host + raise ArgumentError, "mbox URI must have a path component" unless uri.path @dir = uri.path @labels = (labels || []).freeze diff --git a/lib/sup/mbox/loader.rb b/lib/sup/mbox/loader.rb index c139265..48ddfba 100644 --- a/lib/sup/mbox/loader.rb +++ b/lib/sup/mbox/loader.rb @@ -16,7 +16,8 @@ class Loader < Source when String uri = URI(Source.expand_filesystem_uri(uri_or_fp)) raise ArgumentError, "not an mbox uri" unless uri.scheme == "mbox" - raise ArgumentError, "mbox uri ('#{uri}') cannot have a host: #{uri.host}" if uri.host + raise ArgumentError, "mbox URI ('#{uri}') cannot have a host: #{uri.host}" if uri.host + raise ArgumentError, "mbox URI must have a path component" unless uri.path @f = File.open uri.path @path = uri.path else