Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Version 1.9

  • Loading branch information...
commit beff9b43d1a63254700252d36cc772b58abf8cb1 1 parent 7f089ac
@dagbrown authored Dave Brown committed
View
13 Rakefile
@@ -17,8 +17,7 @@
# http://jimweirich.umlcoop.net/packages/rake/
#========================================================================
-require 'fileutils'
-
+require 'ftools'
begin
require "rake/classic_namespace"
rescue nil
@@ -28,11 +27,10 @@ Package = "gurgitate-mail"
Modules = %w{gurgitate/deliver.rb
gurgitate/headers.rb
- gurgitate/header.rb
gurgitate/mailmessage.rb
gurgitate/deliver/maildir.rb
- gurgitate/deliver/mbox.rb
- gurgitate/deliver/mh.rb}
+ gurgitate/deliver/mh.rb
+ gurgitate/deliver/mbox.rb}
Targets = %w{gurgitate-mail.rb
gurgitate-mail
@@ -119,6 +117,7 @@ task :doc => "gurgitate-mail.rb" do |task|
end
task :test => :default do
+ $:.unshift(File.dirname(__FILE__))
require './test/runtests'
testcases = Dir[File.join("tests","test_*")].map do |file|
@@ -145,7 +144,7 @@ def ruby_compile(task)
task.prerequisites.each do |p|
run("ruby -w -c #{p}")
end
- FileUtils.cp(task.prerequisites[0], task.name)
+ File.copy(task.prerequisites[0], task.name, true)
end
file("gurgitate-mail.rb" => ["gurgitate-mail.RB"]) { |t| ruby_compile(t) }
@@ -157,7 +156,7 @@ end
file "README" => "gurgitate-mail.text" do |t|
t.sources=[t.prerequisites[0]]
Task[t.source].invoke
- FileUtils.cp(t.source, t.name)
+ File.copy(t.source, t.name, true)
end
%w{html text}.each do |s|
View
2  VERSION
@@ -1 +1 @@
-1.10.0
+1.9.1
View
10 gurgitate-mail.RB
@@ -87,20 +87,10 @@ module Gurgitate
spooldir homedir
spoolfile File.join(spooldir,"Maildir")
maildir spoolfile
- elsif style[0] == MH then
- mh_profile_path = File.join(ENV["HOME"],".mh_profile")
- if File.exists?(mh_profile_path) then
- mh_profile = YAML.load(File.read(mh_profile_path))
- maildir mh_profile["Path"]
- else
- maildir File.join(ENV["HOME"],"Mail")
- end
- spoolfile File.join(maildir,"inbox")
else
spooldir "/var/spool/mail"
spoolfile File.join(spooldir, @passwd.name)
end
-
@folderstyle = style[0]
else
raise ArgumentError, "wrong number of arguments "+
View
2  gurgitate-mail.gemspec
@@ -29,5 +29,5 @@ spec = Gem::Specification.new do |s|
# Documentation and testing.
s.has_rdoc = true
- s.test_suite_file = "test.rb"
+ s.test_files = Dir["test/*.rb"]
end
View
6 gurgitate.rb
@@ -45,4 +45,8 @@
gurgitate.add_rules(GLOBAL_RULES_POST, :system => true)
end
-gurgitate.process
+begin
+ gurgitate.process
+rescue CouldNotProcessMailError
+ exit 75
+end
View
5 gurgitate/deliver.RB
@@ -7,7 +7,6 @@
require "gurgitate/deliver/mbox"
require "gurgitate/deliver/maildir"
-require "gurgitate/deliver/mh"
module Gurgitate
module Deliver
@@ -39,7 +38,7 @@ module Gurgitate
end
begin
- [MBox,Maildir,MH].each do |mod|
+ [MBox,Maildir].each do |mod|
if mod::check_mailbox(mailbox) then
extend mod
raise MailboxFound
@@ -60,7 +59,7 @@ module Gurgitate
# No hints from the user either. Let's guess!
# I'll use the same heuristic that Postfix uses--if the
# mailbox name ends with a /, then make it a Maildir,
- # otherwise make it a mail file
+ # otherwise make it a mail file (sorry, MH users)
if mailbox =~ /\/$/ then
extend Maildir
else
View
4 gurgitate/deliver/maildir.RB
@@ -70,6 +70,10 @@ module Gurgitate
make_mailbox(mailbox)
end
+ unless File.stat(mailbox).directory?
+ raise SystemError, 'not a directory'
+ end
+
tmpfilename=maildir_getfilename(File.join(mailbox,"tmp"))
File.open(tmpfilename,File::CREAT|File::WRONLY) do |fh|
fh.write(self.to_s)
View
13 install.rb
@@ -1,7 +1,7 @@
#!/usr/bin/ruby -w
require "rbconfig"
-require "fileutils"
+require "ftools"
module Gurgitate
Package = "gurgitate-mail"
@@ -38,19 +38,19 @@ def self.install(prefix=nil)
sitedir = CONFIG["sitedir"]
bindir = CONFIG["bindir"]
mandir = File.join(CONFIG["mandir"],"man1")
- dest = CONFIG["sitelibdir"]
+ dest = File.join(sitedir,version)
end
destgur = File.join(dest,"gurgitate")
destdel = File.join(destgur,"deliver")
print "Installing #{Package}.rb in #{dest}...\n"
- FileUtils.install("#{Package}.rb", dest, :mode => 0644)
+ File.install("#{Package}.rb", dest, 0644)
mkdir destgur
Dir.glob(File.join("gurgitate","*.rb")).each { |f|
puts "Installing #{f} in #{destgur}..."
- FileUtils.install(f,destgur)
+ File.install(f,destgur)
}
mkdir destdel
@@ -58,12 +58,11 @@ def self.install(prefix=nil)
Dir.glob(File.join(File.join("gurgitate","deliver"),"*.rb")).each {
|f|
puts "Installing #{f} in #{destdel}..."
- FileUtils.install(f,destdel)
+ File.install(f,destdel)
}
print "Installing #{Package}.1 in #{mandir}...\n"
- FileUtils.install("#{Package}.man","#{mandir}/#{Package}.1",
- :mode => 0644)
+ File.install("#{Package}.man","#{mandir}/#{Package}.1", 0644)
print "Installing #{Package} in #{bindir}...\n"
# Not so simple; need to put in the shebang line
View
2  test.rb
@@ -14,7 +14,7 @@ def runtests(testcases)
end
end
-testcases = Dir[File.join("tests","test_*")].map do |file|
+testcases = Dir[File.join("test","test_*")].map do |file|
load file
eval("TC_" + File.basename(file,".rb").sub(/^test_/,'').capitalize)
end
Please sign in to comment.
Something went wrong with that request. Please try again.